annotate Items.cpp @ 2464:104fdbea0386

cleaning project part 2
author zipi
date Sun, 17 Aug 2014 17:49:34 +0100
parents f4af3b203f65
children b054ea5daf45
rev   line source
2415
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2378
diff changeset
1 #define _CRTDBG_MAP_ALLOC
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2378
diff changeset
2 #include <stdlib.h>
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2378
diff changeset
3 #include <crtdbg.h>
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2378
diff changeset
4
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
5 #define _CRT_SECURE_NO_WARNINGS
0
Ritor1
parents:
diff changeset
6 #include <stdlib.h>
2260
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
7 #include <string>
2355
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2349
diff changeset
8 #include "UI\UIHouses.h"
2349
7ebc07cd6c53 Adding GUIButton.h
Grumpy7
parents: 2340
diff changeset
9 #include "GUIButton.h"
2464
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
10
2336
d6887ee81068 header file include cleanup
Grumpy7
parents: 2334
diff changeset
11 #include "ErrorHandling.h"
0
Ritor1
parents:
diff changeset
12
Ritor1
parents:
diff changeset
13 #include "Items.h"
Ritor1
parents:
diff changeset
14 #include "MapInfo.h"
461
197461e5acec moved shop generators to item.cpp
Gloval
parents: 436
diff changeset
15 #include "GUIWindow.h"
197461e5acec moved shop generators to item.cpp
Gloval
parents: 436
diff changeset
16 #include "Events2D.h"
197461e5acec moved shop generators to item.cpp
Gloval
parents: 436
diff changeset
17 #include "Chest.h"
0
Ritor1
parents:
diff changeset
18 #include "LOD.h"
Ritor1
parents:
diff changeset
19 #include "Monsters.h"
Ritor1
parents:
diff changeset
20 #include "Party.h"
Ritor1
parents:
diff changeset
21 #include "FactionTable.h"
Ritor1
parents:
diff changeset
22 #include "StorylineTextTable.h"
189
038a4d09406f new texts file, fix text rendender error
Gloval
parents: 0
diff changeset
23 #include "texts.h"
0
Ritor1
parents:
diff changeset
24 #include "mm7_data.h"
2340
dc822157c98d Moving functions from unsorted_subs.h pt4
Grumpy7
parents: 2336
diff changeset
25 #include "OurMath.h"
0
Ritor1
parents:
diff changeset
26
2464
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
27 #include "Game.h"
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
28
0
Ritor1
parents:
diff changeset
29
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
30 struct ITEM_VARIATION
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
31 {
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
32 unsigned __int16 treasure_level;
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
33 unsigned __int16 item_class[4];
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
34 };
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
35
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
36
1202
0dbf6c4dd029 arrays to std::arrays phase 1
Grumpy7
parents: 1165
diff changeset
37 std::array<const char, 5> uItemsAmountPerShopType={ 0, 6, 8, 12, 12};
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
38
526
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 484
diff changeset
39 const ITEM_VARIATION shopWeap_variation_ord[15] ={
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
40 { 0, { 0, 0, 0, 0 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
41 { 1, { 23, 27, 20, 20 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
42 { 1, { 23, 24, 28, 20 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
43 { 2, { 23, 24, 25, 20 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
44 { 2, { 27, 27, 26, 26 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
45 { 4, { 24, 30, 25, 27 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
46 { 4, { 24, 30, 25, 27 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
47 { 3, { 30, 24, 20, 20 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
48 { 2, { 20, 20, 20, 20 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
49 { 3, { 27, 27, 26, 26 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
50 { 3, { 28, 28, 25, 25 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
51 { 2, { 23, 23, 24, 24 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
52 { 3, { 23, 23, 26, 26 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
53 { 2, { 30, 26, 26, 26 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
54 { 2, { 28, 25, 28, 29 }}};
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
55
526
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 484
diff changeset
56 const ITEM_VARIATION shopArmr_variation_ord[28] ={
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
57 { 1, { 35, 35, 38, 38 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
58 { 1, { 31, 31, 31, 34 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
59 { 1, { 35, 35, 38, 38 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
60 { 1, { 31, 31, 32, 34 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
61 { 2, { 35, 35, 38, 38 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
62 { 2, { 31, 32, 32, 33 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
63 { 2, { 35, 35, 38, 38 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
64 { 2, { 31, 31, 32, 32 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
65 { 4, { 35, 35, 38, 38 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
66 { 4, { 31, 32, 33, 34 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
67 { 4, { 35, 35, 38, 38 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
68 { 4, { 31, 32, 33, 34 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
69 { 3, { 35, 35, 38, 38 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
70 { 3, { 31, 31, 31, 31 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
71 { 2, { 35, 35, 38, 38 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
72 { 2, { 31, 32, 34, 34 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
73 { 3, { 35, 35, 38, 38 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
74 { 3, { 31, 31, 32, 32 }},
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, { 32, 32, 32, 33 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
77 { 3, { 35, 35, 38, 38 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
78 { 3, { 31, 31, 31, 32 }},
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, { 33, 31, 32, 34 }},
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, { 33, 31, 32, 34 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
83 { 4, { 35, 35, 38, 38 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
84 { 4, { 33, 31, 32, 34 }}};
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
85
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
86
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
87
526
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 484
diff changeset
88 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
89 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
90
526
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 484
diff changeset
91 const ITEM_VARIATION shopWeap_variation_spc[15]={
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
92 { 0, { 0, 0, 0, 0 }},
470
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
93 { 2, { 25, 30, 20, 20}},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
94 { 2, { 23, 24, 28, 20}},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
95 { 3, { 23, 24, 25, 20}},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
96 { 3, { 27, 27, 26, 26}},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
97 { 5, { 23, 26, 28, 27}},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
98 { 5, { 23, 26, 28, 27}},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
99 { 4, { 30, 24, 20, 20}},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
100 { 3, { 20, 20, 20, 20}},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
101 { 4, { 27, 27, 26, 26}},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
102 { 4, { 28, 28, 25, 25}},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
103 { 4, { 23, 23, 24, 24}},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
104 { 4, { 24, 24, 27, 20}},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
105 { 4, { 30, 26, 26, 26}},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
106 { 4, { 28, 25, 28, 29}}};
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
107
526
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 484
diff changeset
108 const ITEM_VARIATION shopArmr_variation_spc[28]={
470
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
109 { 2, { 35, 35, 38, 38 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
110 { 2, { 31, 31, 31, 34 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
111 { 2, { 35, 35, 38, 38 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
112 { 2, { 31, 31, 32, 34 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
113 { 3, { 35, 35, 38, 38 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
114 { 3, { 31, 32, 32, 33 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
115 { 3, { 35, 35, 38, 38 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
116 { 3, { 31, 31, 32, 32 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
117 { 5, { 35, 35, 38, 38 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
118 { 5, { 31, 32, 33, 34 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
119 { 5, { 35, 35, 38, 38 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
120 { 5, { 31, 32, 33, 34 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
121 { 4, { 35, 35, 38, 38 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
122 { 4, { 31, 31, 31, 31 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
123 { 3, { 35, 35, 38, 38 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
124 { 3, { 31, 32, 34, 34 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
125 { 4, { 35, 35, 38, 38 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
126 { 4, { 31, 31, 32, 33 }},
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, { 32, 32, 33, 34 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
129 { 4, { 35, 35, 38, 38 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
130 { 4, { 31, 31, 31, 32 }},
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, { 32, 32, 32, 32 }},
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, { 34, 34, 34, 34 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
135 { 5, { 35, 35, 38, 38 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
136 { 5, { 33, 33, 33, 33 }}
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
137 };
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
138
526
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 484
diff changeset
139 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
140 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
141
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 484
diff changeset
142
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
143 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
144 { 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
145 { 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
146 { 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
147 { 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
148 { 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
149 { 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
150 { 2, 2, 2, 2, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7}}};
0
Ritor1
parents:
diff changeset
151
2285
4fd03103be62 sub_4BE571 changed to sub_4BE571_AddItemToSet + cleaned up, dword_F8B1DC changed to dword_F8B1DC_currentShopOption + moved out of mm7_data
Grumpy7
parents: 2284
diff changeset
152 int sub_4BE571_AddItemToSet(int valueToAdd, int *outPutSet, int elemsAlreadyPresent, int elemsNeeded);
4fd03103be62 sub_4BE571 changed to sub_4BE571_AddItemToSet + cleaned up, dword_F8B1DC changed to dword_F8B1DC_currentShopOption + moved out of mm7_data
Grumpy7
parents: 2284
diff changeset
153 int dword_F8B1DC_currentShopOption; // weak
0
Ritor1
parents:
diff changeset
154
1682
3c451fd02fcf OnInventoryLeftClick cleanup
Grumpy7
parents: 1648
diff changeset
155 ItemGen *ptr_50C9A4_ItemToEnchant;
0
Ritor1
parents:
diff changeset
156
315
2a09e1d6fc8f Some 0041D895 GameUI_DrawItemInfo overhaul
Nomad
parents: 296
diff changeset
157 struct ItemsTable *pItemsTable; // 005D29E0
0
Ritor1
parents:
diff changeset
158
Ritor1
parents:
diff changeset
159
Ritor1
parents:
diff changeset
160
Ritor1
parents:
diff changeset
161
Ritor1
parents:
diff changeset
162
Ritor1
parents:
diff changeset
163 //----- (00439DF3) --------------------------------------------------------
385
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
164 int ItemGen::_439DF3_get_additional_damage(int *damage_type, bool *draintargetHP)
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
165 {
1933
5fcf6023f9c3 DamageMonsterFromParty some additional vars removed, changed the ordering part to something more readable
Grumpy7
parents: 1920
diff changeset
166 *draintargetHP = false;
385
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
167 *damage_type = 0;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
168 if ( !uItemID )
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
169 return 0;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
170 UpdateTempBonus(pParty->uTimePlayed);
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
171 if (uItemID == 501 ) //Iron Feather -sword
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
172 {
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
173 *damage_type = 1;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
174 return rand() % 10 + 6;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
175 }
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
176 if (uItemID == 507 ) //Ghoulsbane -axe
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
177 {
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
178 *damage_type = 0;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
179 return rand() % 16 + 3;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
180 }
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
181 if ( uItemID == 510 ) //Ullyses -bow
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
182 {
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
183 *damage_type = 2;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
184 return rand() % 4 + 9;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
185 }
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
186 if ( uItemID == 517 ) //Old Nick -dagger
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
187 {
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
188 *damage_type = 8;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
189 return 8;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
190 }
0
Ritor1
parents:
diff changeset
191
385
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
192 switch (uSpecEnchantmentType)
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
193 {
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
194 case 4: //Adds 3-4 points of Cold damage.
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
195 *damage_type = 2;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
196 return rand() % 2 + 3;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
197 break;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
198 case 5: //Adds 6-8 points of Cold damage.
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
199 *damage_type = 2;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
200 return rand() % 3 + 6;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
201 break;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
202 case 6: //Adds 9-12 points of Cold damage.
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
203 *damage_type = 2;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
204 return rand() % 4 + 9;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
205 break;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
206 case 7: //Adds 2-5 points of Electrical damage.
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
207 *damage_type = 1;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
208 return rand() % 4 + 2;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
209 break;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
210 case 8: //Adds 4-10 points of Electrical damage.
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
211 *damage_type = 1;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
212 return rand() % 7 + 4;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
213 break;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
214 case 9: //Adds 6-15 points of Electrical damage.
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
215 *damage_type = 1;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
216 return rand() % 10 + 6;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
217 break;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
218 case 10: //Adds 1-6 points of Fire damage.
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
219 *damage_type = 0;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
220 return GetDiceResult(1, 6);
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
221 break;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
222 case 11: //Adds 2-12 points of Fire damage.
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
223 *damage_type = 0;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
224 return GetDiceResult(2, 6);
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
225 break;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
226 case 12: //Adds 3-18 points of Fire damage.
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
227 *damage_type = 0;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
228 return GetDiceResult(3, 6);
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
229 break;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
230 case 13: //Adds 5 points of Body damage.
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
231 *damage_type = 8;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
232 return 5;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
233 break;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
234 case 14: //Adds 8 points of Body damage.
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
235 *damage_type = 8;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
236 return 8;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
237 break;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
238 case 15: //Adds 12 points of Body damage.
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
239 *damage_type = 8;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
240 return 12;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
241 break;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
242 case 16: //Drain Hit Points from target.
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
243 case 41: //Drain Hit Points from target and Increased Weapon speed.
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
244 *damage_type = 10;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
245 *draintargetHP = true;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
246 return 0;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
247 break;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
248 case 46: //Adds 10-20 points of Fire damage and +25 Might.
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
249 *damage_type = 0;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
250 return rand() % 11 + 10;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
251 break;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
252 default:
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
253 *damage_type = 0;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
254 return 0;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
255
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
256 }
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
257
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
258 }
0
Ritor1
parents:
diff changeset
259
Ritor1
parents:
diff changeset
260
Ritor1
parents:
diff changeset
261 //----- (00402F07) --------------------------------------------------------
Ritor1
parents:
diff changeset
262 void ItemGen::Reset()
Ritor1
parents:
diff changeset
263 {
377
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
264 this->uHolderPlayer = 0;
0
Ritor1
parents:
diff changeset
265 this->uAttributes = 0;
Ritor1
parents:
diff changeset
266 this->uNumCharges = 0;
377
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
267 this->uSpecEnchantmentType = 0;
1599
bb2378f58767 Player::GetItemsBonus removed majority of labels
Grumpy7
parents: 1567
diff changeset
268 this->m_enchantmentStrength = 0;
570
f54481c85df8 itemgen working, i hope
Gloval
parents: 559
diff changeset
269 this->uEnchantmentType = 0;
0
Ritor1
parents:
diff changeset
270 this->uItemID = 0;
Ritor1
parents:
diff changeset
271 this->uBodyAnchor = 0;
Ritor1
parents:
diff changeset
272 this->uExpireTime = 0i64;
Ritor1
parents:
diff changeset
273 }
Ritor1
parents:
diff changeset
274
Ritor1
parents:
diff changeset
275 //----- (00458260) --------------------------------------------------------
Ritor1
parents:
diff changeset
276 void ItemGen::UpdateTempBonus(__int64 uTimePlayed)
Ritor1
parents:
diff changeset
277 {
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
278 if ( this->uAttributes & ITEM_TEMP_BONUS )
0
Ritor1
parents:
diff changeset
279 {
Ritor1
parents:
diff changeset
280 if ( uTimePlayed > (signed __int64)this->uExpireTime )
Ritor1
parents:
diff changeset
281 {
570
f54481c85df8 itemgen working, i hope
Gloval
parents: 559
diff changeset
282 this->uEnchantmentType = 0;
377
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
283 this->uSpecEnchantmentType = 0;
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
284 this->uAttributes = this->uAttributes&(~ITEM_TEMP_BONUS);
0
Ritor1
parents:
diff changeset
285 }
Ritor1
parents:
diff changeset
286 }
Ritor1
parents:
diff changeset
287 }
Ritor1
parents:
diff changeset
288
Ritor1
parents:
diff changeset
289 //----- (0045814E) --------------------------------------------------------
374
Gloval
parents: 365
diff changeset
290 void ItemsTable::Release()
0
Ritor1
parents:
diff changeset
291 {
2369
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2355
diff changeset
292 free(pMonstersTXT_Raw);
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2355
diff changeset
293 free(pMonsterPlacementTXT_Raw);
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2355
diff changeset
294 free(pSkillDescTXT_Raw);
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2355
diff changeset
295 free(pSpcItemsTXT_Raw);
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2355
diff changeset
296 free(pStdItemsTXT_Raw);
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2355
diff changeset
297 free(pRndItemsTXT_Raw);
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2355
diff changeset
298 free(pItemsTXT_Raw);
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2355
diff changeset
299 free(pHostileTXT_Raw);
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2355
diff changeset
300 free(pHistoryTXT_Raw);
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2355
diff changeset
301 free(pPotionsTXT_Raw);
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2355
diff changeset
302 free(pPotionNotesTXT_Raw);
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2355
diff changeset
303 pMonstersTXT_Raw = nullptr;
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2355
diff changeset
304 pMonsterPlacementTXT_Raw = nullptr;
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2355
diff changeset
305 pSpcItemsTXT_Raw = nullptr;
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2355
diff changeset
306 pSkillDescTXT_Raw = nullptr;
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2355
diff changeset
307 pStdItemsTXT_Raw = nullptr;
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2355
diff changeset
308 pRndItemsTXT_Raw = nullptr;
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2355
diff changeset
309 pItemsTXT_Raw = nullptr;
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2355
diff changeset
310 pHostileTXT_Raw = nullptr;
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2355
diff changeset
311 pHistoryTXT_Raw = nullptr;
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2355
diff changeset
312 pPotionsTXT_Raw = nullptr;
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2355
diff changeset
313 pPotionNotesTXT_Raw = nullptr;
0
Ritor1
parents:
diff changeset
314 }
Ritor1
parents:
diff changeset
315
1082
Gloval
parents: 1018
diff changeset
316
0
Ritor1
parents:
diff changeset
317 //----- (00456D84) --------------------------------------------------------
Ritor1
parents:
diff changeset
318 void ItemsTable::Initialize()
2260
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
319 {
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
320 std::map<std::string, ITEM_EQUIP_TYPE, ci_less> equipStatMap;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
321 equipStatMap["weapon"] = EQUIP_SINGLE_HANDED;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
322 equipStatMap["weapon2"] = EQUIP_TWO_HANDED;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
323 equipStatMap["weapon1or2"] = EQUIP_SINGLE_HANDED;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
324 equipStatMap["missile"] = EQUIP_BOW;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
325 equipStatMap["bow"] = EQUIP_BOW;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
326 equipStatMap["armor"] = EQUIP_ARMOUR;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
327 equipStatMap["shield"] = EQUIP_SHIELD;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
328 equipStatMap["helm"] = EQUIP_HELMET;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
329 equipStatMap["belt"] = EQUIP_BELT;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
330 equipStatMap["cloak"] = EQUIP_CLOAK;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
331 equipStatMap["gauntlets"] = EQUIP_GAUNTLETS;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
332 equipStatMap["boots"] = EQUIP_BOOTS;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
333 equipStatMap["ring"] = EQUIP_RING;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
334 equipStatMap["amulet"] = EQUIP_AMULET;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
335 equipStatMap["weaponw"] = EQUIP_WAND;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
336 equipStatMap["herb"] = EQUIP_REAGENT;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
337 equipStatMap["reagent"] = EQUIP_REAGENT;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
338 equipStatMap["bottle"] = EQUIP_POTION;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
339 equipStatMap["sscroll"] = EQUIP_SPELL_SCROLL;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
340 equipStatMap["book"] = EQUIP_BOOK;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
341 equipStatMap["mscroll"] = EQUIP_MESSAGE_SCROLL;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
342 equipStatMap["gold"] = EQUIP_GOLD;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
343 equipStatMap["gem"] = EQUIP_GEM;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
344
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
345 std::map<std::string, PLAYER_SKILL_TYPE, ci_less> equipSkillMap;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
346 equipSkillMap["staff"] = PLAYER_SKILL_STAFF;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
347 equipSkillMap["sword"] = PLAYER_SKILL_SWORD;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
348 equipSkillMap["dagger"] = PLAYER_SKILL_DAGGER;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
349 equipSkillMap["axe"] = PLAYER_SKILL_AXE;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
350 equipSkillMap["spear"] = PLAYER_SKILL_SPEAR;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
351 equipSkillMap["bow"] = PLAYER_SKILL_BOW;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
352 equipSkillMap["mace"] = PLAYER_SKILL_MACE;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
353 equipSkillMap["blaster"] = PLAYER_SKILL_BLASTER;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
354 equipSkillMap["shield"] = PLAYER_SKILL_SHIELD;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
355 equipSkillMap["leather"] = PLAYER_SKILL_LEATHER;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
356 equipSkillMap["chain"] = PLAYER_SKILL_CHAIN;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
357 equipSkillMap["plate"] = PLAYER_SKILL_PLATE;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
358 equipSkillMap["club"] = PLAYER_SKILL_CLUB;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
359
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
360 std::map<std::string, ITEM_MATERIAL, ci_less> materialMap;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
361 materialMap["artifact"] = MATERIAL_ARTEFACT;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
362 materialMap["relic"] = MATERIAL_RELIC;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
363 materialMap["special"] = MATERIAL_SPECIAL;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
364
2262
037ad3678c0f Fixing warnings in items.cpp
Grumpy7
parents: 2261
diff changeset
365 char* test_string;
037ad3678c0f Fixing warnings in items.cpp
Grumpy7
parents: 2261
diff changeset
366 int item_counter;
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
367
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
368 pMapStats = new MapStats;
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
369 pMapStats->Initialize();
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
370
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
371 pMonsterStats = new MonsterStats;
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
372 pMonsterStats->Initialize();
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
373 pMonsterStats->InitializePlacements();
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
374
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
375 pSpellStats = new SpellStats;
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
376 pSpellStats->Initialize();
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
377
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
378 LoadPotions();
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
379 LoadPotionNotes();
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
380
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
381 pFactionTable = new FactionTable;
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
382 pFactionTable->Initialize();
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
383
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
384 pStorylineText = new StorylineText;
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
385 pStorylineText->Initialize();
0
Ritor1
parents:
diff changeset
386
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
387 pStdItemsTXT_Raw = (char *)pEvents_LOD->LoadRaw("stditems.txt", 0);
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
388 strtok(pStdItemsTXT_Raw, "\r");
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
389 strtok(NULL, "\r");
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
390 strtok(NULL, "\r");
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
391 strtok(NULL, "\r");
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
392 //Standard Bonuses by Group
2282
f5680ba9c96d SpellStats::Initialize using tokenizer
Grumpy7
parents: 2269
diff changeset
393 for (int i=0;i<24;++i)
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
394 {
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
395 test_string = strtok(NULL, "\r") + 1;
2260
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
396 auto tokens = Tokenize(test_string, '\t');
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
397 pEnchantments[i].pBonusStat=RemoveQuotes(tokens[0]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
398 pEnchantments[i].pOfName=RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
399 for (int j = 0; j < 9; j++)
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
400 {
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
401 pEnchantments[i].to_item[j]=atoi(tokens[j+2]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
402 }
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
403 }
0
Ritor1
parents:
diff changeset
404
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
405 memset(&pEnchantmentsSumm, 0, 36);
2282
f5680ba9c96d SpellStats::Initialize using tokenizer
Grumpy7
parents: 2269
diff changeset
406 for(int i=0;i<9;++i)
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
407 {
2282
f5680ba9c96d SpellStats::Initialize using tokenizer
Grumpy7
parents: 2269
diff changeset
408 for (int j=0;j<24;++j)
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
409 pEnchantmentsSumm[i]+=pEnchantments[j].to_item[i];
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
410 }
0
Ritor1
parents:
diff changeset
411
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
412 //Bonus range for Standard by Level
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
413 strtok(NULL, "\r");
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
414 strtok(NULL, "\r");
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
415 strtok(NULL, "\r");
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
416 strtok(NULL, "\r");
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
417 strtok(NULL, "\r");
2282
f5680ba9c96d SpellStats::Initialize using tokenizer
Grumpy7
parents: 2269
diff changeset
418 for(int i=0;i<6;++i) //counted from 1
2260
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 test_string = strtok(NULL, "\r") + 1;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
421 auto tokens = Tokenize(test_string, '\t');
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
422 Assert(tokens.size() == 4, "Invalid number of tokens");
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
423 bonus_ranges[i].minR = atoi(tokens[2]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
424 bonus_ranges[i].maxR =atoi(tokens[3]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
425 }
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
426
222
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
427
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
428 pSpcItemsTXT_Raw = (char *)pEvents_LOD->LoadRaw("spcitems.txt", 0);
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
429 strtok(pSpcItemsTXT_Raw, "\r");
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");
2282
f5680ba9c96d SpellStats::Initialize using tokenizer
Grumpy7
parents: 2269
diff changeset
433 for (int i=0;i<72;++i)
2260
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
434 {
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
435 test_string = strtok(NULL, "\r") + 1;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
436 auto tokens = Tokenize(test_string, '\t');
2261
236d8d7c7295 Fixing a bug in tokenization
Grumpy7
parents: 2260
diff changeset
437 Assert(tokens.size() >= 17, "Invalid number of tokens");
2260
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
438 pSpecialEnchantments[i].pBonusStatement=RemoveQuotes(tokens[0]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
439 pSpecialEnchantments[i].pNameAdd= RemoveQuotes(tokens[1]);
2262
037ad3678c0f Fixing warnings in items.cpp
Grumpy7
parents: 2261
diff changeset
440 for (int j = 0; j < 12; j++)
2260
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
441 {
2262
037ad3678c0f Fixing warnings in items.cpp
Grumpy7
parents: 2261
diff changeset
442 pSpecialEnchantments[i].to_item_apply[j]=atoi(tokens[j+2]);
2260
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
443 }
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
444 int res;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
445 res=atoi(tokens[14]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
446 if(!res)
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
447 {
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
448 ++tokens[14];
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
449 while (*tokens[14]==' ')//fix X 2 case
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
450 ++tokens[14];
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
451 res=atoi(tokens[14]);
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 pSpecialEnchantments[i].iValue=res;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
454 pSpecialEnchantments[i].iTreasureLevel= tolower(tokens[15][0]) - 97;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
455 }
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
456
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
457 pSpecialEnchantments_count = 71;
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
458 memset(&pSpecialEnchantmentsSumm, 0, 96);
2282
f5680ba9c96d SpellStats::Initialize using tokenizer
Grumpy7
parents: 2269
diff changeset
459 for(int i=0;i<12;++i)
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
460 {
2262
037ad3678c0f Fixing warnings in items.cpp
Grumpy7
parents: 2261
diff changeset
461 for (unsigned int j=0;j<=pSpecialEnchantments_count;++j)
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
462 pSpecialEnchantmentsSumm[i]+=pSpecialEnchantments[j].to_item_apply[i];
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
463 }
222
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
464
2355
a574a80e7012 Moving more functions out of unsorted_subs
Grumpy7
parents: 2349
diff changeset
465 InitializeBuildingResidents();
222
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
466
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
467 pItemsTXT_Raw = (char*) pEvents_LOD->LoadRaw("items.txt", 0);
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
468 strtok(pItemsTXT_Raw, "\r");
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
469 strtok(NULL, "\r");
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
470 uAllItemsCount = 0;
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
471 item_counter = 0;
2260
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
472 while (item_counter < 800)
222
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
473 {
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
474 test_string = strtok(NULL, "\r") + 1;
2260
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
475 auto tokens = Tokenize(test_string, '\t');
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
476 item_counter=atoi(tokens[0]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
477 uAllItemsCount=item_counter;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
478 pItems[item_counter].pIconName = RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
479 pItems[item_counter].pName = RemoveQuotes(tokens[2]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
480 pItems[item_counter].uValue=atoi(tokens[3]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
481 auto findResult = equipStatMap.find(tokens[4]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
482 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
483 auto findResult2 = equipSkillMap.find(tokens[5]);
2263
3d644efae786 some more items.cpp init bugfixing
Grumpy7
parents: 2262
diff changeset
484 pItems[item_counter].uSkillType = findResult2 == equipSkillMap.end() ? PLAYER_SKILL_MISC : findResult2->second;
2260
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
485 auto tokens2 = Tokenize(tokens[6], 'd');
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
486 if (tokens2.size() == 2)
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
487 {
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
488 pItems[item_counter].uDamageDice=atoi(tokens2[0]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
489 pItems[item_counter].uDamageRoll=atoi(tokens2[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
490 }
2261
236d8d7c7295 Fixing a bug in tokenization
Grumpy7
parents: 2260
diff changeset
491 else if (tolower(tokens2[0][0]) != 's')
2260
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
492 {
2261
236d8d7c7295 Fixing a bug in tokenization
Grumpy7
parents: 2260
diff changeset
493 pItems[item_counter].uDamageDice=atoi(tokens2[0]);
2260
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
494 pItems[item_counter].uDamageRoll=1;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
495 }
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
496 else
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
497 {
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
498 pItems[item_counter].uDamageDice=0;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
499 pItems[item_counter].uDamageRoll=0;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
500 }
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
501 pItems[item_counter].uDamageMod=atoi(tokens[7]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
502 auto findResult3 = materialMap.find(tokens[8]);
2263
3d644efae786 some more items.cpp init bugfixing
Grumpy7
parents: 2262
diff changeset
503 pItems[item_counter].uMaterial = findResult3 == materialMap.end() ? MATERIAL_COMMON : findResult->second;
2260
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
504 pItems[item_counter].uItemID_Rep_St=atoi(tokens[9]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
505 pItems[item_counter].pUnidentifiedName = RemoveQuotes(tokens[10]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
506 pItems[item_counter].uSpriteID=atoi(tokens[11]);
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
507
2260
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
508 pItems[item_counter]._additional_value=0;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
509 pItems[item_counter]._bonus_type=0;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
510 if (pItems[item_counter].uMaterial==MATERIAL_SPECIAL)
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
511 {
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
512 for(int ii=0; ii<24; ++ii)
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
513 {
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
514 if (!_stricmp(tokens[12],pEnchantments[ii].pOfName))
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
515 {
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
516 pItems[item_counter]._bonus_type=ii+1;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
517 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
518 }
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 if (!pItems[item_counter]._bonus_type)
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
521 {
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
522 for(int ii=0; ii<72; ++ii)
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
523 {
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
524 if (!_stricmp(tokens[12],pSpecialEnchantments[ii].pNameAdd))
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
525 {
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
526 pItems[item_counter]._additional_value=ii+1;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
527 }
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
528 }
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
529 }
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
530 }
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
531
2260
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
532 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
533 {
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
534 char b_s=atoi(tokens[13]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
535 if (b_s)
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
536 pItems[item_counter]._bonus_strength=b_s;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
537 else
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
538 pItems[item_counter]._bonus_strength=1;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
539 }
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
540 else
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
541 pItems[item_counter]._bonus_strength=0;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
542 pItems[item_counter].uEquipX=atoi(tokens[14]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
543 pItems[item_counter].uEquipY=atoi(tokens[15]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
544 pItems[item_counter].pDescription = RemoveQuotes(tokens[16]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
545 item_counter++;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
546 }
222
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
547
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
548 uAllItemsCount = item_counter;
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
549 pRndItemsTXT_Raw = (char *)pEvents_LOD->LoadRaw("rnditems.txt", 0);
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
550 strtok(pRndItemsTXT_Raw, "\r");
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
551 strtok(NULL, "\r");
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
552 strtok(NULL, "\r");
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
553 strtok(NULL, "\r");
2269
b13ab8114e5d fixing rnd chest bug
Grumpy7
parents: 2263
diff changeset
554 for (item_counter = 0; item_counter < 619; item_counter++)
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
555 {
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
556 test_string = strtok(NULL, "\r") + 1;
2260
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
557 auto tokens = Tokenize(test_string, '\t');
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
558 Assert(tokens.size() > 7, "Invalid number of tokens");
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
559 item_counter = atoi(tokens[0]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
560 pItems[item_counter].uChanceByTreasureLvl1=atoi(tokens[2]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
561 pItems[item_counter].uChanceByTreasureLvl2=atoi(tokens[3]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
562 pItems[item_counter].uChanceByTreasureLvl3=atoi(tokens[4]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
563 pItems[item_counter].uChanceByTreasureLvl4=atoi(tokens[5]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
564 pItems[item_counter].uChanceByTreasureLvl5=atoi(tokens[6]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
565 pItems[item_counter].uChanceByTreasureLvl6=atoi(tokens[7]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
566 }
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
567
1006
e865f349aa41 ui cleanup
Gloval
parents: 972
diff changeset
568 //ChanceByTreasureLvl Summ - to calculate chance
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
569 memset(&uChanceByTreasureLvlSumm, 0, 24);
2282
f5680ba9c96d SpellStats::Initialize using tokenizer
Grumpy7
parents: 2269
diff changeset
570 for(int i=0;i<6;++i)
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
571 {
2282
f5680ba9c96d SpellStats::Initialize using tokenizer
Grumpy7
parents: 2269
diff changeset
572 for (int j=1;j<item_counter;++j)
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
573 uChanceByTreasureLvlSumm[i]+=pItems[j].uChanceByTreasureLvl[i];
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
574 }
222
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
575
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
576 strtok(NULL, "\r");
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
577 strtok(NULL, "\r");
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
578 strtok(NULL, "\r");
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
579 strtok(NULL, "\r");
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
580 strtok(NULL, "\r");
2282
f5680ba9c96d SpellStats::Initialize using tokenizer
Grumpy7
parents: 2269
diff changeset
581 for (int i=0;i<3;++i)
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
582 {
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
583 test_string = strtok(NULL, "\r") + 1;
2260
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
584 auto tokens = Tokenize(test_string, '\t');
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
585 Assert(tokens.size() > 7, "Invalid number of tokens");
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
586 switch (i)
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
587 {
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
588 case 0:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
589 uBonusChanceStandart[0]=atoi(tokens[2]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
590 uBonusChanceStandart[1]=atoi(tokens[3]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
591 uBonusChanceStandart[2]=atoi(tokens[4]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
592 uBonusChanceStandart[3]=atoi(tokens[5]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
593 uBonusChanceStandart[4]=atoi(tokens[6]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
594 uBonusChanceStandart[5]=atoi(tokens[7]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
595 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
596 case 1:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
597 uBonusChanceSpecial[0]=atoi(tokens[2]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
598 uBonusChanceSpecial[1]=atoi(tokens[3]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
599 uBonusChanceSpecial[2]=atoi(tokens[4]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
600 uBonusChanceSpecial[3]=atoi(tokens[5]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
601 uBonusChanceSpecial[4]=atoi(tokens[6]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
602 uBonusChanceSpecial[5]=atoi(tokens[7]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
603 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
604 case 2:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
605 uBonusChanceWpSpecial[0]=atoi(tokens[2]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
606 uBonusChanceWpSpecial[1]=atoi(tokens[3]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
607 uBonusChanceWpSpecial[2]=atoi(tokens[4]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
608 uBonusChanceWpSpecial[3]=atoi(tokens[5]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
609 uBonusChanceWpSpecial[4]=atoi(tokens[6]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
610 uBonusChanceWpSpecial[5]=atoi(tokens[7]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
611 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
612 }
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
613 }
2369
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2355
diff changeset
614 free(pRndItemsTXT_Raw);
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2355
diff changeset
615 pRndItemsTXT_Raw = nullptr;
222
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
616
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
617 pSkillDescTXT_Raw = (char *)pEvents_LOD->LoadRaw("skilldes.txt", 0);
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
618 strtok(pSkillDescTXT_Raw, "\r");
2282
f5680ba9c96d SpellStats::Initialize using tokenizer
Grumpy7
parents: 2269
diff changeset
619 for (int i=0; i<37; ++i)
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
620 {
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
621 test_string = strtok(NULL, "\r") + 1;
2260
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
622 auto tokens = Tokenize(test_string, '\t');
2261
236d8d7c7295 Fixing a bug in tokenization
Grumpy7
parents: 2260
diff changeset
623 Assert(tokens.size() >= 6, "Invalid number of tokens");
2260
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
624 pSkillDesc[i] = RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
625 pNormalSkillDesc[i] = RemoveQuotes(tokens[2]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
626 pExpertSkillDesc[i] = RemoveQuotes(tokens[3]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
627 pMasterSkillDesc[i] = RemoveQuotes(tokens[4]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
628 pGrandSkillDesc[i] = RemoveQuotes(tokens[5]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
629 }
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
630
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
631 pStatsTXT_Raw = (char *)pEvents_LOD->LoadRaw("stats.txt", 0);
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
632 strtok(pStatsTXT_Raw, "\r");
2282
f5680ba9c96d SpellStats::Initialize using tokenizer
Grumpy7
parents: 2269
diff changeset
633 for (int i=0; i<26; ++i)
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
634 {
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
635 test_string = strtok(NULL, "\r") + 1;
2260
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
636 auto tokens = Tokenize(test_string, '\t');
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
637 Assert(tokens.size() == 2, "Invalid number of tokens");
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
638 switch (i)
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
639 {
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
640 case 0:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
641 case 1:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
642 case 2:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
643 case 3:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
644 case 4:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
645 case 5:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
646 case 6:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
647 pAttributeDescriptions[i] = RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
648 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
649 case 7:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
650 pHealthPointsAttributeDescription = RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
651 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
652 case 8:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
653 pArmourClassAttributeDescription = RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
654 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
655 case 9:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
656 pSpellPointsAttributeDescription = RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
657 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
658 case 10:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
659 pPlayerConditionAttributeDescription = RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
660 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
661 case 11:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
662 pFastSpellAttributeDescription = RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
663 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
664 case 12:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
665 pPlayerAgeAttributeDescription = RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
666 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
667 case 13:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
668 pPlayerLevelAttributeDescription = RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
669 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
670 case 14:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
671 pPlayerExperienceAttributeDescription = RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
672 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
673 case 15:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
674 pAttackBonusAttributeDescription = RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
675 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
676 case 16:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
677 pAttackDamageAttributeDescription = RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
678 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
679 case 17:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
680 pMissleBonusAttributeDescription = RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
681 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
682 case 18:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
683 pMissleDamageAttributeDescription = RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
684 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
685 case 19:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
686 pFireResistanceAttributeDescription = RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
687 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
688 case 20:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
689 pAirResistanceAttributeDescription = RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
690 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
691 case 21:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
692 pWaterResistanceAttributeDescription = RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
693 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
694 case 22:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
695 pEarthResistanceAttributeDescription = RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
696 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
697 case 23:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
698 pMindResistanceAttributeDescription = RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
699 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
700 case 24:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
701 pBodyResistanceAttributeDescription = RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
702 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
703 case 25:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
704 pSkillPointsAttributeDescription = RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
705 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
706 }
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
707 }
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
708
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
709 pClassTXT_Raw = 0;
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
710 pClassTXT_Raw = (char *)pEvents_LOD->LoadRaw("class.txt", 0);
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
711 strtok(pClassTXT_Raw, "\r");
2282
f5680ba9c96d SpellStats::Initialize using tokenizer
Grumpy7
parents: 2269
diff changeset
712 for (int i=0; i<36; ++i)
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
713 {
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
714 test_string = strtok(NULL, "\r") + 1;
2260
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
715 auto tokens = Tokenize(test_string, '\t');
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
716 Assert(tokens.size() == 3, "Invalid number of tokens");
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
717 pClassDescriptions[i]=RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
718 }
222
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
719
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
720
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
721
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
722 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
723 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
724 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
725
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
726
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
727 }
0
Ritor1
parents:
diff changeset
728
Ritor1
parents:
diff changeset
729 //----- (00456D17) --------------------------------------------------------
Ritor1
parents:
diff changeset
730 void ItemsTable::SetSpecialBonus(ItemGen *pItem)
Ritor1
parents:
diff changeset
731 {
385
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
732 if ( pItems[pItem->uItemID].uMaterial == MATERIAL_SPECIAL )
0
Ritor1
parents:
diff changeset
733 {
570
f54481c85df8 itemgen working, i hope
Gloval
parents: 559
diff changeset
734 pItem->uEnchantmentType = pItems[pItem->uItemID]._bonus_type;
385
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
735 pItem->uSpecEnchantmentType = pItems[pItem->uItemID]._additional_value;
1599
bb2378f58767 Player::GetItemsBonus removed majority of labels
Grumpy7
parents: 1567
diff changeset
736 pItem->m_enchantmentStrength = pItems[pItem->uItemID]._bonus_strength;
0
Ritor1
parents:
diff changeset
737 }
Ritor1
parents:
diff changeset
738 }
Ritor1
parents:
diff changeset
739
Ritor1
parents:
diff changeset
740 //----- (00456D43) --------------------------------------------------------
377
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
741 bool ItemsTable::IsMaterialSpecial(ItemGen *pItem)
0
Ritor1
parents:
diff changeset
742 {
377
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
743 return this->pItems[pItem->uItemID].uMaterial == MATERIAL_SPECIAL;
0
Ritor1
parents:
diff changeset
744 }
Ritor1
parents:
diff changeset
745
Ritor1
parents:
diff changeset
746 //----- (00456D5E) --------------------------------------------------------
377
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
747 bool ItemsTable::IsMaterialNonCommon(ItemGen *pItem)
0
Ritor1
parents:
diff changeset
748 {
385
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
749 return pItems[pItem->uItemID].uMaterial == MATERIAL_SPECIAL ||
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
750 pItems[pItem->uItemID].uMaterial == MATERIAL_RELIC ||
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
751 pItems[pItem->uItemID].uMaterial == MATERIAL_ARTEFACT;
0
Ritor1
parents:
diff changeset
752 }
Ritor1
parents:
diff changeset
753
Ritor1
parents:
diff changeset
754
Ritor1
parents:
diff changeset
755 //----- (00453B3C) --------------------------------------------------------
Ritor1
parents:
diff changeset
756 void ItemsTable::LoadPotions()
2284
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
757 {
0
Ritor1
parents:
diff changeset
758
2284
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
759 CHAR Text[90];
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
760 char* test_string;
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
761 unsigned int uRow;
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
762 unsigned int uColumn;
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
763 unsigned __int8 potion_value;
222
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
764
2369
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2355
diff changeset
765 free(pPotionNotesTXT_Raw);
2284
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
766 auto tokens = Tokenize("", '\t');
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
767 char* pPotionsTXT_Raw = (char *)pEvents_LOD->LoadRaw("potion.txt", 0);
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
768 test_string = strtok(pPotionsTXT_Raw ,"\r") + 1;
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
769 while (test_string)
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
770 {
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
771 tokens = Tokenize(test_string, '\t');
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
772 if (!strcmp(tokens[0], "222"))
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
773 break;
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
774 test_string = strtok(NULL ,"\r") + 1;
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
775 }
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
776 if (!test_string)
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
777 {
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
778 MessageBoxA(0, "Error Pre-Parsing Potion Table", "Load Error", MB_ICONHAND|MB_CANCELTRYCONTINUE);
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
779 return;
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
780 }
193
821fd955c379 fixed potion data parsing. Somehow 3d render was affected
Gloval
parents: 189
diff changeset
781
2284
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
782 for (uRow = 0;uRow < 50; ++uRow)
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
783 {
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
784 if (tokens.size() < 50)
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
785 {
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
786 wsprintfA(Text, "Error Parsing Potion Table at Row: %d Column: %d", uRow, tokens.size());
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
787 MessageBoxA(0, Text, "Parsing Error", MB_ICONHAND|MB_CANCELTRYCONTINUE);
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
788 return;
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
789 }
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
790 for (uColumn = 0; uColumn < 50; ++uColumn)
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
791 {
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
792 char* currValue = tokens[uColumn + 7];
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
793 potion_value = atoi(currValue);
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
794 if ( !potion_value && tolower(currValue[0]) == 'e')
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
795 {
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
796 potion_value = atoi(currValue + 1);
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
797 }
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
798 this->potion_data[uRow][uColumn]=potion_value;
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
799 }
193
821fd955c379 fixed potion data parsing. Somehow 3d render was affected
Gloval
parents: 189
diff changeset
800
2284
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
801 test_string = strtok(NULL ,"\r") + 1;
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
802 if (!test_string)
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
803 {
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
804 wsprintfA(Text, "Error Parsing Potion Table at Row: %d Column: %d", uRow, 0);
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
805 MessageBoxA(0, Text, "Parsing Error", MB_ICONHAND|MB_CANCELTRYCONTINUE);
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
806 return;
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
807 }
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
808 tokens = Tokenize(test_string, '\t');
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
809 }
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
810 }
0
Ritor1
parents:
diff changeset
811
Ritor1
parents:
diff changeset
812 //----- (00453CE5) --------------------------------------------------------
Ritor1
parents:
diff changeset
813 void ItemsTable::LoadPotionNotes()
2284
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
814 {
222
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
815
2284
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
816 CHAR Text[90];
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
817 char* test_string;
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
818 unsigned int uRow;
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
819 unsigned int uColumn;
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
820 unsigned __int8 potion_note;
222
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
821
2369
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2355
diff changeset
822 free(pPotionNotesTXT_Raw);
2284
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
823 auto tokens = Tokenize("", '\t');
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
824 char* pPotionNotesTXT_Raw = (char *)pEvents_LOD->LoadRaw("potnotes.txt", 0);
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
825 test_string = strtok(pPotionNotesTXT_Raw ,"\r") + 1;
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
826 while (test_string)
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
827 {
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
828 tokens = Tokenize(test_string, '\t');
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
829 if (!strcmp(tokens[0], "222"))
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
830 break;
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
831 test_string = strtok(NULL ,"\r") + 1;
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
832 }
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
833 if (!test_string)
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
834 {
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
835 MessageBoxA(0, "Error Pre-Parsing Potion Table", "Load Error", MB_ICONHAND|MB_CANCELTRYCONTINUE);
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
836 return;
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
837 }
0
Ritor1
parents:
diff changeset
838
2284
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
839 for (uRow = 0;uRow < 50; ++uRow)
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
840 {
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
841 if (tokens.size() < 50)
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
842 {
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
843 wsprintfA(Text, "Error Parsing Potion Table at Row: %d Column: %d", uRow, tokens.size());
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
844 MessageBoxA(0, Text, "Parsing Error", MB_ICONHAND|MB_CANCELTRYCONTINUE);
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
845 return;
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
846 }
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
847 for (uColumn = 0; uColumn < 50; ++uColumn)
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
848 {
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
849 char* currValue = tokens[uColumn + 7];
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
850 potion_note = atoi(currValue);
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
851 if ( !potion_note && tolower(currValue[0]) == 'e')
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
852 {
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
853 potion_note = atoi(currValue + 1);
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
854 }
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
855 this->potion_note[uRow][uColumn]=potion_note;
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
856 }
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
857
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
858 test_string = strtok(NULL ,"\r") + 1;
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
859 if (!test_string)
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
860 {
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
861 wsprintfA(Text, "Error Parsing Potion Table at Row: %d Column: %d", uRow, 0);
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
862 MessageBoxA(0, Text, "Parsing Error", MB_ICONHAND|MB_CANCELTRYCONTINUE);
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
863 return;
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
864 }
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
865 tokens = Tokenize(test_string, '\t');
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
866 }
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
867
40c4065234f8 Tokenizing ItemsTable::LoadPotions and ItemsTable::LoadPotionNotes()
Grumpy7
parents: 2282
diff changeset
868
222
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
869 }
0
Ritor1
parents:
diff changeset
870
Ritor1
parents:
diff changeset
871
Ritor1
parents:
diff changeset
872 //----- (00456442) --------------------------------------------------------
Ritor1
parents:
diff changeset
873 unsigned int ItemGen::GetValue()
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
874 {
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
875 unsigned int uBaseValue; // edi@1
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
876 unsigned int bonus;
0
Ritor1
parents:
diff changeset
877
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
878 uBaseValue = pItemsTable->pItems[this->uItemID].uValue;
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
879 if ( this->uAttributes & ITEM_TEMP_BONUS || pItemsTable->IsMaterialNonCommon(this) )
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
880 return uBaseValue;
570
f54481c85df8 itemgen working, i hope
Gloval
parents: 559
diff changeset
881 if (uEnchantmentType )
1599
bb2378f58767 Player::GetItemsBonus removed majority of labels
Grumpy7
parents: 1567
diff changeset
882 return uBaseValue + 100 * m_enchantmentStrength;;
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
883 if (uSpecEnchantmentType )
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
884 {
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
885 bonus = pItemsTable->pSpecialEnchantments[uSpecEnchantmentType].iTreasureLevel;
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
886 if ( bonus > 10 )
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
887 return uBaseValue + bonus;
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
888 else
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
889 return uBaseValue * bonus;
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
890 }
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
891 return uBaseValue;
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
892 }
0
Ritor1
parents:
diff changeset
893
Ritor1
parents:
diff changeset
894 //----- (00456499) --------------------------------------------------------
Ritor1
parents:
diff changeset
895 const char *ItemGen::GetDisplayName()
Ritor1
parents:
diff changeset
896 {
1567
9f8b3e904e14 Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents: 1545
diff changeset
897 if (IsIdentified())
366
85edec9da96b _4B910F_shop_interaction
Nomad
parents: 365
diff changeset
898 return GetIdentifiedName();
0
Ritor1
parents:
diff changeset
899 else
366
85edec9da96b _4B910F_shop_interaction
Nomad
parents: 365
diff changeset
900 return pItemsTable->pItems[uItemID].pUnidentifiedName;
0
Ritor1
parents:
diff changeset
901 }
Ritor1
parents:
diff changeset
902
Ritor1
parents:
diff changeset
903 //----- (004564B3) --------------------------------------------------------
Ritor1
parents:
diff changeset
904 const char *ItemGen::GetIdentifiedName()
Ritor1
parents:
diff changeset
905 {
377
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
906 unsigned __int8 equip_type;
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
907 const char *player_name;
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
908 const char *nameModificator;
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
909 const char *format_str;
0
Ritor1
parents:
diff changeset
910
1709
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
911 equip_type = GetItemEquipType();
377
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
912 if ( (equip_type == EQUIP_REAGENT) || (equip_type == EQUIP_POTION) || (equip_type == EQUIP_GOLD) )
0
Ritor1
parents:
diff changeset
913 {
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
914 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
915 return item__getname_buffer.data();
0
Ritor1
parents:
diff changeset
916 }
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
917 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
918 if ( uItemID == ITEM_LICH_JAR_FULL ) //Lich Jar
0
Ritor1
parents:
diff changeset
919 {
377
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
920 if ( (uHolderPlayer >0 )&& (uHolderPlayer <= 4) )
0
Ritor1
parents:
diff changeset
921 {
377
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
922 player_name = pPlayers[uHolderPlayer]->pName;
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
923 if ( player_name[strlen(player_name) - 1] == 's' )
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
924 format_str = pGlobalTXT_LocalizationStrings[655]; //"%s' Jar"
0
Ritor1
parents:
diff changeset
925 else
377
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
926 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
927 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
928 return item__getname_buffer.data();
0
Ritor1
parents:
diff changeset
929 }
Ritor1
parents:
diff changeset
930 }
377
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
931 if ( !pItemsTable->IsMaterialNonCommon(this) )
0
Ritor1
parents:
diff changeset
932 {
570
f54481c85df8 itemgen working, i hope
Gloval
parents: 559
diff changeset
933 if ( uEnchantmentType )
0
Ritor1
parents:
diff changeset
934 {
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
935 strcat(item__getname_buffer.data(), " ");
570
f54481c85df8 itemgen working, i hope
Gloval
parents: 559
diff changeset
936 nameModificator = pItemsTable->pEnchantments[uEnchantmentType-1].pOfName;
0
Ritor1
parents:
diff changeset
937 }
Ritor1
parents:
diff changeset
938 else
Ritor1
parents:
diff changeset
939 {
377
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
940 if ( !uSpecEnchantmentType )
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
941 return item__getname_buffer.data();
377
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
942 if ( uSpecEnchantmentType == 16 //Drain Hit Points from target.
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
943 || uSpecEnchantmentType == 39 //Double damage vs Demons.
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
944 || uSpecEnchantmentType == 40 //Double damage vs Dragons
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
945 || uSpecEnchantmentType == 45 //+5 Speed and Accuracy
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
946 || uSpecEnchantmentType == 56 //+5 Might and Endurance.
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
947 || uSpecEnchantmentType == 57 //+5 Intellect and Personality.
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
948 || uSpecEnchantmentType == 58 //Increased Value.
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
949 || uSpecEnchantmentType == 60 //+3 Unarmed and Dodging skills
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
950 || uSpecEnchantmentType == 61 //+3 Stealing and Disarm skills.
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
951 || uSpecEnchantmentType == 59 //Increased Weapon speed.
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
952 || uSpecEnchantmentType == 63 //Double Damage vs. Elves.
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
953 || uSpecEnchantmentType == 64 //Double Damage vs. Undead.
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
954 || uSpecEnchantmentType == 67 //Adds 5 points of Body damage and +2 Disarm skill.
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
955 || uSpecEnchantmentType == 68 ) //Adds 6-8 points of Cold damage and +5 Armor Class.
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
956 { //enchantment and name positions inverted!
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
957 sprintf( item__getname_buffer.data(), "%s %s",
377
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
958 pItemsTable->pSpecialEnchantments[uSpecEnchantmentType-1].pNameAdd,
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
959 pItemsTable->pItems[uItemID].pName);
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
960 return item__getname_buffer.data();
0
Ritor1
parents:
diff changeset
961 }
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
962 strcat(item__getname_buffer.data(), " ");
377
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
963 nameModificator = pItemsTable->pSpecialEnchantments[uSpecEnchantmentType-1].pNameAdd;
0
Ritor1
parents:
diff changeset
964 }
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
965 strcat(item__getname_buffer.data(), nameModificator);
0
Ritor1
parents:
diff changeset
966 }
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
967 return item__getname_buffer.data();
0
Ritor1
parents:
diff changeset
968 }
Ritor1
parents:
diff changeset
969
Ritor1
parents:
diff changeset
970
Ritor1
parents:
diff changeset
971 //----- (00456620) --------------------------------------------------------
385
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
972 void ItemsTable::GenerateItem(int treasure_level, unsigned int uTreasureType, ItemGen *out_item)
2286
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
973 {
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
974 int treasureLevelMinus1; // ebx@3
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
975 int current_chance; // ebx@43
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
976 int tmp_chance; // ecx@47
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
977 int v17; // ebx@57
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
978 int v18; // edx@62
2262
037ad3678c0f Fixing warnings in items.cpp
Grumpy7
parents: 2261
diff changeset
979 unsigned int special_chance; // edx@86
037ad3678c0f Fixing warnings in items.cpp
Grumpy7
parents: 2261
diff changeset
980 unsigned int v26; // edx@89
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
981 unsigned int v27; // eax@89
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
982 int v32; // ecx@91
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
983 int v33; // eax@91
2334
ddb803517a48 unused local variables I commented
Ritor1
parents: 2289
diff changeset
984 // unsigned int v34; // eax@97
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
985 int v45; // eax@120
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
986 int v46; // edx@120
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
987 int j; // eax@121
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
988 int val_list[800]; // [sp+Ch] [bp-C88h]@33
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
989 int total_chance; // [sp+C8Ch] [bp-8h]@33
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
990 signed int v56; // [sp+CA0h] [bp+Ch]@55
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
991 int v57; // [sp+CA0h] [bp+Ch]@62
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
992
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
993 if (!out_item)
1583
75fafd8ced59 Allocator (CMemory) bye-bye
Nomad
parents: 1567
diff changeset
994 out_item = (ItemGen *)malloc(sizeof(ItemGen));
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
995 memset(out_item, 0, sizeof(*out_item));
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
996
228
46ae2602aceb Item generation doesn't crash (thou still generates weird stuff)
Nomad
parents: 224
diff changeset
997
2286
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
998 treasureLevelMinus1 = treasure_level - 1;
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
999 if ( uTreasureType ) //generate known treasure type
2286
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1000 {
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1001 ITEM_EQUIP_TYPE requested_equip;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1002 PLAYER_SKILL_TYPE requested_skill = PLAYER_SKILL_INVALID;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1003 switch (uTreasureType)
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1004 {
1989
33787c8938a5 Single and Two-handed ENUM
zipi
parents: 1933
diff changeset
1005 case 20: requested_equip = EQUIP_SINGLE_HANDED; break;
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1006 case 21: requested_equip = EQUIP_ARMOUR; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1007 case 22: requested_skill = PLAYER_SKILL_MISC; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1008 case 23: requested_skill = PLAYER_SKILL_SWORD; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1009 case 24: requested_skill = PLAYER_SKILL_DAGGER; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1010 case 25: requested_skill = PLAYER_SKILL_AXE; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1011 case 26: requested_skill = PLAYER_SKILL_SPEAR; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1012 case 27: requested_skill = PLAYER_SKILL_BOW; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1013 case 28: requested_skill = PLAYER_SKILL_MACE; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1014 case 29: requested_skill = PLAYER_SKILL_CLUB; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1015 case 30: requested_skill = PLAYER_SKILL_STAFF; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1016 case 31: requested_skill = PLAYER_SKILL_LEATHER; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1017 case 32: requested_skill = PLAYER_SKILL_CHAIN; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1018 case 33: requested_skill = PLAYER_SKILL_PLATE; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1019 case 34: requested_equip = EQUIP_SHIELD; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1020 case 35: requested_equip = EQUIP_HELMET; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1021 case 36: requested_equip = EQUIP_BELT; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1022 case 37: requested_equip = EQUIP_CLOAK; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1023 case 38: requested_equip = EQUIP_GAUNTLETS; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1024 case 39: requested_equip = EQUIP_BOOTS; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1025 case 40: requested_equip = EQUIP_RING; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1026 case 41: requested_equip = EQUIP_AMULET; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1027 case 42: requested_equip = EQUIP_WAND; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1028 case 43: requested_equip = EQUIP_SPELL_SCROLL; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1029 case 44: requested_equip = EQUIP_POTION; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1030 case 45: requested_equip = EQUIP_REAGENT; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1031 case 46: requested_equip = EQUIP_GEM; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1032 default:
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1033 __debugbreak(); // check this condition
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1034 requested_equip = (ITEM_EQUIP_TYPE)(uTreasureType - 1);
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1035 break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1036 }
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1037 memset(val_list, 0, sizeof(val_list));
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1038 total_chance = 0;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1039 j=0;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1040 //a2a = 1;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1041 if (requested_skill == PLAYER_SKILL_INVALID) // no skill for this item needed
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1042 {
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1043 for (uint i = 1; i < 500; ++i)
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1044 {
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1045 if (pItems[i].uEquipType == requested_equip)
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1046 {
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1047 val_list[j] = i;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1048 ++j;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1049 total_chance += pItems[i].uChanceByTreasureLvl[treasure_level - 1];
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1050 }
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1051 }
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1052 }
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1053 else //have needed skill
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1054 {
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1055 for (uint i = 1; i < 500; ++i)
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1056 {
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1057 if (pItems[i].uSkillType == requested_skill)
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1058 {
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1059 val_list[j] = i;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1060 ++j;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1061 total_chance += pItems[i].uChanceByTreasureLvl[treasure_level - 1];
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1062 }
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1063 }
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1064 }
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1065
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1066 current_chance = 0;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1067 if ( total_chance )
2286
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1068 {
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1069 current_chance = rand() % total_chance + 1;
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1070 tmp_chance = 0;
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1071 j=0;
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1072 while(tmp_chance < current_chance)
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1073 {
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1074 out_item->uItemID = val_list[j];
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1075 tmp_chance += pItems[val_list[j]].uChanceByTreasureLvl[treasure_level - 1];
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1076 ++j;
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1077 }
0
Ritor1
parents:
diff changeset
1078 }
2286
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1079 else
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1080 {
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1081 out_item->uItemID = 1;
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1082 }
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1083 }
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1084 else
2286
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1085 {
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1086 //artifact
2286
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1087 if ( treasureLevelMinus1 == 5 )
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1088 {
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1089 v56 = 0;
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1090 for(int i=0; i<29; ++i)
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1091 v56 += pParty->pIsArtifactFound[i];
2286
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1092 v17 = rand() % 29;
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1093 if ((rand() % 100 < 5) && !pParty->pIsArtifactFound[v17] && v56 < 13)
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1094 {
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1095 pParty->pIsArtifactFound[v17] = 1;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1096 out_item->uAttributes = 0;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1097 out_item->uItemID = v17 + 500;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1098 SetSpecialBonus(out_item);
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1099 return;
2286
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1100 }
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1101 }
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1102
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1103 v57 = 0;
2286
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1104 v18 = rand() % this->uChanceByTreasureLvlSumm[treasure_level - 1] + 1;
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1105 while (v57 < v18)
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1106 {
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1107 ++out_item->uItemID;
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1108 v57 += pItems[out_item->uItemID].uChanceByTreasureLvl[treasureLevelMinus1];
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1109 }
2286
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1110 }
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1111 if (out_item->GetItemEquipType() == EQUIP_POTION && out_item->uItemID != ITEM_POTION_BOTTLE )
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1112 {// if it potion set potion spec
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1113 out_item->uEnchantmentType = 0;
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1114 for (int i=0; i<2; ++i)
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1115 out_item->uEnchantmentType += rand() % 4 + 1;
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1116 out_item->uEnchantmentType = out_item->uEnchantmentType * treasure_level;
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1117 }
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1118
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1119 if ( out_item->uItemID == ITEM_SPELLBOOK_LIGHT_DIVINE_INTERVENTION
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1120 && !(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, 239) )
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1121 out_item->uItemID = ITEM_SPELLBOOK_LIGHT_SUN_BURST;
2286
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1122 if ( pItemsTable->pItems[out_item->uItemID].uItemID_Rep_St )
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1123 out_item->uAttributes = 0;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1124 else
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1125 out_item->uAttributes = 1;
385
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
1126
1709
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1127 if ( out_item->GetItemEquipType() != EQUIP_POTION )
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1128 {
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1129 out_item->uSpecEnchantmentType = 0;
570
f54481c85df8 itemgen working, i hope
Gloval
parents: 559
diff changeset
1130 out_item->uEnchantmentType = 0;
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1131 }
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1132 //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
1133 switch (out_item->GetItemEquipType())
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1134 {
1989
33787c8938a5 Single and Two-handed ENUM
zipi
parents: 1933
diff changeset
1135 case EQUIP_SINGLE_HANDED:
33787c8938a5 Single and Two-handed ENUM
zipi
parents: 1933
diff changeset
1136 case EQUIP_TWO_HANDED :
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1137 case EQUIP_BOW :
2286
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1138 if ( !uBonusChanceWpSpecial[treasureLevelMinus1] )
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1139 return;
2286
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1140 if ((uint)(rand() % 100)>=uBonusChanceWpSpecial[treasureLevelMinus1])
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1141 return;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1142 break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1143 case EQUIP_ARMOUR :
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1144 case EQUIP_SHIELD :
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1145 case EQUIP_HELMET :
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1146 case EQUIP_BELT :
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1147 case EQUIP_CLOAK :
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1148 case EQUIP_GAUNTLETS :
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1149 case EQUIP_BOOTS :
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1150 case EQUIP_RING :
570
f54481c85df8 itemgen working, i hope
Gloval
parents: 559
diff changeset
1151
2286
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1152 if ( !uBonusChanceStandart[treasureLevelMinus1] )
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1153 return;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1154 special_chance = rand() % 100;
2286
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1155 if ( special_chance < uBonusChanceStandart[treasureLevelMinus1])
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1156 {
2286
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1157 v26 = rand() %pEnchantmentsSumm[out_item->GetItemEquipType()-3] + 1;
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1158 v27 = 0;
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1159 while(v27 < v26)
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1160 {
570
f54481c85df8 itemgen working, i hope
Gloval
parents: 559
diff changeset
1161 ++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
1162 v27+=pEnchantments[out_item->uEnchantmentType].to_item[out_item->GetItemEquipType()-3];
2286
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1163 }
570
f54481c85df8 itemgen working, i hope
Gloval
parents: 559
diff changeset
1164
2286
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1165 v33 = rand() % (bonus_ranges[treasureLevelMinus1].maxR - bonus_ranges[treasureLevelMinus1].minR + 1);
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1166 out_item->m_enchantmentStrength = v33 + bonus_ranges[treasureLevelMinus1].minR;
570
f54481c85df8 itemgen working, i hope
Gloval
parents: 559
diff changeset
1167 v32 = out_item->uEnchantmentType - 1;
f54481c85df8 itemgen working, i hope
Gloval
parents: 559
diff changeset
1168 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
1169 out_item->m_enchantmentStrength = out_item->m_enchantmentStrength/2;
bb2378f58767 Player::GetItemsBonus removed majority of labels
Grumpy7
parents: 1567
diff changeset
1170 if ( out_item->m_enchantmentStrength <= 0 )
bb2378f58767 Player::GetItemsBonus removed majority of labels
Grumpy7
parents: 1567
diff changeset
1171 out_item->m_enchantmentStrength = 1;
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1172 return;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1173
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1174 }
2286
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1175 else if ( special_chance >= uBonusChanceStandart[treasureLevelMinus1] + uBonusChanceSpecial[treasureLevelMinus1] )
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1176 return;
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1177 break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1178 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
1179 out_item->uNumCharges = rand() % 6 + out_item->GetDamageMod() + 1;
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1180 out_item->uMaxCharges = out_item->uNumCharges;
2286
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1181 return;
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1182 default:
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
1183 return;
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1184 }
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1185
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1186 j=0;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1187 int spc_sum=0;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1188 int spc;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1189 memset(&val_list, 0, 3200);
2262
037ad3678c0f Fixing warnings in items.cpp
Grumpy7
parents: 2261
diff changeset
1190 for (unsigned int i=0; i<pSpecialEnchantments_count;++i)
2286
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1191 {
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1192 int tr_lv= pSpecialEnchantments[i].iTreasureLevel;
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1193 if ((treasure_level - 1 == 2) && ( tr_lv == 1 || tr_lv == 0 ) ||
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1194 (treasure_level - 1 == 3) && (tr_lv == 2 || tr_lv == 1 || tr_lv == 0) ||
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1195 (treasure_level - 1 == 4) && (tr_lv == 3 || tr_lv == 2 || tr_lv == 1) ||
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1196 (treasure_level - 1 == 5) && (tr_lv == 3)
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1197 )
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1198 {
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1199 spc=pSpecialEnchantments[i].to_item_apply[out_item->GetItemEquipType()];
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1200 spc_sum+=spc;
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1201 if(spc)
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1202 {
2286
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1203 val_list[j++]=i;
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1204 }
2286
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1205 }
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1206 }
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1207
2378
48dbf99c0f7f spawn_light_elemental cleaned
Ritor1
parents: 2369
diff changeset
1208 v46 = rand()%spc_sum+1;//ñëó÷àéíûå çíà÷åíèÿ îò 1 äî spc_sum
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1209 j=0;
2286
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1210 v45 = 0;
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1211 while (v45<v46)
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1212 {
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1213 ++j;
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1214 out_item->uSpecEnchantmentType=val_list[j];
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1215 v45+=pSpecialEnchantments[val_list[j]].to_item_apply[out_item->GetItemEquipType()];
288e0b29a493 some cleanups in ItemsTable::GenerateItem
Grumpy7
parents: 2285
diff changeset
1216 }
0
Ritor1
parents:
diff changeset
1217 }
Ritor1
parents:
diff changeset
1218
Ritor1
parents:
diff changeset
1219 //----- (004505CC) --------------------------------------------------------
Ritor1
parents:
diff changeset
1220 bool ItemGen::GenerateArtifact()
Ritor1
parents:
diff changeset
1221 {
Ritor1
parents:
diff changeset
1222 signed int uNumArtifactsNotFound; // esi@1
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
1223 int artifacts_list[32];
0
Ritor1
parents:
diff changeset
1224
385
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
1225 memset(artifacts_list, 0,sizeof(artifacts_list));
0
Ritor1
parents:
diff changeset
1226 uNumArtifactsNotFound = 0;
385
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
1227
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
1228 for (int i=500;i<529;++i)
484
4bd56919f075 avard quest guild bits
Gloval
parents: 475
diff changeset
1229 if ( !pParty->pIsArtifactFound[i-500] )
385
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
1230 artifacts_list[uNumArtifactsNotFound++] = i;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
1231
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
1232 Reset();
0
Ritor1
parents:
diff changeset
1233 if ( uNumArtifactsNotFound )
Ritor1
parents:
diff changeset
1234 {
385
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
1235 uItemID = artifacts_list[rand() % uNumArtifactsNotFound];
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
1236 pItemsTable->SetSpecialBonus(this);
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
1237 return true;
0
Ritor1
parents:
diff changeset
1238 }
Ritor1
parents:
diff changeset
1239 else
385
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
1240 return false;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
1241
0
Ritor1
parents:
diff changeset
1242 }
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
1243
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1244 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
1245 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
1246 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
1247
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1248 #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
1249 #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
1250
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1251 #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
1252
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1253 #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
1254 #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
1255
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1256 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
1257 {
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1258 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
1259 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
1260 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
1261 {
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1262 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
1263 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
1264 }
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1265 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
1266 {
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1267 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
1268 }
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1269 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
1270 (*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
1271 }
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1272
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1273 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
1274 {
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1275 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
1276 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
1277 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
1278 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
1279 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
1280 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
1281 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
1282
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1283 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
1284 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
1285 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
1286 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
1287 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
1288 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
1289 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
1290 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
1291
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1292 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
1293 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
1294
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1295 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
1296 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
1297
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1298 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
1299 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
1300
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1301 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
1302 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
1303
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1304 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
1305 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
1306
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1307 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
1308 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
1309
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1310 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
1311 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
1312
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1313 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
1314 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
1315
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1316 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
1317 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
1318
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1319 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
1320 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
1321 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
1322 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
1323 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
1324 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
1325 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
1326 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
1327 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
1328 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
1329 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
1330 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
1331 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
1332 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
1333 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
1334 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
1335 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
1336
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1337 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
1338 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
1339 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
1340 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
1341
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1342 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
1343 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
1344
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1345 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
1346 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
1347 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
1348
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1349 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
1350 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
1351
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1352 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
1353 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
1354
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1355 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
1356 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
1357 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
1358
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1359 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
1360 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
1361 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
1362
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1363 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
1364 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
1365
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1366 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
1367 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
1368 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
1369 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
1370
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1371 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
1372 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
1373 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
1374
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1375 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
1376 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
1377 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
1378
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1379 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
1380 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
1381
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1382 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
1383 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
1384
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1385 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
1386 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
1387 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
1388
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1389 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
1390 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
1391 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
1392
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1393 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
1394 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
1395 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
1396
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1397 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
1398 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
1399 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
1400
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1401 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
1402 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
1403 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
1404
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1405 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
1406 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
1407
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1408 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
1409 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
1410
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1411 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
1412 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
1413
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1414 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
1415 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
1416 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
1417 }
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1418
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1419 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
1420 {
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1421 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
1422 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
1423
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1425 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
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 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
1428 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
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 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
1431 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
1432
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1434 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
1435
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1437 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
1438
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1440 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
1441
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1443 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
1444
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1446 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
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 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
1449 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
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 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
1452 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
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 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
1455 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
1456
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1458 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
1459
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1461 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
1462
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1464 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
1465
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1467 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
1468
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1470 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
1471
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1473 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
1474
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1476 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
1477
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1479 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
1480
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1482 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
1483
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1485 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
1486
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1488 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
1489
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1491 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
1492 }
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1495 {
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1497 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
1498 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
1499
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1501 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
1502
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1504 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
1505 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
1506
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1508 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
1509 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
1510 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
1511
1648
a4390cef284c DamagePlayerFromMonster starting cleanup
Grumpy7
parents: 1604
diff changeset
1512 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
1513 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
1514 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
1515 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
1516 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
1517 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
1518 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
1519 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
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 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
1522 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
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 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
1525 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
1526
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1528 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
1529
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1531 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
1532 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
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 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
1535 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_SPEED, 40);
1826
bdac32c645c5 Changing arrays in class Player to std::array
Grumpy7
parents: 1709
diff changeset
1536 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
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 itemId = ITEM_ARTIFACT_RULERS_RING;
1826
bdac32c645c5 Changing arrays in class Player to std::array
Grumpy7
parents: 1709
diff changeset
1539 NEWBONUSINTOARTIFACTLIST2(CHARACTER_ATTRIBUTE_SKILL_MIND, 0, &Player::skillMind);
bdac32c645c5 Changing arrays in class Player to std::array
Grumpy7
parents: 1709
diff changeset
1540 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
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 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
1543 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
1544 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
1545 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
1546 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
1547
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 itemId = ITEM_RELIC_ETHRICS_STAFF;
1826
bdac32c645c5 Changing arrays in class Player to std::array
Grumpy7
parents: 1709
diff changeset
1549 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
1550 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
1551
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1553 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
1554 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
1555 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
1556 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
1557 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
1558 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
1559 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
1560 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
1561 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
1562
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1564 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
1565
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1567 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
1568 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
1569 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
1570
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 itemId = ITEM_RELIC_GLORY_SHIELD;
1826
bdac32c645c5 Changing arrays in class Player to std::array
Grumpy7
parents: 1709
diff changeset
1572 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
1573 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
1574 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
1575 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
1576
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1578 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
1579 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
1580
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 itemId = ITEM_RELIC_TALEDONS_HELM;
1826
bdac32c645c5 Changing arrays in class Player to std::array
Grumpy7
parents: 1709
diff changeset
1582 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
1583 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
1584 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
1585 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
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 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
1588 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
1589 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
1590
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 itemId = ITEM_RELIC_PHYNAXIAN_CROWN;
1826
bdac32c645c5 Changing arrays in class Player to std::array
Grumpy7
parents: 1709
diff changeset
1592 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
1593 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
1594 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
1595 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
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 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
1598 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
1599 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
1600
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1602 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
1603 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
1604 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
1605 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
1606 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
1607 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
1608 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
1609 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
1610
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1612 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
1613 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
1614 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
1615
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 itemId = ITEM_RELIC_JUSTICE;
1826
bdac32c645c5 Changing arrays in class Player to std::array
Grumpy7
parents: 1709
diff changeset
1617 NEWBONUSINTOARTIFACTLIST2(CHARACTER_ATTRIBUTE_SKILL_MIND, 0, &Player::skillMind);
bdac32c645c5 Changing arrays in class Player to std::array
Grumpy7
parents: 1709
diff changeset
1618 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
1619 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
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 itemId = ITEM_RELIC_MEKORIGS_HAMMER;
1826
bdac32c645c5 Changing arrays in class Player to std::array
Grumpy7
parents: 1709
diff changeset
1622 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
1623 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
1624 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
1625
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1627 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
1628 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
1629 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
1630
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1632 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
1633 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
1634
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1636 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
1637 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
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 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
1640 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
1641 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
1642
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1644 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
1645 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
1646 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
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 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
1649 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
1650 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
1651 }
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1654 {
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1656 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
1657 {
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
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 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
1661 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
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 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
1664 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
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 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
1667 {
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 *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
1669 }
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
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 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
1673 {
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 *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
1675 }
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 }
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 }
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1679 {
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 *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
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 }
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 }
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1686 {
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1688 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
1689 {
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1691 }
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1693 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
1694 {
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1696 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
1697 {
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 *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
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 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
1701 {
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 *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
1703 }
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 }
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1708 {
1685
2a309997c42f Player::StealFromShop started cleanup, fixing a few errors caused by not commiting everything
Grumpy7
parents: 1682
diff changeset
1709 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
1710 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
1711 {
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1713 }
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create 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 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
1715 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
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
1709
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1718 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
1719 {
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1720 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
1721 }
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1722
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1723 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
1724 {
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1725 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
1726 }
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1727
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1728 char* ItemGen::GetIconName()
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1729 {
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1730 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
1731 }
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1732
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1733 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
1734 {
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1735 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
1736 }
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1737
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1738 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
1739 {
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1740 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
1741 }
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1742
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1743 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
1744 {
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1745 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
1746 }
461
197461e5acec moved shop generators to item.cpp
Gloval
parents: 436
diff changeset
1747 //----- (004B8E3D) --------------------------------------------------------
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
1748 void GenerateStandartShopItems()
1920
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1749 {
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1750 signed int item_count;
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1751 signed int shop_index;
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1752 int treasure_lvl;
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1753 int item_class;
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1754 int mdf;
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
1755
1920
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1756 shop_index = (signed int)window_SpeakInHouse->ptr_1C;
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1757 if ( uItemsAmountPerShopType[p2DEvents[shop_index - 1].uType] )
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1758 {
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1759 for (item_count = 0; item_count < uItemsAmountPerShopType[p2DEvents[shop_index - 1].uType]; ++item_count )
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1760 {
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1761 if (shop_index <= 14) //weapon shop
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1762 {
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1763 treasure_lvl = shopWeap_variation_ord[shop_index].treasure_level;
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1764 item_class = shopWeap_variation_ord[shop_index].item_class[rand() % 4];
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1765 }
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1766 else if (shop_index <= 28) //armor shop
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1767 {
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1768 mdf = 0;
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1769 if (item_count > 3)
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1770 ++mdf;// rechek offsets
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1771 treasure_lvl = shopArmr_variation_ord[2*(shop_index - 15) + mdf].treasure_level;
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1772 item_class = shopArmr_variation_ord[2*(shop_index - 15) + mdf].item_class[rand() % 4];
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1773 }
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1774 else if (shop_index <= 41) //magic shop
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1775 {
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1776 treasure_lvl = shopMagic_treasure_lvl[shop_index - 28];
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1777 item_class = 22; //misc
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1778 }
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1779 else if (shop_index <= 53) //alchemist shop
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1780 {
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1781 if (item_count < 6)
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1782 {
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1783 pParty->StandartItemsInShops[shop_index][item_count].Reset();
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1784 pParty->StandartItemsInShops[shop_index][item_count].uItemID = 220; //potion bottle
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1785 continue;
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1786 }
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1787 else
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1788 {
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1789 treasure_lvl = shopAlch_treasure_lvl[shop_index - 41];
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1790 item_class = 45; //reagent
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1791 }
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1792 }
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1793 pItemsTable->GenerateItem(treasure_lvl, item_class, &pParty->StandartItemsInShops[shop_index][item_count]);
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1794 pParty->StandartItemsInShops[shop_index][item_count].SetIdentified(); //identified
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1795 }
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1796 }
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1797 pParty->InTheShopFlags[shop_index] = 0;
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1798 }
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
1799
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
1800 //----- (004B8F94) --------------------------------------------------------
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
1801 void GenerateSpecialShopItems()
1920
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1802 {
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1803 signed int item_count;
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1804 signed int shop_index;
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1805 int treasure_lvl;
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1806 int item_class;
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1807 int mdf;
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
1808
1920
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1809 shop_index = (signed int)window_SpeakInHouse->ptr_1C;
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1810 if ( uItemsAmountPerShopType[p2DEvents[shop_index - 1].uType] )
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1811 {
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1812 for ( item_count = 0; item_count < uItemsAmountPerShopType[p2DEvents[shop_index - 1].uType]; ++item_count )
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1813 {
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1814 if (shop_index <= 14) //weapon shop
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1815 {
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1816 treasure_lvl = shopWeap_variation_spc[shop_index].treasure_level;
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1817 item_class = shopWeap_variation_spc[shop_index].item_class[rand() % 4];
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1818 }
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1819 else if (shop_index <= 28) //armor shop
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1820 {
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1821 mdf = 0;
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1822 if (item_count > 3)
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1823 ++mdf;
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1824 treasure_lvl = shopArmr_variation_spc[2*(shop_index - 15) + mdf].treasure_level;
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1825 item_class = shopArmr_variation_spc[2*(shop_index - 15) + mdf].item_class[rand() % 4];
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1826 }
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1827 else if (shop_index <= 41) //magic shop
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1828 {
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1829 treasure_lvl = shopMagicSpc_treasure_lvl[shop_index - 28];
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1830 item_class = 22; //misc
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1831 }
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1832 else if (shop_index <= 53) //alchemist shop
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1833 {
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1834 if (item_count < 6)
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1835 {
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1836 pParty->SpecialItemsInShops[shop_index][item_count].Reset();
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1837 pParty->SpecialItemsInShops[shop_index][item_count].uItemID = rand() % 32 + 740; //mscrool
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1838 continue;
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1839 }
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1840 else
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1841 {
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1842 treasure_lvl = shopAlchSpc_treasure_lvl[shop_index - 41];
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1843 item_class = 44; //potion
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1844 }
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1845 }
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1846 pItemsTable->GenerateItem(treasure_lvl, item_class, &pParty->SpecialItemsInShops[shop_index][item_count]);
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1847 pParty->SpecialItemsInShops[shop_index][item_count].SetIdentified(); //identified
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1848 }
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1849 }
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1850 pParty->InTheShopFlags[shop_index] = 0;
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1851 }
461
197461e5acec moved shop generators to item.cpp
Gloval
parents: 436
diff changeset
1852
197461e5acec moved shop generators to item.cpp
Gloval
parents: 436
diff changeset
1853
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
1854 //----- (00450218) --------------------------------------------------------
598
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
1855 void GenerateItemsInChest()
526
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 484
diff changeset
1856 {
2287
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1857 unsigned int mapType; // eax@1
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1858 MapInfo *currMapInfo; // esi@1
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1859 ItemGen *currItem; // ebx@2
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1860 int additionaItemCount; // ebp@4
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1861 int treasureLevelBot; // edi@4
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1862 int treasureLevelTop; // esi@4
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1863 signed int treasureLevelRange; // esi@4
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1864 int resultTreasureLevel; // edx@4
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1865 int goldAmount; // esi@8
598
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
1866 int v11; // ebp@25
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
1867 int v12; // esi@25
2287
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1868 signed int whatToGenerateProb; // [sp+10h] [bp-18h]@1
461
197461e5acec moved shop generators to item.cpp
Gloval
parents: 436
diff changeset
1869
2287
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1870 mapType = pMapStats->GetMapInfo(pCurrentMapName);
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1871 currMapInfo = &pMapStats->pInfos[mapType];
598
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
1872 for(int i=1; i<20;++i)
2287
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1873 {
598
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
1874 for(int j=0; j<140;++j)
2287
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1875 {
526
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 484
diff changeset
1876
2287
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1877 currItem = &pChests[i].igChestItems[j];
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1878 if ( currItem->uItemID < 0 )
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1879 {
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1880 additionaItemCount = rand() % 5; //additional items in chect
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1881 treasureLevelBot = byte_4E8168[abs(currItem->uItemID)-1][2*currMapInfo->Treasure_prob];
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1882 treasureLevelTop = byte_4E8168[abs(currItem->uItemID)-1][2*currMapInfo->Treasure_prob+1];
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1883 treasureLevelRange = treasureLevelTop - treasureLevelBot + 1;
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1884 resultTreasureLevel = treasureLevelBot + rand() % treasureLevelRange; //treasure level
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1885 if (resultTreasureLevel<7)
598
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
1886 {
2287
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1887 v11 = 0;
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1888 do
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1889 {
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1890 whatToGenerateProb = rand() % 100;
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1891 if (whatToGenerateProb<20)
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1892 {
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1893 currItem->Reset();
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1894 }
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1895 else if (whatToGenerateProb<60) //generate gold
598
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
1896 {
2287
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1897 goldAmount=0;
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1898 currItem->Reset();
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1899 switch (resultTreasureLevel)
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1900 {
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1901 case 1: //small gold
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1902 goldAmount = rand() % 51 + 50;
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1903 currItem->uItemID = 197;
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1904 break;
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1905 case 2://small gold
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1906 goldAmount = rand() % 101 + 100;
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1907 currItem->uItemID = 197;
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1908 break;
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1909 case 3: //medium
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1910 goldAmount = rand() % 301 + 200;
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1911 currItem->uItemID = 198;
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1912 break;
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1913 case 4: //medium
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1914 goldAmount = rand() % 501 + 500;
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1915 currItem->uItemID = 198;
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1916 break;
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1917 case 5: //big
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1918 goldAmount = rand() % 1001 + 1000;
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1919 currItem->uItemID = 199;
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1920 break;
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1921 case 6: //big
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1922 goldAmount = rand() % 3001 + 2000;
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1923 currItem->uItemID = 199;
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1924 break;
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1925 }
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1926 currItem->SetIdentified();
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1927 currItem->uSpecEnchantmentType = goldAmount;
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1928 }
598
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
1929 else
2287
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1930 {
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1931 pItemsTable->GenerateItem(resultTreasureLevel, 0, currItem);
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1932 }
598
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
1933 v12 = 0;
2287
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1934 while ( !(pChests[i].igChestItems[v12].uItemID==0) &&(v12<140))
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1935 {
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1936 ++v12;
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1937 }
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1938 if (v12 >= 140)
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1939 break;
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1940 currItem=&pChests[i].igChestItems[v12];
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1941 v11++;
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1942 } while (v11 < additionaItemCount + 1); // + 1 because it's the item at pChests[i].igChestItems[j] and the additional ones
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1943 }
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1944 else
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1945 currItem->GenerateArtifact();
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1946 }
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1947 }
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1948 }
598
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
1949
2287
4e3236a4ea63 GenerateItemsInChest cleaned up a bit, unified the two switches
Grumpy7
parents: 2286
diff changeset
1950 }
461
197461e5acec moved shop generators to item.cpp
Gloval
parents: 436
diff changeset
1951
197461e5acec moved shop generators to item.cpp
Gloval
parents: 436
diff changeset
1952
197461e5acec moved shop generators to item.cpp
Gloval
parents: 436
diff changeset
1953
197461e5acec moved shop generators to item.cpp
Gloval
parents: 436
diff changeset
1954
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
1955 // 4505CC: using guessed type int var_A0[32];
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
1956 //----- (004B3703) --------------------------------------------------------
473
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
1957 void FillAviableSkillsToTeach( int _this )
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
1958 {
1838
211dfe2d8db1 changing global char* vars to const char* vars
Grumpy7
parents: 1826
diff changeset
1959 const char *v30; // ecx@65
473
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
1960 unsigned int v29; // edx@56
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
1961 int v15; // ecx@19
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
1962 int v33; // [sp-4h] [bp-2Ch]@23
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
1963 int v34; // [sp-4h] [bp-2Ch]@43
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
1964 int v21; // ecx@34
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
1965 int v35[5]; // [sp+Ch] [bp-1Ch]@8
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
1966 int v37=0; // [sp+24h] [bp-4h]@1*
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
1967 int i=0;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
1968
2285
4fd03103be62 sub_4BE571 changed to sub_4BE571_AddItemToSet + cleaned up, dword_F8B1DC changed to dword_F8B1DC_currentShopOption + moved out of mm7_data
Grumpy7
parents: 2284
diff changeset
1969 dword_F8B1DC_currentShopOption = 0;
473
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
1970
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
1971 switch (_this)
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
1972 {
473
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
1973 case 1: //shop weapon
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
1974 for (int i=0; i<2; ++i)
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
1975 {
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
1976 for (int j=0; j<4; ++j)
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
1977 {
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
1978 if ( i )
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
1979 v21 = shopWeap_variation_spc[(unsigned int)window_SpeakInHouse->ptr_1C].item_class[j];
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
1980 else
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
1981 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
1982
473
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
1983 switch (v21)
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
1984 {
473
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
1985 case 23: v34 = 37; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
1986 case 24: v34 = 38; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
1987 case 25: v34 = 39; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
1988 case 26: v34 = 40; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
1989 case 27: v34 = 41; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
1990 case 28: v34 = 42; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
1991 case 30: v34 = 36; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
1992 default:
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
1993 continue;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
1994 }
2285
4fd03103be62 sub_4BE571 changed to sub_4BE571_AddItemToSet + cleaned up, dword_F8B1DC changed to dword_F8B1DC_currentShopOption + moved out of mm7_data
Grumpy7
parents: 2284
diff changeset
1995 v37 = sub_4BE571_AddItemToSet(v34, v35, v37, 5);
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
1996 }
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
1997 }
473
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
1998 break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
1999 case 2: //shop armor
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2000
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2001 for (int i=0; i<2; ++i)
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
2002 {
473
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2003 for (int j=0; j<2; ++j)
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
2004 {
473
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2005 for (int k=0; k<4; ++k)
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
2006 {
473
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2007 if ( i )
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2008 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
2009 else
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2010 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
2011 switch (v15)
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
2012 {
473
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2013 case 31: v33 = 45; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2014 case 32: v33 = 46; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2015 case 33: v33 = 47; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2016 case 34: v33 = 44; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2017 default:
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2018 continue;
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
2019 }
2285
4fd03103be62 sub_4BE571 changed to sub_4BE571_AddItemToSet + cleaned up, dword_F8B1DC changed to dword_F8B1DC_currentShopOption + moved out of mm7_data
Grumpy7
parents: 2284
diff changeset
2020 v37 = sub_4BE571_AddItemToSet(v33, v35, v37, 5);
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
2021 }
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
2022 }
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
2023 }
473
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2024 break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2025 case 3: //shop magic
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2026 v37 = 2;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2027 v35[0] = 57;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2028 v35[1] = 59;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2029 break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2030 case 4: //shop alchemist
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2031 v37 = 2;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2032 v35[0] = 71;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2033 v35[1] = 68;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2034 break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2035 case 21: //tavern
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2036 v37 = 3;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2037 v35[0] = 70;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2038 v35[1] = 65;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2039 v35[2] = 62;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2040 break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2041 case 23: //temple
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2042 v37 = 3;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2043 v35[0] = 67;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2044 v35[1] = 66;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2045 v35[2] = 58;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2046 break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2047 case 30: ///trainig
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2048 v37 = 2;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2049 v35[0] = 69;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2050 v35[1] = 60;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2051 break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2052 }
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2053 for(i=0;i<v37;++i)
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2054 {
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2055 v29=v35[i];
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2056 switch(v29)
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
2057 {
473
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2058 case 40 :v30 = pSkillNames[4]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2059 case 5 : v30 = pSkillNames[23]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2060 case 36 :v30 = pSkillNames[0]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2061 case 37 :v30 = pSkillNames[1]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2062 case 38 :v30 = pSkillNames[2]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2063 case 39 :v30 = pSkillNames[3]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2064 case 41 :v30 = pSkillNames[5]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2065 case 42 :v30 = pSkillNames[6]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2066 case 44 :v30 = pSkillNames[8]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2067 case 45 :v30 = pSkillNames[9]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2068 case 46 :v30 = pSkillNames[10]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2069 case 47 :v30 = pSkillNames[11]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2070 case 66 :v30 = pSkillNames[30]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2071 case 57 :v30 = pSkillNames[21]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2072 case 58 :v30 = pSkillNames[22]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2073 case 60 :v30 = pSkillNames[24]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2074 case 62 :v30 = pSkillNames[26]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2075 case 65 :v30 = pSkillNames[29]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2076 case 67:v30 = pSkillNames[31]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2077 case 68:v30 = pSkillNames[32]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2078 case 69:v30 = pSkillNames[33]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2079 case 70:v30 = pSkillNames[34]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2080 case 71:v30 = pSkillNames[35]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2081 default:
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
2082 v30 = pGlobalTXT_LocalizationStrings[127]; //"No Text!"
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
2083 }
2285
4fd03103be62 sub_4BE571 changed to sub_4BE571_AddItemToSet + cleaned up, dword_F8B1DC changed to dword_F8B1DC_currentShopOption + moved out of mm7_data
Grumpy7
parents: 2284
diff changeset
2084 pShopOptions[dword_F8B1DC_currentShopOption] = const_cast<char *>(v30);
4fd03103be62 sub_4BE571 changed to sub_4BE571_AddItemToSet + cleaned up, dword_F8B1DC changed to dword_F8B1DC_currentShopOption + moved out of mm7_data
Grumpy7
parents: 2284
diff changeset
2085 ++dword_F8B1DC_currentShopOption;
473
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2086 CreateButtonInColumn(i+1, v29);
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
2087 }
972
c8a0f6d89c70 Some inqury on selecting Knight bug.
Nomad
parents: 901
diff changeset
2088 pDialogueWindow->_41D08F_set_keyboard_control_group(i, 1, 0, 2);
473
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2089 dword_F8B1E0 = pDialogueWindow->pNumPresenceButton;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2090 }
475
77430756f06a fix show info item in shop
Gloval
parents: 473
diff changeset
2091
77430756f06a fix show info item in shop
Gloval
parents: 473
diff changeset
2092 //----- (004BE571) --------------------------------------------------------
2285
4fd03103be62 sub_4BE571 changed to sub_4BE571_AddItemToSet + cleaned up, dword_F8B1DC changed to dword_F8B1DC_currentShopOption + moved out of mm7_data
Grumpy7
parents: 2284
diff changeset
2093 int sub_4BE571_AddItemToSet(int valueToAdd, int *outPutSet, int elemsAlreadyPresent, int elemsNeeded)
4fd03103be62 sub_4BE571 changed to sub_4BE571_AddItemToSet + cleaned up, dword_F8B1DC changed to dword_F8B1DC_currentShopOption + moved out of mm7_data
Grumpy7
parents: 2284
diff changeset
2094 {
475
77430756f06a fix show info item in shop
Gloval
parents: 473
diff changeset
2095 int i; // esi@3
77430756f06a fix show info item in shop
Gloval
parents: 473
diff changeset
2096
2285
4fd03103be62 sub_4BE571 changed to sub_4BE571_AddItemToSet + cleaned up, dword_F8B1DC changed to dword_F8B1DC_currentShopOption + moved out of mm7_data
Grumpy7
parents: 2284
diff changeset
2097 if ( elemsAlreadyPresent < elemsNeeded )
4fd03103be62 sub_4BE571 changed to sub_4BE571_AddItemToSet + cleaned up, dword_F8B1DC changed to dword_F8B1DC_currentShopOption + moved out of mm7_data
Grumpy7
parents: 2284
diff changeset
2098 {
4fd03103be62 sub_4BE571 changed to sub_4BE571_AddItemToSet + cleaned up, dword_F8B1DC changed to dword_F8B1DC_currentShopOption + moved out of mm7_data
Grumpy7
parents: 2284
diff changeset
2099 for ( i = 0; i < elemsAlreadyPresent; ++i )
4fd03103be62 sub_4BE571 changed to sub_4BE571_AddItemToSet + cleaned up, dword_F8B1DC changed to dword_F8B1DC_currentShopOption + moved out of mm7_data
Grumpy7
parents: 2284
diff changeset
2100 {
4fd03103be62 sub_4BE571 changed to sub_4BE571_AddItemToSet + cleaned up, dword_F8B1DC changed to dword_F8B1DC_currentShopOption + moved out of mm7_data
Grumpy7
parents: 2284
diff changeset
2101 if ( valueToAdd == outPutSet[i] )
4fd03103be62 sub_4BE571 changed to sub_4BE571_AddItemToSet + cleaned up, dword_F8B1DC changed to dword_F8B1DC_currentShopOption + moved out of mm7_data
Grumpy7
parents: 2284
diff changeset
2102 return elemsAlreadyPresent;
4fd03103be62 sub_4BE571 changed to sub_4BE571_AddItemToSet + cleaned up, dword_F8B1DC changed to dword_F8B1DC_currentShopOption + moved out of mm7_data
Grumpy7
parents: 2284
diff changeset
2103 }
4fd03103be62 sub_4BE571 changed to sub_4BE571_AddItemToSet + cleaned up, dword_F8B1DC changed to dword_F8B1DC_currentShopOption + moved out of mm7_data
Grumpy7
parents: 2284
diff changeset
2104 outPutSet[elemsAlreadyPresent] = valueToAdd;
4fd03103be62 sub_4BE571 changed to sub_4BE571_AddItemToSet + cleaned up, dword_F8B1DC changed to dword_F8B1DC_currentShopOption + moved out of mm7_data
Grumpy7
parents: 2284
diff changeset
2105 return elemsAlreadyPresent + 1;
475
77430756f06a fix show info item in shop
Gloval
parents: 473
diff changeset
2106 }
2285
4fd03103be62 sub_4BE571 changed to sub_4BE571_AddItemToSet + cleaned up, dword_F8B1DC changed to dword_F8B1DC_currentShopOption + moved out of mm7_data
Grumpy7
parents: 2284
diff changeset
2107 return elemsNeeded;
4fd03103be62 sub_4BE571 changed to sub_4BE571_AddItemToSet + cleaned up, dword_F8B1DC changed to dword_F8B1DC_currentShopOption + moved out of mm7_data
Grumpy7
parents: 2284
diff changeset
2108 }
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2109 //----- (0043C91D) --------------------------------------------------------
2288
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2110 int GetItemTextureFilename(char *pOut, signed int item_id, int index, int shoulder)
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2111 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2112 int result; // eax@2
475
77430756f06a fix show info item in shop
Gloval
parents: 473
diff changeset
2113
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2114 result = 0; //BUG fn is void
2288
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2115 if ( item_id > 500 )
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2116 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2117 switch ( item_id )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2118 {
2289
60293358b4b3 byte_5111F6 to byte_5111F6_OwnedArtifacts, changed magic numbers to enums in GetItemTextureFilename
Grumpy7
parents: 2288
diff changeset
2119 case ITEM_RELIC_HARECS_LEATHER:
60293358b4b3 byte_5111F6 to byte_5111F6_OwnedArtifacts, changed magic numbers to enums in GetItemTextureFilename
Grumpy7
parents: 2288
diff changeset
2120 if (byte_5111F6_OwnedArtifacts[2] != 0)
2288
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2121 item_id = 234;
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2122 break;
2289
60293358b4b3 byte_5111F6 to byte_5111F6_OwnedArtifacts, changed magic numbers to enums in GetItemTextureFilename
Grumpy7
parents: 2288
diff changeset
2123 case ITEM_ARTIFACT_YORUBA:
60293358b4b3 byte_5111F6 to byte_5111F6_OwnedArtifacts, changed magic numbers to enums in GetItemTextureFilename
Grumpy7
parents: 2288
diff changeset
2124 if (byte_5111F6_OwnedArtifacts[1] != 0)
2288
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2125 item_id = 236;
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2126 break;
2289
60293358b4b3 byte_5111F6 to byte_5111F6_OwnedArtifacts, changed magic numbers to enums in GetItemTextureFilename
Grumpy7
parents: 2288
diff changeset
2127 case ITEM_ARTIFACT_GOVERNORS_ARMOR:
60293358b4b3 byte_5111F6 to byte_5111F6_OwnedArtifacts, changed magic numbers to enums in GetItemTextureFilename
Grumpy7
parents: 2288
diff changeset
2128 if (byte_5111F6_OwnedArtifacts[0] != 0)
2288
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2129 item_id = 235;
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2130 break;
2289
60293358b4b3 byte_5111F6 to byte_5111F6_OwnedArtifacts, changed magic numbers to enums in GetItemTextureFilename
Grumpy7
parents: 2288
diff changeset
2131 case ITEM_ELVEN_CHAINMAIL:
60293358b4b3 byte_5111F6 to byte_5111F6_OwnedArtifacts, changed magic numbers to enums in GetItemTextureFilename
Grumpy7
parents: 2288
diff changeset
2132 if (byte_5111F6_OwnedArtifacts[16] != 0)
2288
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2133 item_id = 73;
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2134 break;
2289
60293358b4b3 byte_5111F6 to byte_5111F6_OwnedArtifacts, changed magic numbers to enums in GetItemTextureFilename
Grumpy7
parents: 2288
diff changeset
2135 case ITEM_ARTIFACT_LEAGUE_BOOTS:
60293358b4b3 byte_5111F6 to byte_5111F6_OwnedArtifacts, changed magic numbers to enums in GetItemTextureFilename
Grumpy7
parents: 2288
diff changeset
2136 if (byte_5111F6_OwnedArtifacts[3] != 0)
2288
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2137 item_id = 312;
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2138 break;
2289
60293358b4b3 byte_5111F6 to byte_5111F6_OwnedArtifacts, changed magic numbers to enums in GetItemTextureFilename
Grumpy7
parents: 2288
diff changeset
2139 case ITEM_RELIC_TALEDONS_HELM:
60293358b4b3 byte_5111F6 to byte_5111F6_OwnedArtifacts, changed magic numbers to enums in GetItemTextureFilename
Grumpy7
parents: 2288
diff changeset
2140 if (byte_5111F6_OwnedArtifacts[4] != 0)
2288
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2141 item_id = 239;
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2142 break;
2289
60293358b4b3 byte_5111F6 to byte_5111F6_OwnedArtifacts, changed magic numbers to enums in GetItemTextureFilename
Grumpy7
parents: 2288
diff changeset
2143 case ITEM_RELIC_SCHOLARS_CAP:
60293358b4b3 byte_5111F6 to byte_5111F6_OwnedArtifacts, changed magic numbers to enums in GetItemTextureFilename
Grumpy7
parents: 2288
diff changeset
2144 if (byte_5111F6_OwnedArtifacts[5] != 0)
2288
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2145 item_id = 240;
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2146 break;
2289
60293358b4b3 byte_5111F6 to byte_5111F6_OwnedArtifacts, changed magic numbers to enums in GetItemTextureFilename
Grumpy7
parents: 2288
diff changeset
2147 case ITEM_RELIC_PHYNAXIAN_CROWN:
60293358b4b3 byte_5111F6 to byte_5111F6_OwnedArtifacts, changed magic numbers to enums in GetItemTextureFilename
Grumpy7
parents: 2288
diff changeset
2148 if (byte_5111F6_OwnedArtifacts[6] != 0)
2288
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2149 item_id = 241;
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2150 break;
2289
60293358b4b3 byte_5111F6 to byte_5111F6_OwnedArtifacts, changed magic numbers to enums in GetItemTextureFilename
Grumpy7
parents: 2288
diff changeset
2151 case ITEM_ARTIFACT_MINDS_EYE:
60293358b4b3 byte_5111F6 to byte_5111F6_OwnedArtifacts, changed magic numbers to enums in GetItemTextureFilename
Grumpy7
parents: 2288
diff changeset
2152 if (byte_5111F6_OwnedArtifacts[7] != 0)
2288
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2153 item_id = 93;
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2154 break;
2289
60293358b4b3 byte_5111F6 to byte_5111F6_OwnedArtifacts, changed magic numbers to enums in GetItemTextureFilename
Grumpy7
parents: 2288
diff changeset
2155 case ITEM_RARE_SHADOWS_MASK:
60293358b4b3 byte_5111F6 to byte_5111F6_OwnedArtifacts, changed magic numbers to enums in GetItemTextureFilename
Grumpy7
parents: 2288
diff changeset
2156 if (byte_5111F6_OwnedArtifacts[8] != 0)
2288
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2157 item_id = 344;
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2158 break;
2289
60293358b4b3 byte_5111F6 to byte_5111F6_OwnedArtifacts, changed magic numbers to enums in GetItemTextureFilename
Grumpy7
parents: 2288
diff changeset
2159 case ITEM_RILIC_TITANS_BELT:
60293358b4b3 byte_5111F6 to byte_5111F6_OwnedArtifacts, changed magic numbers to enums in GetItemTextureFilename
Grumpy7
parents: 2288
diff changeset
2160 if (byte_5111F6_OwnedArtifacts[9] != 0)
2288
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2161 item_id = 324;
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2162 break;
2289
60293358b4b3 byte_5111F6 to byte_5111F6_OwnedArtifacts, changed magic numbers to enums in GetItemTextureFilename
Grumpy7
parents: 2288
diff changeset
2163 case ITEM_ARTIFACT_HEROS_BELT:
60293358b4b3 byte_5111F6 to byte_5111F6_OwnedArtifacts, changed magic numbers to enums in GetItemTextureFilename
Grumpy7
parents: 2288
diff changeset
2164 if (byte_5111F6_OwnedArtifacts[10] != 0)
2288
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2165 item_id = 104;
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2166 break;
2289
60293358b4b3 byte_5111F6 to byte_5111F6_OwnedArtifacts, changed magic numbers to enums in GetItemTextureFilename
Grumpy7
parents: 2288
diff changeset
2167 case ITEM_RELIC_TWILIGHT:
60293358b4b3 byte_5111F6 to byte_5111F6_OwnedArtifacts, changed magic numbers to enums in GetItemTextureFilename
Grumpy7
parents: 2288
diff changeset
2168 if (byte_5111F6_OwnedArtifacts[11] != 0)
2288
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2169 item_id = 325;
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2170 break;
2289
60293358b4b3 byte_5111F6 to byte_5111F6_OwnedArtifacts, changed magic numbers to enums in GetItemTextureFilename
Grumpy7
parents: 2288
diff changeset
2171 case ITEM_ARTIFACT_CLOAK_OF_THE_SHEEP:
60293358b4b3 byte_5111F6 to byte_5111F6_OwnedArtifacts, changed magic numbers to enums in GetItemTextureFilename
Grumpy7
parents: 2288
diff changeset
2172 if (byte_5111F6_OwnedArtifacts[12] != 0)
2288
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2173 item_id = 330;
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2174 break;
2289
60293358b4b3 byte_5111F6 to byte_5111F6_OwnedArtifacts, changed magic numbers to enums in GetItemTextureFilename
Grumpy7
parents: 2288
diff changeset
2175 case ITEM_RARE_SUN_CLOAK:
60293358b4b3 byte_5111F6 to byte_5111F6_OwnedArtifacts, changed magic numbers to enums in GetItemTextureFilename
Grumpy7
parents: 2288
diff changeset
2176 if (byte_5111F6_OwnedArtifacts[13] != 0)
2288
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2177 item_id = 347;
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2178 break;
2289
60293358b4b3 byte_5111F6 to byte_5111F6_OwnedArtifacts, changed magic numbers to enums in GetItemTextureFilename
Grumpy7
parents: 2288
diff changeset
2179 case ITEM_RARE_MOON_CLOAK:
60293358b4b3 byte_5111F6 to byte_5111F6_OwnedArtifacts, changed magic numbers to enums in GetItemTextureFilename
Grumpy7
parents: 2288
diff changeset
2180 if (byte_5111F6_OwnedArtifacts[14] != 0)
2288
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2181 item_id = 348;
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2182 break;
2289
60293358b4b3 byte_5111F6 to byte_5111F6_OwnedArtifacts, changed magic numbers to enums in GetItemTextureFilename
Grumpy7
parents: 2288
diff changeset
2183 case ITEM_RARE_VAMPIRES_CAPE:
60293358b4b3 byte_5111F6 to byte_5111F6_OwnedArtifacts, changed magic numbers to enums in GetItemTextureFilename
Grumpy7
parents: 2288
diff changeset
2184 if (byte_5111F6_OwnedArtifacts[15] != 0)
2288
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2185 item_id = 350;
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2186 break;
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2187 default:
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2188 return 0;
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2189 }
2288
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2190 }
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2191
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2192 switch (pItemsTable->pItems[item_id].uEquipType)
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2193 {
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2194 case EQUIP_ARMOUR:
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2195 if ( !shoulder )
2288
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2196 return sprintf(pOut, "item%3.3dv%d", item_id, index);
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2197 else if ( shoulder == 1 )
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2198 return sprintf(pOut, "item%3.3dv%da1", item_id, index);
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2199 else if ( shoulder == 2 )
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2200 return sprintf(pOut, "item%3.3dv%da2", item_id, index);
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2201 break;
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2202 case EQUIP_CLOAK:
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2203 if ( !shoulder )
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2204 return sprintf(pOut, "item%3.3dv%d", item_id, index);
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2205 else
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2206 return sprintf(pOut, "item%3.3dv%da1", item_id, index);
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2207 default:
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2208 return sprintf(pOut, "item%3.3dv%d", item_id, index);
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2209 }
2288
406605240b0a GetItemTextureFilename cleaned up
Grumpy7
parents: 2287
diff changeset
2210
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2211 result = item_id - 504;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2212 return result;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2213 }
475
77430756f06a fix show info item in shop
Gloval
parents: 473
diff changeset
2214
2250
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2215
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2216 //----- (004BDAAF) --------------------------------------------------------
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2217 bool ItemGen::MerchandiseTest(int _2da_idx)
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2218 {
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2219 bool test;
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2220
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2221 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
2222 && ((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
2223 return false;
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2224 switch( p2DEvents[_2da_idx - 1].uType )
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2225 {
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2226 case BuildingType_WeaponShop:
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2227 {
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2228 test = this->GetItemEquipType() <= EQUIP_BOW;
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2229 break;
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2230 }
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2231 case BuildingType_ArmorShop:
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2232 {
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2233 test = this->GetItemEquipType() >= EQUIP_ARMOUR && this->GetItemEquipType() <= EQUIP_BOOTS;
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2234 break;
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2235 }
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2236 case BuildingType_MagicShop:
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2237 {
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2238 test = this->GetPlayerSkillType() == PLAYER_SKILL_MISC || this->GetItemEquipType() == EQIUP_ANY;
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2239 break;
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2240 }
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2241 case BuildingType_AlchemistShop:
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2242 {
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2243 test = this->GetItemEquipType() == EQUIP_REAGENT || this->GetItemEquipType() == EQUIP_POTION
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2244 || (this->GetItemEquipType() > EQUIP_POTION && !(this->GetItemEquipType() != EQUIP_MESSAGE_SCROLL
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2245 || (signed int)this->uItemID < 740) && this->uItemID != 771);
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2246 break;
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2247 }
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2248 default:
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2249 {
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2250 test = false;
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2251 break;
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2252 }
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2253 }
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2254 return test;
2464
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
2255 }
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
2256
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
2257 //----- (00493F79) --------------------------------------------------------
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
2258 void init_summoned_item(stru351_summoned_item *_this, __int64 duration)
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
2259 {
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
2260 signed __int64 v2; // ST2C_8@1
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
2261 signed __int64 v3; // qax@1
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
2262 //signed __int64 v4; // ST1C_8@1
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
2263 unsigned __int64 v5; // qax@1
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
2264 unsigned int v6; // ebx@1
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
2265
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
2266 v2 = (signed __int64)((double)duration * 0.234375);
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
2267 v3 = v2 / 60 / 60;
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
2268 //v4 = v3;
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
2269 v5 = (unsigned int)v3 / 0x18;
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
2270 v6 = (unsigned int)(v5 / 7) >> 2;
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
2271 _this->field_0_expire_second = v2 % 60;
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
2272 _this->field_4_expire_minute = v2 / 60 % 60;
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
2273 _this->field_8_expire_hour = v3 % 24;
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
2274 _this->field_10_expire_week = v5 / 7 & 3;
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
2275 _this->field_C_expire_day = (unsigned int)v5 % 0x1C;
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
2276 _this->field_14_exprie_month = v6 % 0xC;
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
2277 _this->field_18_expire_year = v6 / 0xC + game_starting_year;
104fdbea0386 cleaning project part 2
zipi
parents: 2415
diff changeset
2278 }