annotate MapInfo.cpp @ 2286:288e0b29a493

some cleanups in ItemsTable::GenerateItem
author Grumpy7
date Sat, 15 Mar 2014 19:53:14 +0100
parents 43a508455445
children ddb803517a48
rev   line source
2259
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
1 #include "MapInfo.h"
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
2 #include "LOD.h"
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
3 #include "ErrorHandling.h"
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
4 #include "mm7_data.h"
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
5 #include "texts.h"
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
6 #include "ObjectList.h"
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
7 #include "SpriteObject.h"
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
8 #include "Indoor.h"
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
9 #include "mm7_unsorted_subs.h"
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
10
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
11
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
12 //----- (00453F62) --------------------------------------------------------
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
13 void MapStats::Initialize()
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
14 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
15 char work_str[32]; // [sp+Ch] [bp-34h]@3
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
16 int work_str_pos;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
17 int work_str_len;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
18 int i;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
19 char* test_string;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
20 unsigned char c;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
21 bool break_loop;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
22 unsigned int temp_str_len;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
23 char* tmp_pos;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
24 int decode_step;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
25 int item_counter;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
26
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
27 if ( pMapStatsTXT_Raw )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
28 free(pMapStatsTXT_Raw);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
29 pMapStatsTXT_Raw = NULL;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
30 pMapStatsTXT_Raw = (char *)pEvents_LOD->LoadRaw("MapStats.txt", 0);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
31 strtok(pMapStatsTXT_Raw, "\r");
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
32 strtok(NULL, "\r");
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
33 strtok(NULL, "\r");
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
34
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
35 for (i=1; i<77; ++i)
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
36 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
37 test_string = strtok(NULL, "\r") + 1;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
38 break_loop = false;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
39 decode_step=0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
40 do
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
41 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
42 c = *(unsigned char*)test_string;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
43 temp_str_len = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
44 while((c!='\t')&&(c>0))
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
45 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
46 ++temp_str_len;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
47 c=test_string[temp_str_len];
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
48 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
49 tmp_pos=test_string+temp_str_len;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
50 if (*tmp_pos == 0)
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
51 break_loop = true;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
52 *tmp_pos = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
53 if (temp_str_len)
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
54 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
55 switch (decode_step)
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
56 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
57 case 1:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
58 pInfos[i].pName = RemoveQuotes(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
59 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
60 case 2:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
61 pInfos[i].pFilename = RemoveQuotes(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
62 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
63 case 3:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
64 pInfos[i].uNumResets = atoi(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
65 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
66 case 4:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
67 pInfos[i].uFirstVisitedAt = atoi(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
68 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
69 case 5:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
70 pInfos[i]._per = atoi(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
71 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
72 case 6:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
73 pInfos[i].uRespawnIntervalDays = atoi(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
74 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
75 case 7:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
76 pInfos[i]._alert_days = atoi(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
77 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
78 case 8:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
79 pInfos[i]._steal_perm = atoi(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
80 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
81 case 9:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
82 pInfos[i].LockX5 = atoi(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
83 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
84 case 10:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
85 pInfos[i].Trap_D20 = atoi(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
86 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
87 case 11:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
88 pInfos[i].Treasure_prob = atoi(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
89 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
90 case 12:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
91 pInfos[i].Encounter_percent = atoi(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
92 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
93 case 13:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
94 pInfos[i].EncM1percent = atoi(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
95 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
96 case 14:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
97 pInfos[i].EncM2percent = atoi(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
98 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
99 case 15:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
100 pInfos[i].EncM3percent = atoi(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
101 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
102 case 16:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
103 pInfos[i].pEncounterMonster1Texture = RemoveQuotes(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
104 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
105 case 18:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
106 pInfos[i].Dif_M1 = atoi(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
107 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
108 case 19:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
109 pInfos[i].uEncounterMonster1AtLeast = 1;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
110 pInfos[i].uEncounterMonster1AtMost = 1;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
111 strcpy(work_str, test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
112 work_str_pos = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
113 work_str_len=strlen(work_str);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
114 if (work_str_len )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
115 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
116 while (work_str[work_str_pos] != '-' )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
117 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
118 ++work_str_pos;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
119 if (work_str_pos >= work_str_len )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
120 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
121 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
122 work_str[work_str_pos] = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
123 pInfos[i].uEncounterMonster1AtLeast = atoi(work_str);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
124 if ( work_str_pos < work_str_len )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
125 pInfos[i].uEncounterMonster1AtMost = atoi(&work_str[work_str_pos + 1]);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
126 else
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
127 pInfos[i].uEncounterMonster1AtMost = pInfos[i].uEncounterMonster1AtLeast;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
128 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
129 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
130 case 20:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
131 pInfos[i].pEncounterMonster2Texture = RemoveQuotes(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
132 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
133 case 22:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
134 pInfos[i].Dif_M2 = atoi(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
135 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
136 case 23:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
137 pInfos[i].uEncounterMonster2AtLeast = 1;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
138 pInfos[i].uEncounterMonster2AtMost = 1;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
139 strcpy(work_str, test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
140 work_str_pos = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
141 work_str_len=strlen(work_str);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
142 if (work_str_len )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
143 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
144 while (work_str[work_str_pos] != '-' )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
145 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
146 ++work_str_pos;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
147 if (work_str_pos >= work_str_len )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
148 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
149 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
150 work_str[work_str_pos] = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
151 pInfos[i].uEncounterMonster2AtLeast = atoi(work_str);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
152 if ( work_str_pos < work_str_len )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
153 pInfos[i].uEncounterMonster2AtMost = atoi(&work_str[work_str_pos + 1]);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
154 else
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
155 pInfos[i].uEncounterMonster2AtMost = pInfos[i].uEncounterMonster2AtLeast;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
156 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
157 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
158 case 24:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
159 pInfos[i].pEncounterMonster3Texture = RemoveQuotes(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
160 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
161 case 26:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
162 pInfos[i].Dif_M3 = atoi(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
163 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
164 case 27:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
165 pInfos[i].uEncounterMonster3AtLeast = 1;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
166 pInfos[i].uEncounterMonster3AtMost = 1;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
167 strcpy(work_str, test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
168 work_str_pos = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
169 work_str_len=strlen(work_str);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
170 if (work_str_len )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
171 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
172 while (work_str[work_str_pos] != '-' )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
173 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
174 ++work_str_pos;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
175 if (work_str_pos >= work_str_len )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
176 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
177 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
178 work_str[work_str_pos] = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
179 pInfos[i].uEncounterMonster3AtLeast = atoi(work_str);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
180 if ( work_str_pos < work_str_len )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
181 pInfos[i].uEncounterMonster3AtMost = atoi(&work_str[work_str_pos + 1]);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
182 else
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
183 pInfos[i].uEncounterMonster3AtMost = pInfos[i].uEncounterMonster3AtLeast;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
184 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
185 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
186 case 28:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
187 pInfos[i].uRedbookTrackID = atoi(test_string);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
188 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
189 case 29:
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
190 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
191 if ( !strcmp(test_string, "CAVE") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
192 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
193 pInfos[i].uEAXEnv = 8;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
194 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
195 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
196 if ( !strcmp(test_string, "STONEROOM") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
197 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
198 pInfos[i].uEAXEnv = 5;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
199 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
200 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
201 if ( !strcmp(test_string, "MOUNTAINS") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
202 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
203 pInfos[i].uEAXEnv = 17;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
204 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
205 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
206 if ( !strcmp(test_string, "PLAIN") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
207 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
208 pInfos[i].uEAXEnv = 19;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
209 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
210 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
211 if ( !strcmp(test_string, "FOREST") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
212 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
213 pInfos[i].uEAXEnv = 15;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
214 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
215 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
216 if ( !strcmp(test_string, "CITY") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
217 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
218 pInfos[i].uEAXEnv = 16;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
219 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
220 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
221 if ( !strcmp(test_string, "UNDERWATER") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
222 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
223 pInfos[i].uEAXEnv = 22;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
224 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
225 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
226 if ( !strcmp(test_string, "ARENA") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
227 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
228 pInfos[i].uEAXEnv = 9;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
229 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
230 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
231 if ( !strcmp(test_string, "GENERIC") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
232 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
233 pInfos[i].uEAXEnv = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
234 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
235 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
236 if ( !strcmp(test_string, "PADDEDCELL") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
237 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
238 pInfos[i].uEAXEnv = 1;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
239 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
240 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
241 if ( !strcmp(test_string, "ROOM") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
242 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
243 pInfos[i].uEAXEnv = 2;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
244 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
245 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
246 if ( !strcmp(test_string, "BATHROOM") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
247 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
248 pInfos[i].uEAXEnv = 3;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
249 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
250 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
251 if ( !strcmp(test_string, "LIVINGROOM") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
252 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
253 pInfos[i].uEAXEnv = 4;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
254 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
255 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
256 if ( !strcmp(test_string, "AUDITORIUM") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
257 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
258 pInfos[i].uEAXEnv = 6;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
259 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
260 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
261 if ( !strcmp(test_string, "CONCERTHALL") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
262 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
263 pInfos[i].uEAXEnv = 7;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
264 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
265 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
266 if ( !strcmp(test_string, "HANGAR") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
267 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
268 pInfos[i].uEAXEnv = 10;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
269 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
270 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
271 if ( !strcmp(test_string, "CARPETEDHALLWAY") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
272 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
273 pInfos[i].uEAXEnv = 11;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
274 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
275 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
276 if ( !strcmp(test_string, "HALLWAY") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
277 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
278 pInfos[i].uEAXEnv = 12;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
279 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
280 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
281 if ( !strcmp(test_string, "STONECORRIDOR") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
282 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
283 pInfos[i].uEAXEnv = 13;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
284 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
285 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
286 if ( !strcmp(test_string, "ALLEY") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
287 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
288 pInfos[i].uEAXEnv = 14;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
289 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
290 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
291 if ( !strcmp(test_string, "QUARRY") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
292 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
293 pInfos[i].uEAXEnv = 18;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
294 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
295 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
296 if ( !strcmp(test_string, "PARKINGLOT") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
297 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
298 pInfos[i].uEAXEnv = 20;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
299 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
300 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
301 if ( !strcmp(test_string, "SEWERPIPE") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
302 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
303 pInfos[i].uEAXEnv = 21;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
304 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
305 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
306 if ( !strcmp(test_string, "DRUGGED") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
307 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
308 pInfos[i].uEAXEnv = 23;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
309 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
310 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
311 if ( !strcmp(test_string, "DIZZY") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
312 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
313 pInfos[i].uEAXEnv = 24;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
314 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
315 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
316 if ( !strcmp(test_string, "PSYCHOTIC") )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
317 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
318 pInfos[i].uEAXEnv = 25;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
319 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
320 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
321 pInfos[i].uEAXEnv = 26;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
322
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
323 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
324 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
325 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
326 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
327 else
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
328 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
329 break_loop = true;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
330 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
331 ++decode_step;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
332 test_string=tmp_pos+1;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
333 } while ((decode_step<31)&&!break_loop);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
334 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
335
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
336 uNumMaps = 77;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
337 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
338 // 453F62: using guessed type char Str[32];
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
339
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
340 //----- (00410D99) --------------------------------------------------------
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
341 int MapStats::sub_410D99_get_map_index(int a1)
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
342 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
343 for (int i = 1; i <= pMapStats->uNumMaps; i++)
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
344 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
345 if (_stricmp(pMapStats->pInfos[i].pFilename, pGames_LOD->pSubIndices[a1].pFilename) )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
346 return i;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
347 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
348 Error("Map not found");
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
349 return -1;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
350 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
351
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
352 //----- (004547A3) --------------------------------------------------------
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
353 MAP_TYPE MapStats::GetMapInfo(const char *Str2)
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
354 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
355 Assert(uNumMaps >= 2);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
356
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
357 for (uint i = 1; i < uNumMaps; ++i)
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
358 if (!_stricmp(pInfos[i].pFilename, Str2))
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
359 return (MAP_TYPE)i;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
360
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
361 Error("Map not found!");
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
362 return (MAP_TYPE)-1;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
363 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
364
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
365
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
366 //----- (0044FFD8) --------------------------------------------------------
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
367 int MapInfo::SpawnRandomTreasure(SpawnPointMM7 *a2)
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
368 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
369 //MapInfo *v2; // ebx@1
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
370 //SpawnPointMM7 *v3; // esi@1
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
371 //int v4; // eax@1
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
372 int v5; // edx@1
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
373 int v6; // eax@1
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
374 int v7; // ecx@1
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
375 int v8; // ebx@1
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
376 int v9; // eax@1
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
377 signed int v10; // ebx@1
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
378 signed int result; // eax@1
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
379 signed __int64 v12; // qtt@1
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
380 int v13; // ebx@1
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
381 int v14; // edx@10
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
382 signed int v15; // ebx@20
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
383 unsigned __int16 v16; // dx@20
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
384 ObjectDesc *v17; // ecx@21
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
385 unsigned __int16 v18; // ax@24
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
386 int v19; // ST0C_4@27
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
387 int v20; // ST08_4@27
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
388 int v21; // ST04_4@27
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
389 int v22; // eax@27
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
390 signed int v23; // ebx@29
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
391 unsigned __int16 v24; // dx@29
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
392 ObjectDesc *v25; // ecx@30
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
393 unsigned __int16 v26; // ax@33
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
394 //int v27; // ecx@35
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
395 //int v28; // eax@35
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
396 //int v29; // esi@35
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
397 //__int16 v30; // ax@35
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
398 SpriteObject a1a; // [sp+Ch] [bp-7Ch]@1
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
399 //int v32; // [sp+7Ch] [bp-Ch]@1
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
400 //int v33; // [sp+80h] [bp-8h]@1
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
401 int v34; // [sp+84h] [bp-4h]@1
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
402
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
403 //auto a1 = this;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
404 //v2 = a1;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
405 //v3 = a2;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
406 //v4 = rand();
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
407 v34 = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
408 v5 = rand() % 100;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
409 // v6 = 2 * (v2->Treasure_prob + 7 * v3->uIndex) - 14;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
410 v7 = (unsigned __int8)byte_4E8168[a2->uIndex - 1][2 * Treasure_prob];
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
411 v8 = (unsigned __int8)byte_4E8168[a2->uIndex - 1][2 * Treasure_prob + 1];
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
412 //v32 = v5;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
413 //v33 = v7;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
414 v9 = rand();
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
415 v10 = v8 - v7 + 1;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
416 v12 = v9;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
417 result = v9 / v10;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
418 v13 = v7 + (unsigned __int64)(v12 % v10);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
419 if ( v13 < 7 )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
420 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
421 if ( v5 < 20 )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
422 return result;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
423 if ( v5 >= 60 )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
424 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
425 v19 = a2->vPosition.z;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
426 v20 = a2->vPosition.y;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
427 v21 = a2->vPosition.x;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
428 v22 = rand();
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
429 return sub_450521_ProllyDropItemAt(v13, v22 % 27 + 20, v21, v20, v19, 0);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
430 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
431 if ( a2->uIndex == 1 )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
432 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
433 v14 = rand() % 51 + 50;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
434 a1a.stru_24.uItemID = 197;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
435 v34 = v14;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
436 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
437 else if ( a2->uIndex == 2 )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
438 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
439 v14 = rand() % 101 + 100;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
440 a1a.stru_24.uItemID = 197;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
441 v34 = v14;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
442 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
443 else if ( a2->uIndex == 3 )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
444 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
445 v14 = rand() % 301 + 200;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
446 a1a.stru_24.uItemID = 198;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
447 v34 = v14;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
448 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
449 else if ( a2->uIndex == 4 )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
450 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
451 v14 = rand() % 501 + 500;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
452 a1a.stru_24.uItemID = 198;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
453 v34 = v14;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
454 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
455 else if ( a2->uIndex == 5 )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
456 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
457 v14 = rand() % 1001 + 1000;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
458 a1a.stru_24.uItemID = 199;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
459 v34 = v14;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
460 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
461 else if ( a2->uIndex == 6 )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
462 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
463 v14 = rand() % 3001 + 2000;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
464 a1a.stru_24.uItemID = 199;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
465 v34 = v14;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
466 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
467 v15 = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
468 v16 = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
469 a1a.uType = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
470 v18 = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
471 for( int i = 0; i < pObjectList->uNumObjects; i++ )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
472 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
473 if ( pObjectList->pObjects[i].uObjectID == v16 )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
474 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
475 v18 = i;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
476 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
477 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
478 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
479 a1a.stru_24.SetIdentified();
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
480 a1a.uObjectDescID = v18;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
481 a1a.stru_24.uSpecEnchantmentType = v34;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
482 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
483 else
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
484 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
485 result = a1a.stru_24.GenerateArtifact();
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
486 if ( !result )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
487 return result;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
488 v23 = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
489 v24 = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
490 a1a.uType = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
491 v26 = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
492 for( int i = 0; i < pObjectList->uNumObjects; i++ )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
493 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
494 if( v24 == pObjectList->pObjects[i].uObjectID )
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
495 {
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
496 v26 = i;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
497 break;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
498 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
499 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
500 a1a.uObjectDescID = v26;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
501 a1a.stru_24.Reset();
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
502 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
503 a1a.vPosition.y = a2->vPosition.y;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
504 a1a.uAttributes = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
505 a1a.uSoundID = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
506 a1a.uFacing = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
507 a1a.vPosition.z = a2->vPosition.z;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
508 a1a.vPosition.x = a2->vPosition.x;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
509 a1a.spell_skill = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
510 a1a.spell_level = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
511 a1a.spell_id = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
512 a1a.spell_target_pid = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
513 a1a.spell_caster_pid = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
514 a1a.uSpriteFrameID = 0;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
515 a1a.uSectorID = pIndoor->GetSector(a2->vPosition.x, a2->vPosition.y, a2->vPosition.z);;
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
516 return a1a.Create(0, 0, 0, 0);
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
517 }
43a508455445 Adding MapInfo.cpp, moving a few functions there
Grumpy7
parents:
diff changeset
518