annotate Items.cpp @ 463:f7b91ef98ab2

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