annotate Items.cpp @ 16:5a95b9ed31f3

13.10.12
author Lower
date Sat, 13 Oct 2012 20:25:41 +0600
parents 8b8875f5b359
children 509744251c8e
rev   line source
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1 #include <stdlib.h>
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3 #include "Items.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4 #include "MapInfo.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5 #include "FrameTableInc.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6 #include "Allocator.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7 #include "LOD.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8 #include "Monsters.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9 #include "Party.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10 #include "FactionTable.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11 #include "StorylineTextTable.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13 #include "mm7_data.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19 ItemGen *ptr_50C9A4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21 struct ItemsTable *pItemsTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
27 //----- (00439DF3) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
28 int ItemGen::_439DF3_get_additional_damage(int *a2, int *a3)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
29 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
30 int *v3; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
31 ItemGen *v4; // ebx@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
32 signed int v5; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
33 unsigned int v7; // ecx@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
34 signed int v8; // ebx@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
35 int v9; // edx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
36 int v10; // eax@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
37 int v11; // edx@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
38 int v12; // ebx@28
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
39 int v13; // ebx@29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
40 int v14; // ebx@30
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
41 int v15; // ebx@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
42 int v16; // ebx@32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
43 signed int v17; // [sp-4h] [bp-10h]@24
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
44
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
45 auto a1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
46 v3 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
47 v4 = a1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
48 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
49 *a2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
50 if ( !a1->uItemID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
51 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
52 UpdateTempBonus(pParty->uTimePlayed);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
53 if ( v4->uItemID == 501 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
54 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
55 LABEL_45:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
56 *v3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
57 v10 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
58 v17 = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
59 return v10 % v17 + 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
60 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
61 if ( v4->uItemID == 507 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
62 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
63 *v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
64 v11 = rand() % 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
65 return v11 + 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
66 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
67 v7 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
68 if ( v4->uItemID == 510 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
69 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
70 *v3 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
71 v9 = rand() % 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
72 return v9 + 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
73 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
74 if ( v4->uItemID == 517 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
75 goto LABEL_36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
76 v8 = v4->uAdditionalValue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
77 if ( v8 > 46 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
78 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
79 LABEL_42:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
80 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
81 goto LABEL_37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
82 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
83 if ( v8 == 46 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
84 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
85 *v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
86 return rand() % 11 + 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
87 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
88 if ( v8 > 11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
89 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
90 v12 = v8 - 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
91 if ( !v12 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
92 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
93 *v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
94 return GetDiceResult(v7, 6u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
95 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
96 v13 = v12 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
97 if ( !v13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
98 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
99 *v3 = 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
100 return 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
101 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
102 v14 = v13 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
103 if ( v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
104 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
105 v15 = v14 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
106 if ( v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
107 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
108 v16 = v15 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
109 if ( !v16 || v16 == 25 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
110 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
111 *v3 = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
112 *a3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
113 return v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
114 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
115 goto LABEL_42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
116 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
117 *v3 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
118 return 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
119 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
120 LABEL_36:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
121 v5 = 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
122 LABEL_37:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
123 *v3 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
124 return v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
125 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
126 if ( v8 == 11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
127 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
128 *v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
129 v7 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
130 return GetDiceResult(v7, 6u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
131 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
132 if ( v8 == 4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
133 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
134 *v3 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
135 v11 = rand() % 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
136 return v11 + 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
137 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
138 if ( v8 == 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
139 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
140 *v3 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
141 v10 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
142 v17 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
143 return v10 % v17 + 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
144 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
145 if ( v8 == 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
146 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
147 *v3 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
148 v9 = rand() % 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
149 return v9 + 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
150 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
151 if ( v8 == 7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
152 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
153 *v3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
154 return rand() % 4 + 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
155 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
156 if ( v8 == 8 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
157 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
158 *v3 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
159 return rand() % 7 + 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
160 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
161 if ( v8 == 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
162 goto LABEL_45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
163 if ( v8 != 10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
164 goto LABEL_42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
165 *v3 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
166 v7 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
167 return GetDiceResult(v7, 6u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
168 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
169
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
170
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
171 //----- (00402F07) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
172 void ItemGen::Reset()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
173 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
174 this->field_1A = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
175 this->uAttributtes = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
176 this->uNumCharges = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
177 this->uAdditionalValue = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
178 this->_bonus_strength = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
179 this->_bonus_type = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
180 this->uItemID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
181 this->uBodyAnchor = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
182 this->uExpireTime = 0i64;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
183 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
184
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
185 //----- (00458260) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
186 void ItemGen::UpdateTempBonus(__int64 uTimePlayed)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
187 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
188 unsigned int v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
189
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
190 v2 = this->uAttributtes;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
191 if ( v2 & ITEM_TEMP_BONUS )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
192 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
193 if ( uTimePlayed > (signed __int64)this->uExpireTime )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
194 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
195 this->_bonus_type = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
196 LOBYTE(v2) = v2 & 0xF7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
197 this->uAdditionalValue = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
198 this->uAttributtes = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
199 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
200 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
201 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
202
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
203 //----- (0045814E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
204 char *ItemsTable::Release()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
205 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
206 ItemsTable *v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
207 char *result; // eax@23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
208
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
209 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
210 if ( pMonstersTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
211 pAllocator->FreeChunk(pMonstersTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
212 if ( pMonsterPlacementTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
213 pAllocator->FreeChunk(pMonsterPlacementTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
214 if ( pSkillDescTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
215 pAllocator->FreeChunk(pSkillDescTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
216 if ( v1->pSpcItemsTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
217 pAllocator->FreeChunk(v1->pSpcItemsTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
218 if ( v1->pStdItemsTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
219 pAllocator->FreeChunk(v1->pStdItemsTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
220 if ( v1->pRndItemsTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
221 pAllocator->FreeChunk(v1->pRndItemsTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
222 if ( v1->pItemsTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
223 pAllocator->FreeChunk(v1->pItemsTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
224 if ( pHostileTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
225 pAllocator->FreeChunk(pHostileTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
226 if ( pHistoryTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
227 pAllocator->FreeChunk(pHistoryTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
228 if ( pPotionsTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
229 pAllocator->FreeChunk(pPotionsTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
230 if ( pPotionNotesTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
231 pAllocator->FreeChunk(pPotionNotesTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
232 v1->pSpcItemsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
233 pSkillDescTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
234 v1->pStdItemsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
235 v1->pRndItemsTXT_Raw = pSkillDescTXT_Raw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
236 result = pSkillDescTXT_Raw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
237 v1->pItemsTXT_Raw = pSkillDescTXT_Raw;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
238 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
239 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
240
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
241
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
242 //----- (00456D84) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
243 void ItemsTable::Initialize()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
244 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
245 //ItemsTable *v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
246 char *v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
247 char *v3; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
248 char v4; // cl@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
249 int v5; // esi@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
250 char *v6; // esi@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
251 char *v7; // eax@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
252 char *v8; // ecx@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
253 char *v9; // eax@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
254 char v10; // dl@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
255 int v11; // ecx@27
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
256 int v12; // esi@31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
257 char *v13; // eax@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
258 int v14; // esi@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
259 char v15; // cl@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
260 int v16; // eax@41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
261 char v17; // zf@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
262 int v18; // eax@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
263 int *v19; // esi@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
264 char *v20; // edx@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
265 int v21; // eax@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
266 char *v22; // ecx@68
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
267 char *v23; // eax@71
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
268 int v24; // esi@71
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
269 char *v25; // ebx@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
270 char v26; // cl@73
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
271 int v27; // eax@73
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
272 char *v28; // ST3C_4@160
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
273 char *v29; // ST3C_4@163
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
274 char *v30; // eax@175
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
275 char *v31; // eax@188
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
276 char v32; // al@190
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
277 char *v33; // eax@199
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
278 const char *v34; // ebx@199
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
279 int v35; // esi@199
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
280 char *v36; // eax@200
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
281 char v37; // dl@201
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
282 int v38; // ecx@201
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
283 char *v39; // esi@229
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
284 char *v40; // eax@229
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
285 char *v41; // ecx@230
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
286 char *v42; // esi@233
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
287 char *v43; // eax@234
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
288 char v44; // dl@235
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
289 int v45; // ecx@235
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
290 signed int v46; // edi@287
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
291 char *v47; // ecx@288
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
292 char v48; // dl@289
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
293 int v49; // eax@289
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
294 int v50; // esi@293
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
295 signed int v51; // edi@312
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
296 char *v52; // ecx@312
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
297 char v53; // dl@313
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
298 int v54; // eax@313
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
299 int v55; // esi@317
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
300 signed int v56; // edi@348
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
301 char *v57; // eax@348
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
302 char v58; // dl@349
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
303 int v59; // ecx@349
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
304 int v60; // esi@353
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
305 char *Str; // [sp+Ch] [bp-18h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
306 signed int Stra; // [sp+Ch] [bp-18h]@22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
307 signed int Strb; // [sp+Ch] [bp-18h]@25
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
308 signed int Strc; // [sp+Ch] [bp-18h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
309 signed int Strd; // [sp+Ch] [bp-18h]@66
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
310 signed int Stre; // [sp+Ch] [bp-18h]@156
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
311 const char **Strf; // [sp+Ch] [bp-18h]@176
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
312 const char **Strg; // [sp+Ch] [bp-18h]@182
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
313 signed int Strh; // [sp+Ch] [bp-18h]@230
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
314 signed int Stri; // [sp+Ch] [bp-18h]@311
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
315 char **Strj; // [sp+Ch] [bp-18h]@347
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
316 int v72; // [sp+10h] [bp-14h]@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
317 signed int v73; // [sp+10h] [bp-14h]@21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
318 int v74; // [sp+10h] [bp-14h]@45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
319 int v75; // [sp+10h] [bp-14h]@77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
320 int v76; // [sp+10h] [bp-14h]@205
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
321 signed int v77; // [sp+10h] [bp-14h]@229
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
322 int v78; // [sp+10h] [bp-14h]@239
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
323 signed int v79; // [sp+14h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
324 char *v80; // [sp+14h] [bp-10h]@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
325 char *v81; // [sp+14h] [bp-10h]@175
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
326 char *v82; // [sp+14h] [bp-10h]@188
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
327 int v83; // [sp+18h] [bp-Ch]@67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
328 size_t v84; // [sp+18h] [bp-Ch]@156
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
329 signed int v85; // [sp+18h] [bp-Ch]@176
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
330 signed int v86; // [sp+18h] [bp-Ch]@182
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
331 signed int v87; // [sp+18h] [bp-Ch]@233
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
332 signed int v88; // [sp+1Ch] [bp-8h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
333 signed int v89; // [sp+1Ch] [bp-8h]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
334 signed int v90; // [sp+1Ch] [bp-8h]@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
335 signed int v91; // [sp+1Ch] [bp-8h]@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
336 signed int v92; // [sp+1Ch] [bp-8h]@200
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
337 signed int v93; // [sp+1Ch] [bp-8h]@234
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
338 signed int v94; // [sp+1Ch] [bp-8h]@288
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
339 signed int v95; // [sp+1Ch] [bp-8h]@312
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
340 signed int v96; // [sp+1Ch] [bp-8h]@348
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
341 signed int v97; // [sp+20h] [bp-4h]@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
342 signed int v98; // [sp+20h] [bp-4h]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
343 signed int v99; // [sp+20h] [bp-4h]@40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
344 signed int v100; // [sp+20h] [bp-4h]@72
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
345 signed int v101; // [sp+20h] [bp-4h]@200
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
346 signed int v102; // [sp+20h] [bp-4h]@234
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
347 signed int v103; // [sp+20h] [bp-4h]@288
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
348
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
349 //v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
350
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
351 pMapStats = new MapStats;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
352 pMapStats->Initialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
353
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
354 pMonsterStats = new MonsterStats;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
355 pMonsterStats->Initialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
356 pMonsterStats->InitializePlacements();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
357
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
358 pSpellStats = new SpellStats;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
359 pSpellStats->Initialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
360
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
361 LoadPotions();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
362 LoadPotionNotes();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
363
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
364 pFactionTable = new FactionTable;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
365 pFactionTable->Initialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
366
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
367 pStorylineText = new StorylineText;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
368 pStorylineText->Initialize();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
369
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
370 pStdItemsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
371 v2 = (char *)pEvents_LOD->LoadRaw("stditems.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
372 pStdItemsTXT_Raw = v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
373 strtok(v2, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
374 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
375 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
376 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
377 Str = (char *)&pEnchantments[0].pParam;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
378 v79 = 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
379 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
380 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
381 v3 = strtok(0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
382 v97 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
383 v88 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
384 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
385 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
386 v4 = *v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
387 v5 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
388 while ( v4 != 9 && v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
389 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
390 ++v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
391 v4 = v3[v5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
392 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
393 v72 = (int)&v3[v5];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
394 if ( !v3[v5] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
395 v88 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
396 v3[v5] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
397 if ( v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
398 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
399 if ( v97 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
400 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
401 if ( v97 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
402 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
403 *(unsigned int *)Str = (int)RemoveQuotes(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
404 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
405 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
406 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
407 if ( v97 > 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
408 Str[v97 + 6] = atoi(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
409 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
410 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
411 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
412 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
413 *((char **)Str + 1) = RemoveQuotes(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
414 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
415 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
416 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
417 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
418 if ( !v97 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
419 v88 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
420 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
421 ++v97;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
422 v3 = (char *)(v72 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
423 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
424 while ( v97 <= 10 && !v88 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
425 Str += 20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
426 --v79;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
427 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
428 while ( v79 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
429 v6 = (char *)&field_116D8[3];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
430 memset(&field_116D8[3], 0, 0x24u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
431 v7 = &pEnchantments[0].field_8[4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
432 v73 = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
433 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
434 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
435 v8 = v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
436 Stra = 24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
437 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
438 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
439 *(unsigned int *)v6 += (unsigned __int8)*v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
440 v8 += 20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
441 --Stra;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
442 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
443 while ( Stra );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
444 v6 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
445 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
446 --v73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
447 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
448 while ( v73 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
449 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
450 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
451 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
452 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
453 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
454 Strb = 17856;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
455 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
456 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
457 v9 = strtok(0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
458 v98 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
459 v89 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
460 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
461 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
462 v10 = *v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
463 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
464 while ( v10 != 9 && v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
465 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
466 ++v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
467 v10 = v9[v11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
468 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
469 v12 = (int)&v9[v11];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
470 if ( !v9[v11] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
471 v89 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
472 *(unsigned char *)v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
473 if ( v11 && v98 > 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
474 *(&pItems[0].uItemID + v98 + Strb) = atoi(v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
475 ++v98;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
476 v9 = (char *)(v12 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
477 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
478 while ( v98 < 4 && !v89 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
479 Strb += 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
480 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
481 while ( Strb < 17868 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
482 pSpcItemsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
483 v13 = (char *)pEvents_LOD->LoadRaw("spcitems.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
484 pSpcItemsTXT_Raw = v13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
485 strtok(v13, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
486 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
487 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
488 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
489 v80 = (char *)&pSpecialEnchantments[0].pParam;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
490 Strc = 72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
491 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
492 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
493 v99 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
494 v14 = (int)(strtok(0, "\r") + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
495 v90 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
496 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
497 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
498 v15 = *(unsigned char *)v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
499 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
500 while ( v15 != 9 && v15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
501 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
502 ++v16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
503 v15 = *(unsigned char *)(v16 + v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
504 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
505 v74 = v16 + v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
506 if ( !*(unsigned char *)(v16 + v14) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
507 v90 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
508 *(unsigned char *)(v16 + v14) = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
509 if ( v16 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
510 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
511 if ( v99 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
512 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
513 if ( v99 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
514 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
515 *(char **)v80 = RemoveQuotes((char *)v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
516 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
517 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
518 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
519 if ( v99 <= 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
520 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
521 v17 = v99 == 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
522 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
523 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
524 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
525 v17 = v99 == 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
526 if ( v99 < 14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
527 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
528 v80[v99 + 6] = atoi((const char *)v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
529 goto LABEL_63;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
530 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
531 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
532 if ( v17 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
533 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
534 v18 = atoi((const char *)v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
535 *((unsigned int *)v80 + 5) = v18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
536 if ( !v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
537 *((unsigned int *)v80 + 5) = atoi((const char *)(v14 + 1));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
538 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
539 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
540 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
541 if ( v99 == 15 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
542 v80[24] = tolower(*(unsigned char *)v14) - 97;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
543 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
544 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
545 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
546 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
547 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
548 *((char **)v80 + 1) = RemoveQuotes((char *)v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
549 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
550 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
551 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
552 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
553 if ( !v99 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
554 v90 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
555 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
556 LABEL_63:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
557 ++v99;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
558 v14 = v74 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
559 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
560 while ( v99 <= 15 && !v90 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
561 v80 += 28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
562 --Strc;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
563 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
564 while ( Strc );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
565 v19 = field_11738;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
566 memset(field_11738, 0, 0x60u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
567 v20 = &pSpecialEnchantments[0].field_8[4];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
568 Strd = 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
569 v21 = 71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
570 field_11798 = 71;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
571 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
572 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
573 v83 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
574 if ( v21 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
575 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
576 v22 = v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
577 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
578 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
579 *v19 += (unsigned __int8)*v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
580 ++v83;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
581 v21 = field_11798;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
582 v22 += 28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
583 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
584 while ( v83 < v21 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
585 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
586 ++v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
587 ++v20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
588 --Strd;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
589 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
590 while ( Strd );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
591 Initialize2DA();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
592 pItemsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
593 v23 = (char *)pEvents_LOD->LoadRaw("items.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
594 pItemsTXT_Raw = v23;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
595 strtok(v23, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
596 v24 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
597 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
598 pItems[0].uItemID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
599 while ( 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
600 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
601 v100 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
602 v25 = strtok(0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
603 v91 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
604 while ( 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
605 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
606 v26 = *v25;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
607 v27 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
608 while ( v26 != 9 && v26 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
609 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
610 ++v27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
611 v26 = v25[v27];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
612 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
613 v75 = (int)&v25[v27];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
614 if ( !v25[v27] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
615 v91 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
616 v25[v27] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
617 if ( v27 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
618 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
619 switch ( v100 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
620 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
621 case 0:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
622 v24 = atoi(v25);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
623 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
624 case 1:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
625 pItems[v24].pIconName = (char *)RemoveQuotes(v25);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
626 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
627 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
628 pItems[v24].pName = (char *)RemoveQuotes(v25);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
629 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
630 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
631 pItems[v24].uValue = atoi(v25);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
632 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
633 case 4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
634 if ( !_strcmpi(v25, "weapon") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
635 goto LABEL_89;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
636 if ( _strcmpi(v25, "weapon2") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
637 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
638 if ( _strcmpi(v25, "weapon1or2") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
639 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
640 if ( _strcmpi(v25, "missile") && _strcmpi(v25, "bow") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
641 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
642 if ( _strcmpi(v25, "armor") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
643 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
644 if ( _strcmpi(v25, "shield") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
645 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
646 if ( _strcmpi(v25, "helm") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
647 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
648 if ( _strcmpi(v25, "belt") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
649 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
650 if ( _strcmpi(v25, "cloak") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
651 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
652 if ( _strcmpi(v25, "gauntlets") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
653 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
654 if ( _strcmpi(v25, "boots") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
655 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
656 if ( _strcmpi(v25, "ring") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
657 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
658 if ( _strcmpi(v25, "amulet") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
659 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
660 if ( _strcmpi(v25, "weaponw") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
661 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
662 if ( _strcmpi(v25, "herb") && _strcmpi(v25, "reagent") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
663 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
664 if ( _strcmpi(v25, "bottle") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
665 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
666 if ( _strcmpi(v25, "sscroll") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
667 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
668 if ( _strcmpi(v25, "book") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
669 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
670 if ( _strcmpi(v25, "mscroll") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
671 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
672 if ( _strcmpi(v25, "gold") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
673 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
674 if ( _strcmpi(v25, "gem") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
675 pItems[v24].uEquipType = 20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
676 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
677 pItems[v24].uEquipType = 19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
678 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
679 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
680 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
681 pItems[v24].uEquipType = 18;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
682 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
683 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
684 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
685 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
686 pItems[v24].uEquipType = 17;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
687 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
688 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
689 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
690 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
691 pItems[v24].uEquipType = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
692 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
693 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
694 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
695 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
696 pItems[v24].uEquipType = 15;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
697 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
698 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
699 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
700 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
701 pItems[v24].uEquipType = 14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
702 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
703 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
704 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
705 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
706 pItems[v24].uEquipType = 13;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
707 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
708 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
709 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
710 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
711 pItems[v24].uEquipType = 12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
712 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
713 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
714 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
715 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
716 pItems[v24].uEquipType = 11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
717 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
718 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
719 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
720 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
721 pItems[v24].uEquipType = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
722 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
723 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
724 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
725 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
726 pItems[v24].uEquipType = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
727 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
728 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
729 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
730 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
731 pItems[v24].uEquipType = 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
732 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
733 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
734 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
735 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
736 pItems[v24].uEquipType = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
737 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
738 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
739 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
740 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
741 pItems[v24].uEquipType = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
742 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
743 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
744 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
745 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
746 pItems[v24].uEquipType = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
747 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
748 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
749 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
750 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
751 pItems[v24].uEquipType = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
752 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
753 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
754 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
755 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
756 pItems[v24].uEquipType = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
757 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
758 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
759 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
760 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
761 pItems[v24].uEquipType = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
762 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
763 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
764 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
765 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
766 LABEL_89:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
767 pItems[v24].uEquipType = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
768 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
769 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
770 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
771 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
772 pItems[v24].uEquipType = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
773 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
774 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
775 case 5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
776 if ( _strcmpi(v25, "staff") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
777 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
778 if ( _strcmpi(v25, "sword") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
779 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
780 if ( _strcmpi(v25, "dagger") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
781 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
782 if ( _strcmpi(v25, "axe") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
783 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
784 if ( _strcmpi(v25, "spear") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
785 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
786 if ( _strcmpi(v25, "bow") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
787 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
788 if ( _strcmpi(v25, "mace") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
789 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
790 if ( _strcmpi(v25, "blaster") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
791 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
792 if ( _strcmpi(v25, "shield") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
793 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
794 if ( _strcmpi(v25, "leather") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
795 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
796 if ( _strcmpi(v25, "chain") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
797 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
798 if ( _strcmpi(v25, "plate") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
799 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
800 if ( _strcmpi(v25, "club") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
801 pItems[v24].uSkillType = 38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
802 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
803 pItems[v24].uSkillType = 37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
804 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
805 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
806 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
807 pItems[v24].uSkillType = 11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
808 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
809 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
810 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
811 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
812 pItems[v24].uSkillType = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
813 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
814 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
815 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
816 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
817 pItems[v24].uSkillType = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
818 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
819 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
820 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
821 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
822 pItems[v24].uSkillType = 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
823 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
824 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
825 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
826 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
827 pItems[v24].uSkillType = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
828 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
829 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
830 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
831 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
832 pItems[v24].uSkillType = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
833 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
834 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
835 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
836 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
837 pItems[v24].uSkillType = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
838 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
839 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
840 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
841 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
842 pItems[v24].uSkillType = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
843 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
844 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
845 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
846 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
847 pItems[v24].uSkillType = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
848 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
849 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
850 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
851 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
852 pItems[v24].uSkillType = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
853 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
854 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
855 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
856 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
857 pItems[v24].uSkillType = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
858 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
859 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
860 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
861 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
862 pItems[v24].uSkillType = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
863 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
864 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
865 case 6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
866 Stre = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
867 v84 = strlen(v25);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
868 if ( (signed int)v84 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
869 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
870 while ( tolower((unsigned __int8)v25[Stre]) != 'd' )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
871 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
872 ++Stre;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
873 if ( Stre >= (signed int)v84 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
874 goto LABEL_161;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
875 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
876 v25[Stre] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
877 v28 = (char *)&pItems[v24];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
878 v28[34] = atoi(v25);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
879 v28[35] = atoi(&v25[Stre + 1]);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
880 v25[Stre] = 'd';
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
881 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
882 LABEL_161:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
883 if ( Stre == v84 && tolower((unsigned __int8)*v25) != 115 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
884 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
885 v29 = (char *)&pItems[v24];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
886 v29[34] = atoi(v25);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
887 v29[35] = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
888 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
889 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
890 case 7:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
891 pItems[v24].uDamageMod = atoi(v25);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
892 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
893 case 8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
894 if ( _strcmpi(v25, "artifact") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
895 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
896 if ( _strcmpi(v25, "relic") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
897 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
898 if ( _strcmpi(v25, "special") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
899 pItems[v24].uMaterial = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
900 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
901 pItems[v24].uMaterial = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
902 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
903 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
904 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
905 pItems[v24].uMaterial = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
906 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
907 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
908 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
909 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
910 pItems[v24].uMaterial = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
911 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
912 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
913 case 9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
914 BYTE2(pItems[v24 + 1].uItemID) = atoi(v25);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
915 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
916 case 10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
917 pItems[v24].pUnidentifiedName = (char *)RemoveQuotes(v25);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
918 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
919 case 11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
920 pItems[v24].uSpriteID = atoi(v25);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
921 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
922 case 12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
923 v30 = (char *)&pItems[v24];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
924 v81 = v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
925 if ( v30[37] == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
926 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
927 v85 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
928 Strf = (const char **)&pEnchantments[0].pParam;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
929 while ( _strcmpi(*Strf, v25) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
930 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
931 ++v85;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
932 Strf += 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
933 if ( v85 >= 24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
934 goto LABEL_181;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
935 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
936 v81[39] = v85 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
937 LABEL_181:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
938 if ( !v81[39] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
939 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
940 v86 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
941 Strg = (const char **)&pSpecialEnchantments[0].pParam;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
942 while ( _strcmpi(*Strg, v25) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
943 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
944 ++v86;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
945 Strg += 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
946 if ( v86 >= 72 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
947 goto LABEL_196;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
948 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
949 v81[38] = v86 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
950 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
951 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
952 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
953 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
954 v30[38] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
955 v30[39] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
956 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
957 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
958 case 13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
959 v31 = (char *)&pItems[v24];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
960 v82 = v31;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
961 if ( v31[37] == 3 && v31[39] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
962 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
963 v32 = atoi(v25);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
964 v82[40] = v32;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
965 if ( !v32 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
966 v82[40] = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
967 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
968 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
969 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
970 v31[40] = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
971 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
972 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
973 case 14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
974 pItems[v24].uEquipX = atoi(v25);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
975 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
976 case 15:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
977 pItems[v24].uEquipY = atoi(v25);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
978 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
979 case 16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
980 pItems[v24].pDescription = (char *)RemoveQuotes(v25);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
981 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
982 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
983 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
984 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
985 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
986 LABEL_196:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
987 ++v100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
988 v25 = (char *)(v75 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
989 if ( v100 <= 16 && !v91 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
990 continue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
991 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
992 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
993 ++v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
994 if ( v24 < 800 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
995 continue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
996 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
997 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
998 pRndItemsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
999 pItems[0].uItemID = v24;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1000 v33 = (char *)pEvents_LOD->LoadRaw("rnditems.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1001 v34 = "\r";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1002 pRndItemsTXT_Raw = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1003 strtok(v33, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1004 v35 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1005 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1006 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1007 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1008 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1009 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1010 v101 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1011 v36 = strtok(0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1012 v92 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1013 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1014 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1015 v37 = *v36;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1016 v38 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1017 while ( v37 != 9 && v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1018 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1019 ++v38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1020 v37 = v36[v38];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1021 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1022 v76 = (int)&v36[v38];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1023 if ( !v36[v38] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1024 v92 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1025 *(unsigned char *)v76 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1026 if ( v38 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1027 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1028 if ( v101 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1029 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1030 switch ( v101 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1031 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1032 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1033 pItems[v35].field_2C = atoi(v36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1034 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1035 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1036 pItems[v35].field_2D = atoi(v36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1037 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1038 case 4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1039 pItems[v35].field_2E = atoi(v36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1040 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1041 case 5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1042 pItems[v35].field_2F = atoi(v36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1043 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1044 case 6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1045 *((unsigned char *)&pItems[0].uItemID + 16 * (3 * v35 + 3)) = atoi(v36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1046 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1047 case 7:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1048 BYTE1(pItems[v35 + 1].uItemID) = atoi(v36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1049 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1050 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1051 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1052 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1053 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1054 v35 = atoi(v36);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1055 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1056 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1057 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1058 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1059 if ( !v101 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1060 v92 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1061 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1062 ++v101;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1063 v36 = (char *)(v76 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1064 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1065 while ( v101 <= 7 && !v92 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1066 ++v35;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1067 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1068 while ( v35 < 619 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1069 if ( pRndItemsTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1070 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1071 pAllocator->FreeChunk(pRndItemsTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1072 pRndItemsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1073 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1074 v39 = (char *)field_11684;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1075 memset(field_11684, 0, 0x18u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1076 v40 = &pItems[0].field_2C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1077 v77 = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1078 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1079 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1080 v41 = v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1081 Strh = 800;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1082 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1083 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1084 *(unsigned int *)v39 += (unsigned __int8)*v41;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1085 v41 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1086 --Strh;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1087 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1088 while ( Strh );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1089 v39 += 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1090 ++v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1091 --v77;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1092 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1093 while ( v77 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1094 v42 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1095 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1096 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1097 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1098 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1099 strtok(0, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1100 v87 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1101 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1102 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1103 v43 = strtok(v42, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1104 v102 = (signed int)v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1105 v93 = (signed int)v42;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1106 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1107 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1108 v44 = *v43;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1109 v45 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1110 while ( v44 != 9 && v44 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1111 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1112 ++v45;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1113 v44 = v43[v45];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1114 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1115 v78 = (int)&v43[v45];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1116 if ( !v43[v45] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1117 v93 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1118 v42 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1119 *(unsigned char *)v78 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1120 if ( v45 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1121 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1122 switch ( v102 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1123 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1124 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1125 if ( v87 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1126 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1127 if ( v87 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1128 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1129 *(unsigned int *)&field_1169C[24] = atoi(v43);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1130 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1131 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1132 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1133 if ( v87 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1134 *(unsigned int *)&field_1169C[48] = atoi(v43);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1135 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1136 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1137 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1138 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1139 *(unsigned int *)&field_1169C[0] = atoi(v43);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1140 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1141 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1142 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1143 if ( v87 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1144 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1145 if ( v87 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1146 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1147 *(unsigned int *)&field_1169C[28] = atoi(v43);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1148 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1149 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1150 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1151 if ( v87 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1152 *(unsigned int *)&field_1169C[52] = atoi(v43);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1153 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1154 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1155 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1156 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1157 *(unsigned int *)&field_1169C[4] = atoi(v43);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1158 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1159 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1160 case 4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1161 if ( v87 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1162 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1163 if ( v87 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1164 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1165 *(unsigned int *)&field_1169C[32] = atoi(v43);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1166 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1167 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1168 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1169 if ( v87 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1170 *(unsigned int *)&field_1169C[56] = atoi(v43);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1171 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1172 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1173 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1174 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1175 *(unsigned int *)&field_1169C[8] = atoi(v43);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1176 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1177 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1178 case 5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1179 if ( v87 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1180 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1181 if ( v87 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1182 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1183 *(unsigned int *)&field_1169C[36] = atoi(v43);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1184 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1185 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1186 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1187 if ( v87 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1188 field_116D8[0] = atoi(v43);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1189 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1190 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1191 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1192 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1193 *(unsigned int *)&field_1169C[12] = atoi(v43);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1194 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1195 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1196 case 6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1197 if ( v87 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1198 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1199 if ( v87 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1200 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1201 *(unsigned int *)&field_1169C[40] = atoi(v43);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1202 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1203 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1204 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1205 if ( v87 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1206 field_116D8[1] = atoi(v43);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1207 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1208 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1209 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1210 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1211 *(unsigned int *)&field_1169C[16] = atoi(v43);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1212 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1213 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1214 case 7:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1215 if ( v87 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1216 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1217 if ( v87 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1218 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1219 *(unsigned int *)&field_1169C[44] = atoi(v43);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1220 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1221 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1222 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1223 if ( v87 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1224 field_116D8[2] = atoi(v43);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1225 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1226 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1227 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1228 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1229 *(unsigned int *)&field_1169C[20] = atoi(v43);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1230 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1231 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1232 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1233 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1234 ++v102;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1235 v43 = (char *)(v78 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1236 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1237 while ( v102 <= 7 && !v93 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1238 ++v87;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1239 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1240 while ( v87 < 3 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1241 pSkillDescTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1242 pSkillDescTXT_Raw = (char *)pEvents_LOD->LoadRaw("skilldes.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1243 strtok(pSkillDescTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1244 v46 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1245 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1246 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1247 v103 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1248 v94 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1249 v47 = strtok(0, "\r") + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1250 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1251 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1252 v48 = *v47;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1253 v49 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1254 while ( v48 != 9 && v48 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1255 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1256 ++v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1257 v48 = v47[v49];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1258 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1259 v50 = (int)&v47[v49];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1260 if ( !v47[v49] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1261 v94 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1262 *(unsigned char *)v50 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1263 if ( v49 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1264 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1265 switch ( v103 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1266 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1267 case 1:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1268 pSkillDesc[v46] = (char *)RemoveQuotes(v47);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1269 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1270 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1271 pNormalSkillDesc[v46] = (char *)RemoveQuotes(v47);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1272 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1273 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1274 pExpertSkillDesc[v46] = (char *)RemoveQuotes(v47);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1275 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1276 case 4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1277 pMasterSkillDesc[v46] = (char *)RemoveQuotes(v47);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1278 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1279 case 5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1280 pGrandSkillDesc[v46] = (char *)RemoveQuotes(v47);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1281 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1282 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1283 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1284 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1285 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1286 if ( !v103 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1287 v94 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1288 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1289 ++v103;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1290 v47 = (char *)(v50 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1291 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1292 while ( v103 <= 5 && !v94 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1293 ++v46;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1294 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1295 while ( v46 < 37 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1296 pStatsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1297 pStatsTXT_Raw = (char *)pEvents_LOD->LoadRaw("stats.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1298 strtok(pStatsTXT_Raw, "\r");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1299 Stri = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1300 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1301 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1302 v51 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1303 v95 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1304 v52 = strtok(0, v34) + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1305 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1306 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1307 v53 = *v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1308 v54 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1309 if ( *v52 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1310 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1311 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1312 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1313 if ( !v53 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1314 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1315 ++v54;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1316 v53 = v52[v54];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1317 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1318 while ( v53 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1319 v34 = "\r";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1320 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1321 v55 = (int)&v52[v54];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1322 if ( !v52[v54] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1323 v95 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1324 *(unsigned char *)v55 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1325 if ( v54 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1326 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1327 if ( v51 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1328 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1329 switch ( Stri )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1330 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1331 case 0:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1332 case 1:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1333 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1334 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1335 case 4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1336 case 5:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1337 case 6:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1338 pAttributeDescriptions[Stri] = (char *)RemoveQuotes(v52);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1339 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1340 case 7:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1341 pHealthPointsAttributeDescription = (char *)RemoveQuotes(v52);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1342 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1343 case 8:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1344 pArmourClassAttributeDescription = (char *)RemoveQuotes(v52);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1345 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1346 case 9:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1347 pSpellPointsAttributeDescription = (char *)RemoveQuotes(v52);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1348 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1349 case 10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1350 pPlayerConditionAttributeDescription = (char *)RemoveQuotes(v52);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1351 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1352 case 11:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1353 pFastSpellAttributeDescription = (char *)RemoveQuotes(v52);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1354 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1355 case 12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1356 pPlayerAgeAttributeDescription = (char *)RemoveQuotes(v52);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1357 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1358 case 13:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1359 pPlayerLevelAttributeDescription = (char *)RemoveQuotes(v52);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1360 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1361 case 14:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1362 pPlayerExperienceAttributeDescription = (char *)RemoveQuotes(v52);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1363 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1364 case 15:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1365 pAttackBonusAttributeDescription = (char *)RemoveQuotes(v52);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1366 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1367 case 16:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1368 pAttackDamageAttributeDescription = (char *)RemoveQuotes(v52);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1369 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1370 case 17:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1371 pMissleBonusAttributeDescription = (char *)RemoveQuotes(v52);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1372 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1373 case 18:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1374 pMissleDamageAttributeDescription = (char *)RemoveQuotes(v52);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1375 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1376 case 19:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1377 pFireResistanceAttributeDescription = (char *)RemoveQuotes(v52);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1378 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1379 case 20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1380 pAirResistanceAttributeDescription = (char *)RemoveQuotes(v52);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1381 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1382 case 21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1383 pWaterResistanceAttributeDescription = (char *)RemoveQuotes(v52);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1384 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1385 case 22:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1386 pEarthResistanceAttributeDescription = (char *)RemoveQuotes(v52);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1387 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1388 case 23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1389 pMindResistanceAttributeDescription = (char *)RemoveQuotes(v52);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1390 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1391 case 24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1392 pBodyResistanceAttributeDescription = (char *)RemoveQuotes(v52);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1393 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1394 case 25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1395 pSkillPointsAttributeDescription = (char *)RemoveQuotes(v52);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1396 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1397 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1398 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1399 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1400 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1401 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1402 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1403 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1404 if ( !v51 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1405 v95 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1406 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1407 ++v51;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1408 v52 = (char *)(v55 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1409 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1410 while ( v51 < 2 && !v95 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1411 ++Stri;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1412 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1413 while ( Stri < 26 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1414 pClassTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1415 pClassTXT_Raw = (char *)pEvents_LOD->LoadRaw("class.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1416 strtok(pClassTXT_Raw, v34);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1417 Strj = pClassDescriptions;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1418 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1419 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1420 v56 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1421 v57 = strtok(0, v34) + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1422 v96 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1423 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1424 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1425 v58 = *v57;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1426 v59 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1427 if ( *v57 != 9 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1428 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1429 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1430 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1431 if ( !v58 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1432 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1433 ++v59;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1434 v58 = v57[v59];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1435 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1436 while ( v58 != 9 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1437 v34 = "\r";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1438 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1439 v60 = (int)&v57[v59];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1440 if ( !v57[v59] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1441 v96 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1442 *(unsigned char *)v60 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1443 if ( v59 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1444 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1445 if ( v56 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1446 *Strj = (char *)RemoveQuotes(v57);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1447 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1448 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1449 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1450 if ( !v56 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1451 v96 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1452 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1453 ++v56;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1454 v57 = (char *)(v60 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1455 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1456 while ( v56 < 2 && !v96 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1457 ++Strj;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1458 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1459 while ( (signed int)Strj <= (signed int)&pClassDescriptions[35] );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1460 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1461
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1462 //----- (00456D17) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1463 void ItemsTable::SetSpecialBonus(ItemGen *pItem)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1464 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1465 ItemDesc *v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1466
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1467 v2 = &this->pItems[pItem->uItemID];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1468 if ( v2->uMaterial == 3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1469 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1470 pItem->_bonus_type = v2->_bonus_type;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1471 pItem->uAdditionalValue = v2->_additional_value;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1472 pItem->_bonus_strength = v2->_bonus_strength;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1473 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1474 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1475
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1476 //----- (00456D43) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1477 bool ItemsTable::_456D43_is_material_equals_3(ItemGen *pItem)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1478 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1479 return this->pItems[pItem->uItemID].uMaterial == 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1480 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1481
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1482 //----- (00456D5E) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1483 bool ItemsTable::_456D5E_is_some_material(ItemGen *pItem)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1484 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1485 unsigned __int8 v2; // al@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1486
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1487 v2 = this->pItems[pItem->uItemID].uMaterial;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1488 return v2 == 3 || v2 == 1 || v2 == 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1489 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1490
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1491
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1492 //----- (00453B3C) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1493 void ItemsTable::LoadPotions()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1494 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1495 char *i; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1496 signed int v2; // esi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1497 char *v3; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1498 char *v4; // edi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1499 __int16 v5; // ax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1500 char *v6; // esi@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1501 CHAR Text; // [sp+Ch] [bp-6Ch]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1502 ItemsTable *v8; // [sp+68h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1503 int v9; // [sp+6Ch] [bp-Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1504 int v10; // [sp+70h] [bp-8h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1505 char *v11; // [sp+74h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1506
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1507 v8 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1508 if ( pPotionsTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1509 pAllocator->FreeChunk(pPotionsTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1510 pPotionsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1511 pPotionsTXT_Raw = (char *)pEvents_LOD->LoadRaw("potion.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1512 for ( i = strtok(pPotionsTXT_Raw, "\t\r\n"); ; i = strtok(0, "\t\r\n") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1513 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1514 v11 = i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1515 if ( !strcmp(i, "222") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1516 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1517 if ( !v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1518 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1519 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1520 MessageBoxA(0, "Error Pre-Parsing Potion Table", "Load Error", 0x10u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1521 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1522 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1523 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1524 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1525 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1526 v11 = strtok(0, "\t\r\n");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1527 if ( !strcmp(v11, "222") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1528 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1529 if ( !v11 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1530 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1531 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1532 v9 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1533 v10 = 30642;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1534 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1535 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1536 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1537 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1538 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1539 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1540 if ( !strtok(0, "\r\t\n") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1541 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1542 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1543 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1544 while ( v2 < 6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1545 if ( v2 != 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1546 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1547 v11 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1548 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1549 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1550 v3 = strtok(0, "\r\t\n");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1551 v4 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1552 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1553 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1554 v5 = atoi(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1555 v6 = (char *)v8 + 2 * (uint)&v11[v10];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1556 *(_WORD *)v6 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1557 if ( !v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1558 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1559 if ( tolower((unsigned __int8)*v4) == 101 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1560 *(_WORD *)v6 = atoi(v4 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1561 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1562 *(_WORD *)v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1563 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1564 ++v11;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1565 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1566 while ( (signed int)v11 < 50 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1567 if ( v11 != (char *)50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1568 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1569 strtok(0, "\r\t\n");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1570 v10 += 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1571 ++v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1572 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1573 while ( v10 < 33142 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1574 if ( v9 != 50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1575 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1576 wsprintfA(&Text, "Error Parsing Potion Table at Row: %d Column: %d", v9, v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1577 MessageBoxA(0, &Text, "Parsing Error", 0x10u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1578 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1579 if ( pPotionsTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1580 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1581 pAllocator->FreeChunk(pPotionsTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1582 pPotionsTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1583 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1584 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1585
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1586 //----- (00453CE5) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1587 void ItemsTable::LoadPotionNotes()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1588 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1589 char *i; // eax@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1590 signed int v2; // esi@11
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1591 char *v3; // eax@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1592 char *v4; // edi@16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1593 __int16 v5; // ax@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1594 char *v6; // esi@17
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1595 CHAR *v7; // [sp-Ch] [bp-84h]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1596 const CHAR *v8; // [sp-8h] [bp-80h]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1597 UINT v9; // [sp-4h] [bp-7Ch]@20
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1598 CHAR Text; // [sp+Ch] [bp-6Ch]@26
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1599 ItemsTable *v11; // [sp+68h] [bp-10h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1600 int v12; // [sp+6Ch] [bp-Ch]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1601 int v13; // [sp+70h] [bp-8h]@10
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1602 char *v14; // [sp+74h] [bp-4h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1603
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1604 v11 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1605 if ( pPotionNotesTXT_Raw )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1606 pAllocator->FreeChunk(pPotionNotesTXT_Raw);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1607 pPotionNotesTXT_Raw = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1608 pPotionNotesTXT_Raw = (char *)pEvents_LOD->LoadRaw("potnotes.txt", 0);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1609 for ( i = strtok(pPotionNotesTXT_Raw, "\t\r\n"); ; i = strtok(0, "\t\r\n") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1610 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1611 v14 = i;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1612 if ( !strcmp(i, "222") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1613 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1614 if ( !v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1615 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1616 LABEL_20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1617 v9 = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1618 v8 = "Load Error";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1619 v7 = "Error Pre-Parsing Potion Table";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1620 LABEL_27:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1621 MessageBoxA(0, v7, v8, v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1622 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1623 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1624 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1625 while ( 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1626 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1627 v14 = strtok(0, "\t\r\n");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1628 if ( !strcmp(v14, "222") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1629 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1630 if ( !v14 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1631 goto LABEL_20;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1632 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1633 v12 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1634 v13 = 33142;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1635 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1636 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1637 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1638 v2 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1639 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1640 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1641 if ( !strtok(0, "\r\t\n") )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1642 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1643 ++v2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1644 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1645 while ( v2 < 6 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1646 if ( v2 != 6 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1647 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1648 v14 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1649 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1650 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1651 v3 = strtok(0, "\r\t\n");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1652 v4 = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1653 if ( !v3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1654 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1655 v5 = atoi(v3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1656 v6 = (char *)v11 + 2 * (unsigned int)&v14[v13];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1657 *(unsigned short *)v6 = v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1658 if ( !v5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1659 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1660 if ( tolower((unsigned __int8)*v4) == 101 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1661 *(unsigned short *)v6 = atoi(v4 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1662 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1663 *(unsigned short *)v6 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1664 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1665 ++v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1666 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1667 while ( (signed int)v14 < 50 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1668 if ( v14 != (char *)50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1669 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1670 strtok(0, "\r\t\n");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1671 v13 += 50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1672 ++v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1673 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1674 while ( v13 < 35642 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1675 if ( v12 != 50 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1676 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1677 wsprintfA(&Text, "Error Parsing Potion Autonote Table at Row: %d Column: %d", v12, v14);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1678 v9 = 16;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1679 v8 = "Parsing Error";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1680 v7 = &Text;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1681 goto LABEL_27;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1682 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1683 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1684
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1685
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1686 //----- (00456442) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1687 unsigned int ItemGen::GetValue()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1688 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1689 ItemGen *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1690 unsigned int uBaseValue; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1691 int v3; // eax@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1692 int v4; // esi@5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1693 unsigned int result; // eax@7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1694
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1695 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1696 uBaseValue = pItemsTable->pItems[this->uItemID].uValue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1697 if ( this->uAttributtes & ITEM_TEMP_BONUS || pItemsTable->_456D5E_is_some_material(this) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1698 goto LABEL_12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1699 if ( v1->_bonus_type )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1700 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1701 v3 = 100 * v1->_bonus_strength;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1702 return uBaseValue + v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1703 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1704 v4 = v1->uAdditionalValue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1705 if ( !v4 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1706 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1707 LABEL_12:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1708 result = uBaseValue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1709 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1710 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1711 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1712 v3 = *(unsigned int *)&pItemsTable->pEnchantments[23].field_8[28 * v4 + 8];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1713 if ( (unsigned int)v3 > 0xA )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1714 return uBaseValue + v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1715 result = uBaseValue * v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1716 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1717 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1718 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1719
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1720 //----- (00456499) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1721 const char *ItemGen::GetDisplayName()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1722 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1723 const char *result; // eax@2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1724
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1725 if ( this->uAttributtes & ITEM_IDENTIFIED )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1726 result = GetIdentifiedName();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1727 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1728 result = pItemsTable->pItems[uItemID].pUnidentifiedName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1729 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1730 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1731
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1732 //----- (004564B3) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1733 const char *ItemGen::GetIdentifiedName()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1734 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1735 ItemGen *v1; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1736 unsigned int v2; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1737 unsigned __int8 v3; // cl@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1738 char *v4; // edi@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1739 char v5; // al@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1740 const char *v6; // esi@8
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1741 int v7; // eax@15
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1742 const char *v9; // [sp-Ch] [bp-14h]@14
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1743 const char *v10; // [sp-8h] [bp-10h]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1744 char *v11; // [sp-4h] [bp-Ch]@4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1745
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1746 v1 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1747 v2 = this->uItemID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1748 v3 = pItemsTable->pItems[v2].uEquipType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1749 if ( v3 >= EQUIP_REAGENT && (v3 <= EQUIP_POTION || v3 == EQUIP_GOLD) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1750 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1751 v11 = pItemsTable->pItems[v2].pName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1752 v4 = item__getname_buffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1753 v10 = "%s";
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1754 LABEL_10:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1755 sprintfex(v4, v10, v11);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1756 return v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1757 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1758 v4 = item__getname_buffer;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1759 sprintfex(item__getname_buffer, "%s", pItemsTable->pItems[v2].pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1760 if ( v1->uItemID == 601 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1761 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1762 v5 = v1->field_1A;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1763 if ( (unsigned __int8)v5 >= 1u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1764 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1765 if ( (unsigned __int8)v5 <= 4u )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1766 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1767 v6 = pPlayers[(unsigned __int8)v5]->pName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1768 strlen(pPlayers[(unsigned __int8)v5]->pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1769 v11 = (char *)v6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1770 if ( v6[strlen(v6) - 1] == 115 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1771 v10 = pGlobalTXT_LocalizationStrings[655];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1772 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1773 v10 = pGlobalTXT_LocalizationStrings[654];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1774 goto LABEL_10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1775 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1776 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1777 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1778 if ( !pItemsTable->_456D5E_is_some_material(v1) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1779 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1780 if ( v1->_bonus_type )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1781 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1782 strcat(item__getname_buffer, " ");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1783 v9 = (const char *)*((unsigned int *)&pItemsTable->pItems[799].uEquipType + 5 * v1->_bonus_type);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1784 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1785 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1786 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1787 v7 = v1->uAdditionalValue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1788 if ( !v7 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1789 return v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1790 if ( v7 == 16
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1791 || v7 == 39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1792 || v7 == 40
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1793 || v7 == 45
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1794 || v7 == 56
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1795 || v7 == 57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1796 || v7 == 58
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1797 || v7 == 60
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1798 || v7 == 61
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1799 || v7 == 59
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1800 || v7 == 63
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1801 || v7 == 64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1802 || v7 == 67
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1803 || v7 == 68 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1804 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1805 sprintfex(
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1806 item__getname_buffer,
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1807 "%s %s",
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1808 *(unsigned int *)&pItemsTable->pEnchantments[22].field_8[28 * v7 + 8],
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1809 pItemsTable->pItems[v1->uItemID].pName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1810 return v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1811 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1812 strcat(item__getname_buffer, " ");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1813 v9 = *(const char **)&pItemsTable->pEnchantments[22].field_8[28 * v1->uAdditionalValue + 8];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1814 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1815 strcat(item__getname_buffer, v9);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1816 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1817 return v4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1818 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1819
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1820
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1821 //----- (00456620) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1822 void ItemsTable::GenerateItem(int a2, int a3, ItemGen *pItem)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1823 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1824 ItemGen *v4; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1825 ItemsTable *v5; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1826 int v6; // ebx@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1827 int *v7; // ecx@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1828 int v8; // eax@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1829 int v9; // eax@39
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1830 int v10; // ebx@43
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1831 int v11; // ecx@47
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1832 unsigned int *v12; // edx@48
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1833 unsigned int v13; // eax@49
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1834 signed int v14; // ebx@52
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1835 int v15; // eax@53
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1836 signed int v16; // eax@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1837 int v17; // ebx@57
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1838 int v18; // edx@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1839 signed int v19; // ebx@70
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1840 unsigned __int8 v20; // al@81
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1841 int v21; // eax@84
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1842 int v22; // ebx@85
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1843 int v23; // eax@86
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1844 int v24; // ebx@86
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1845 int v25; // edx@86
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1846 int v26; // edx@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1847 unsigned int v27; // eax@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1848 int i; // ebx@89
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1849 unsigned int v29; // ecx@90
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1850 int v30; // ebx@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1851 int v31; // eax@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1852 int v32; // ecx@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1853 int v33; // eax@91
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1854 int v34; // eax@97
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1855 unsigned __int8 v35; // sf@97
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1856 unsigned __int8 v36; // of@97
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1857 int v37; // ebx@98
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1858 int v38; // edx@99
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1859 signed int v39; // ebx@101
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1860 int v40; // ecx@102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1861 char v41; // zf@107
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1862 char v42; // al@108
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1863 char v43; // al@111
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1864 int *v44; // edx@118
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1865 int v45; // eax@120
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1866 int v46; // edx@120
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1867 int *j; // eax@121
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1868 unsigned int v48; // ecx@123
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1869 int v49; // eax@123
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1870 int v50; // eax@123
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1871 unsigned int Dst; // [sp+Ch] [bp-C88h]@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1872 int v52; // [sp+C8Ch] [bp-8h]@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1873 int v53; // [sp+C90h] [bp-4h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1874 int v54; // [sp+C9Ch] [bp+8h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1875 int v55; // [sp+CA0h] [bp+Ch]@34
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1876 signed int v56; // [sp+CA0h] [bp+Ch]@55
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1877 int v57; // [sp+CA0h] [bp+Ch]@62
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1878 int *v58; // [sp+CA0h] [bp+Ch]@102
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1879 int v59; // [sp+CA0h] [bp+Ch]@123
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1880 signed int a2a; // [sp+CA4h] [bp+10h]@33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1881 int a2b; // [sp+CA4h] [bp+10h]@101
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1882 int a2c; // [sp+CA4h] [bp+10h]@120
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1883
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1884 v53 = -1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1885 v4 = pItem;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1886 v5 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1887 if ( !pItem )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1888 v4 = (ItemGen *)pAllocator->AllocNamedChunk(pItem, 0x24u, "newItemGen");
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1889 memset(v4, 0, 0x24u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1890 v6 = a2 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1891 v54 = a2 - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1892 if ( a3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1893 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1894 switch ( a3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1895 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1896 case 20:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1897 a3 = EQUIP_ONE_OR_TWO_HANDS;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1898 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1899 case 21:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1900 a3 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1901 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1902 case 22:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1903 v53 = 38;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1904 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1905 case 23:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1906 v53 = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1907 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1908 case 24:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1909 v53 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1910 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1911 case 25:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1912 v53 = 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1913 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1914 case 26:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1915 v53 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1916 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1917 case 27:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1918 v53 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1919 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1920 case 28:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1921 v53 = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1922 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1923 case 30:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1924 v53 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1925 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1926 case 31:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1927 v53 = 9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1928 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1929 case 32:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1930 v53 = 10;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1931 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1932 case 33:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1933 v53 = 0xBu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1934 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1935 case 34:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1936 a3 = 4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1937 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1938 case 35:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1939 a3 = 5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1940 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1941 case 36:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1942 a3 = 6;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1943 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1944 case 37:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1945 a3 = 7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1946 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1947 case 38:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1948 a3 = 8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1949 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1950 case 39:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1951 a3 = EQUIP_BOOTS;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1952 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1953 case 40:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1954 a3 = EQUIP_RING;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1955 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1956 case 41:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1957 a3 = 0xBu;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1958 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1959 case 42:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1960 a3 = EQUIP_C;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1961 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1962 case 43:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1963 a3 = EQUIP_F;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1964 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1965 case 44:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1966 a3 = EQUIP_POTION;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1967 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1968 case 45:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1969 a3 = EQUIP_REAGENT;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1970 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1971 case 46:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1972 a3 = EQUIP_GEM;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1973 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1974 case 29:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1975 v53 = 37;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1976 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1977 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1978 --a3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1979 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1980 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1981 memset(&Dst, 0, 0xC80u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1982 v52 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1983 v7 = (int *)&Dst;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1984 a2a = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1985 if ( v53 == -1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1986 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1987 v53 = (int)&v5->pItems[1].uEquipType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1988 v9 = (int)(&v5->pItems[1].field_2C + v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1989 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1990 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1991 if ( *(unsigned char *)v53 == a3 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1992 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1993 *v7 = a2a;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1994 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1995 v52 += *(unsigned char *)v9;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1996 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1997 ++a2a;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1998 v53 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1999 v9 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2000 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2001 while ( a2a < 500 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2002 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2003 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2004 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2005 v55 = (int)&v5->pItems[1].uSkillType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2006 v8 = (int)(&v5->pItems[1].field_2C + v6);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2007 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2008 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2009 if ( *(unsigned char *)v55 == v53 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2010 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2011 *v7 = a2a;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2012 ++v7;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2013 v52 += *(unsigned char *)v8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2014 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2015 ++a2a;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2016 v55 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2017 v8 += 48;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2018 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2019 while ( a2a < 500 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2020 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2021 v10 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2022 if ( v52 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2023 v10 = rand() % v52;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2024 v4->uItemID = Dst;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2025 if ( !Dst )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2026 v4->uItemID = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2027 v11 = *(&v5->pItems[v4->uItemID].field_2C + v54);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2028 if ( v11 < v10 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2029 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2030 v12 = &Dst;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2031 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2032 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2033 ++v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2034 v13 = *v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2035 v4->uItemID = *v12;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2036 v11 += *(&v5->pItems[v13].field_2C + v54);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2037 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2038 while ( v11 < v10 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2039 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2040 if ( v5->pItems[v4->uItemID].uEquipType == EQUIP_POTION && v4->uItemID != ITEM_POTION_BOTTLE )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2041 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2042 v4->_bonus_type = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2043 v14 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2044 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2045 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2046 v4->_bonus_type += rand() % 4 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2047 v15 = v4->_bonus_type;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2048 --v14;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2049 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2050 while ( v14 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2051 LABEL_72:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2052 v4->_bonus_type = v15 * (v54 + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2053 goto LABEL_73;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2054 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2055 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2056 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2057 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2058 v16 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2059 v56 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2060 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2061 v56 += pParty->field_7BA[v16++];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2062 while ( v16 < 29 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2063 v17 = rand() % 29;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2064 if ( v54 == 5 && rand() % 100 < 5 && !pParty->field_7BA[v17] && v56 < 13 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2065 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2066 pParty->field_7BA[v17] = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2067 v4->uAttributtes = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2068 v4->uItemID = v17 + 500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2069 v5->SetSpecialBonus(v4);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2070 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2071 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2072 v57 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2073 v18 = rand() % v5->field_11684[v54];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2074 v4->uItemID = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2075 if ( v18 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2076 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2077 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2078 v57 += *(&v5->pItems[v4->uItemID++ + 1].field_2C + v54);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2079 while ( v57 < v18 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2080 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2081 if ( !v18 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2082 v4->uItemID = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2083 if ( !v4->uItemID )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2084 v4->uItemID = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2085 if ( v5->pItems[v4->uItemID].uEquipType == EQUIP_POTION && v4->uItemID != ITEM_POTION_BOTTLE )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2086 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2087 v4->_bonus_type = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2088 v19 = 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2089 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2090 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2091 v4->_bonus_type += rand() % 4 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2092 v15 = v4->_bonus_type;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2093 --v19;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2094 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2095 while ( v19 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2096 goto LABEL_72;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2097 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2098 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2099 LABEL_73:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2100 if ( v4->uItemID == ITEM_SPELLBOOK_LIGHT_DIVINE_INTERVENTION
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2101 && !(unsigned __int16)_449B57_test_bit(pParty->_award_bits, 239) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2102 v4->uItemID = ITEM_SPELLBOOK_LIGHT_SUN_BURST;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2103 if ( BYTE2(pItemsTable->pItems[v4->uItemID + 1].uItemID) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2104 v4->uAttributtes = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2105 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2106 v4->uAttributtes = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2107 if ( v5->pItems[v4->uItemID].uEquipType != EQUIP_POTION )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2108 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2109 v4->uAdditionalValue = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2110 v4->_bonus_type = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2111 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2112 v20 = v5->pItems[v4->uItemID].uEquipType;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2113 if ( v20 <= EQUIP_BOW )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2114 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2115 v37 = (int)&v5->field_1169C[4 * v54 + 48];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2116 if ( !*(unsigned int *)v37 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2117 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2118 v38 = rand() % 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2119 v36 = __OFSUB__(v38, *(unsigned int *)v37);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2120 v35 = v38 - *(unsigned int *)v37 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2121 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2122 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2123 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2124 if ( v20 > EQUIP_AMULET )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2125 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2126 if ( v20 == EQUIP_C )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2127 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2128 v21 = rand() % 6 + pItemsTable->pItems[v4->uItemID].uDamageMod + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2129 v4->uNumCharges = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2130 v4->uMaxCharges = v21;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2131 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2132 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2133 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2134 v22 = (int)&v5->field_1169C[4 * v54];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2135 if ( !*(unsigned int *)v22 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2136 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2137 v23 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2138 v24 = *(unsigned int *)v22;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2139 v25 = v23 % 100;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2140 if ( v23 % 100 < v24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2141 goto LABEL_127;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2142 if ( !*(unsigned int *)&v5->field_1169C[4 * v54 + 24] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2143 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2144 if ( v25 < v24 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2145 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2146 LABEL_127:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2147 v26 = rand() % v5->field_116D8[v5->pItems[v4->uItemID].uEquipType];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2148 v27 = v4->uItemID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2149 v4->_bonus_type = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2150 for ( i = v5->pEnchantments[0].field_8[v5->pItems[v27].uEquipType + 1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2151 i < v26;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2152 i += v5->pEnchantments[v4->_bonus_type].field_8[v5->pItems[v29].uEquipType + 1] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2153 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2154 v29 = v4->uItemID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2155 ++v4->_bonus_type;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2156 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2157 ++v4->_bonus_type;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2158 v30 = v5->field_116D8[2 * v54 + 12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2159 v31 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2160 v32 = v4->_bonus_type - 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2161 v33 = v31 % (v5->field_116D8[2 * v54 + 13] - v30 + 1) + v30;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2162 v4->_bonus_strength = v33;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2163 if ( v32 == 21 || v32 == 22 || v32 == 23 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2164 v4->_bonus_strength = v33 >> 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2165 if ( v4->_bonus_strength <= 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2166 v4->_bonus_strength = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2167 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2168 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2169 v34 = v24 + *(unsigned int *)&v5->field_1169C[4 * v54 + 24];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2170 v36 = __OFSUB__(v25, v34);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2171 v35 = v25 - v34 < 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2172 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2173 if ( !(v35 ^ v36) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2174 return;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2175 memset(&Dst, 0, 0xC80u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2176 v39 = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2177 a2b = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2178 if ( v5->field_11798 > 0 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2179 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2180 v52 = -16 - (uint)v5;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2181 v58 = (int *)&Dst;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2182 v40 = (int)&v5->pSpecialEnchantments[1];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2183 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2184 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2185 switch ( v54 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2186 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2187 case 2:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2188 if ( !*(unsigned char *)v40 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2189 goto LABEL_117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2190 v41 = *(unsigned char *)v40 == 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2191 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2192 case 3:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2193 v43 = *(unsigned char *)v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2194 if ( !*(unsigned char *)v40 || v43 == 1 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2195 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2196 LABEL_117:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2197 v39 += *((unsigned char *)&v5->pItems[0].uItemID + v40 + v52 + v5->pItems[v4->uItemID].uEquipType);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2198 if ( *((unsigned char *)&v5->pItems[0].uItemID + v40 + v52 + v5->pItems[v4->uItemID].uEquipType) )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2199 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2200 v44 = v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2201 ++v58;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2202 *v44 = a2b;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2203 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2204 goto LABEL_119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2205 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2206 v41 = v43 == 2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2207 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2208 case 4:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2209 v42 = *(unsigned char *)v40;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2210 if ( *(unsigned char *)v40 == 1 || v42 == 2 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2211 goto LABEL_117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2212 v41 = v42 == 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2213 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2214 default:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2215 if ( v54 != 5 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2216 goto LABEL_119;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2217 v41 = *(unsigned char *)v40 == 3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2218 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2219 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2220 if ( v41 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2221 goto LABEL_117;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2222 LABEL_119:
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2223 ++a2b;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2224 v40 += 28;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2225 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2226 while ( a2b < v5->field_11798 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2227 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2228 v45 = rand();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2229 v4->uAdditionalValue = Dst;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2230 v46 = v45 % v39 + 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2231 a2c = *((unsigned char *)&v5->pItems[0].uItemID + 28 * (Dst + 1389) + v5->pItems[v4->uItemID].uEquipType);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2232 if ( a2c < v46 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2233 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2234 for ( j = (int *)&Dst; ; j = (int *)v59 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2235 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2236 v48 = v4->uItemID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2237 v49 = (int)(j + 1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2238 v59 = v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2239 v50 = *(unsigned int *)v49;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2240 v4->uAdditionalValue = v50;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2241 a2c += *((unsigned char *)&v5->pItems[0].uItemID + 28 * (v50 + 1389) + v5->pItems[v48].uEquipType);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2242 if ( a2c >= v46 )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2243 break;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2244 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2245 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2246 ++v4->uAdditionalValue;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2247 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2248
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2249 //----- (004505CC) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2250 bool ItemGen::GenerateArtifact()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2251 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2252 ItemGen *v1; // edi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2253 signed int uNumArtifactsNotFound; // esi@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2254 int v3; // eax@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2255 bool result; // eax@6
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2256 int v5[32]; // [sp+8h] [bp-A0h]@3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2257 char Dst[32]; // [sp+88h] [bp-20h]@1
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2258
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2259 auto a2 = this;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2260 v1 = a2;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2261 memset(Dst, 0, 0x20u);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2262 uNumArtifactsNotFound = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2263 v3 = 500;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2264 do
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2265 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2266 if ( !pParty->field_3C.pIsArtifactFound[v3] )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2267 v5[uNumArtifactsNotFound++] = v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2268 ++v3;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2269 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2270 while ( v3 < 529 );
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2271 v1->Reset();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2272 if ( uNumArtifactsNotFound )
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2273 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2274 v1->uItemID = v5[rand() % uNumArtifactsNotFound];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2275 pItemsTable->SetSpecialBonus(v1);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2276 result = 1;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2277 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2278 else
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2279 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2280 result = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2281 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2282 return result;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2283 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2284 // 4505CC: using guessed type int var_A0[32];