annotate Monsters.cpp @ 701:d5b16a44d9b3

frame_table parser, new files for UI func
author Gloval
date Mon, 18 Mar 2013 22:53:56 +0400
parents b097497f07e2
children a9c1fb7483c2
rev   line source
0
Ritor1
parents:
diff changeset
1 #include <stdlib.h>
Ritor1
parents:
diff changeset
2 #include <stdio.h>
Ritor1
parents:
diff changeset
3 #include <string.h>
Ritor1
parents:
diff changeset
4
Ritor1
parents:
diff changeset
5 #include "Monsters.h"
Ritor1
parents:
diff changeset
6 #include "FrameTableInc.h"
Ritor1
parents:
diff changeset
7 #include "Allocator.h"
Ritor1
parents:
diff changeset
8 #include "LOD.h"
189
038a4d09406f new texts file, fix text rendender error
Gloval
parents: 0
diff changeset
9 #include "texts.h"
0
Ritor1
parents:
diff changeset
10 #include "mm7_data.h"
Ritor1
parents:
diff changeset
11
Ritor1
parents:
diff changeset
12
Ritor1
parents:
diff changeset
13
Ritor1
parents:
diff changeset
14
Ritor1
parents:
diff changeset
15
Ritor1
parents:
diff changeset
16 struct MonsterStats *pMonsterStats;
Ritor1
parents:
diff changeset
17 struct MonsterList *pMonsterList;
Ritor1
parents:
diff changeset
18
698
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
19 unsigned int __fastcall ParseSpellType(struct FrameTableTxtLine *, int a2);
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
20
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
21 int ParseAttackType(const char *damage_type_str);
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
22 void ParseDamage( char *damage_str, unsigned __int8* dice_rolls, unsigned __int8* dice_sides, unsigned __int8* dmg_bonus );
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
23 int ParseMissleAttackType(const char *missle_attack_str);
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
24 int ParseSpecialAttack(const char *spec_att_str);
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
25
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
26 //----- (004548E2) --------------------------------------------------------
701
d5b16a44d9b3 frame_table parser, new files for UI func
Gloval
parents: 698
diff changeset
27 unsigned int __fastcall ParseSpellType(FrameTableTxtLine *a1, int a2)
698
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
28 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
29 int v2; // edi@1
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
30 int v3; // esi@1
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
31 unsigned int result; // eax@1
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
32 std::string v5; // [sp-18h] [bp-28h]@75
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
33 const char *v6; // [sp-8h] [bp-18h]@75
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
34 signed int v7; // [sp-4h] [bp-14h]@3
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
35 std::string *v8; // [sp+8h] [bp-8h]@75
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
36 int a3; // [sp+Fh] [bp-1h]@75
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
37
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
38 v2 = (int)a1;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
39 v3 = a2;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
40 result = (int)a1->pProperties[0];
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
41 if ( result )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
42 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
43 if ( !_strcmpi((const char *)result, "Dispel") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
44 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
45 v7 = 80;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
46 LABEL_71:
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
47 result = v7;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
48 LABEL_76:
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
49 ++*(int *)v3;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
50 return result;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
51 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
52 if ( _strcmpi(*(const char **)(v2 + 4), "Day") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
53 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
54 if ( _strcmpi(*(const char **)(v2 + 4), "Hour") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
55 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
56 if ( _strcmpi(*(const char **)(v2 + 4), "Shield") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
57 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
58 if ( !_strcmpi(*(const char **)(v2 + 4), "Spirit") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
59 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
60 v7 = 52;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
61 goto LABEL_71;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
62 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
63 if ( !_strcmpi(*(const char **)(v2 + 4), "Power") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
64 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
65 v7 = 77;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
66 goto LABEL_71;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
67 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
68 if ( !_strcmpi(*(const char **)(v2 + 4), "Meteor") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
69 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
70 v7 = 9;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
71 goto LABEL_71;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
72 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
73 if ( !_strcmpi(*(const char **)(v2 + 4), "Lightning") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
74 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
75 v7 = 18;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
76 goto LABEL_71;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
77 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
78 if ( _strcmpi(*(const char **)(v2 + 4), "Implosion") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
79 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
80 if ( !_strcmpi(*(const char **)(v2 + 4), "Stone") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
81 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
82 v7 = 38;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
83 goto LABEL_71;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
84 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
85 if ( _strcmpi(*(const char **)(v2 + 4), "Haste") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
86 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
87 if ( _strcmpi(*(const char **)(v2 + 4), "Heroism") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
88 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
89 if ( !_strcmpi(*(const char **)(v2 + 4), "Pain") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
90 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
91 v7 = 95;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
92 goto LABEL_71;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
93 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
94 if ( _strcmpi(*(const char **)(v2 + 4), "Sparks") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
95 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
96 if ( !_strcmpi(*(const char **)(v2 + 4), "Light") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
97 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
98 v7 = 78;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
99 goto LABEL_71;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
100 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
101 if ( !_strcmpi(*(const char **)(v2 + 4), "Toxic") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
102 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
103 v7 = 90;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
104 goto LABEL_71;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
105 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
106 if ( _strcmpi(*(const char **)(v2 + 4), "ShrapMetal") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
107 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
108 if ( _strcmpi(*(const char **)(v2 + 4), "Paralyze") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
109 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
110 if ( _strcmpi(*(const char **)(v2 + 4), "Fireball") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
111 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
112 if ( _strcmpi(*(const char **)(v2 + 4), "Incinerate") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
113 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
114 if ( !_strcmpi(*(const char **)(v2 + 4), "Fire") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
115 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
116 v7 = 2;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
117 goto LABEL_71;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
118 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
119 if ( !_strcmpi(*(const char **)(v2 + 4), "Rock") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
120 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
121 v7 = 41;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
122 goto LABEL_71;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
123 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
124 if ( !_strcmpi(*(const char **)(v2 + 4), "Mass") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
125 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
126 v7 = 44;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
127 goto LABEL_71;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
128 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
129 if ( !_strcmpi(*(const char **)(v2 + 4), "Ice") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
130 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
131 v7 = 26;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
132 goto LABEL_71;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
133 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
134 if ( !_strcmpi(*(const char **)(v2 + 4), "Acid") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
135 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
136 v7 = 29;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
137 goto LABEL_71;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
138 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
139 if ( _strcmpi(*(const char **)(v2 + 4), "Bless") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
140 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
141 if ( !_strcmpi(*(const char **)(v2 + 4), "Dragon") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
142 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
143 v7 = 97;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
144 goto LABEL_71;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
145 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
146 if ( _strcmpi(*(const char **)(v2 + 4), "Reanimate") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
147 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
148 if ( !_strcmpi(*(const char **)(v2 + 4), "Summon") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
149 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
150 v7 = 82;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
151 goto LABEL_71;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
152 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
153 if ( _strcmpi(*(const char **)(v2 + 4), "Fate") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
154 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
155 if ( _strcmpi(*(const char **)(v2 + 4), "Harm") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
156 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
157 if ( !_strcmpi(*(const char **)(v2 + 4), "Mind") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
158 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
159 v7 = 57;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
160 goto LABEL_71;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
161 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
162 if ( _strcmpi(*(const char **)(v2 + 4), "Blades") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
163 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
164 if ( !_strcmpi(*(const char **)(v2 + 4), "Psychic") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
165 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
166 v7 = 65;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
167 goto LABEL_71;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
168 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
169 if ( _strcmpi(*(const char **)(v2 + 4), "Hammerhands") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
170 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
171 sprintf(pTmpBuf, "Unknown monster spell %s", *(int *)(v2 + 4));
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
172 MessageBoxA(nullptr, pTmpBuf, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Itemdata.cpp:1562", 0);
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
173 result = 0;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
174 goto LABEL_76;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
175 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
176 v7 = 73;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
177 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
178 else
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
179 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
180 v7 = 39;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
181 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
182 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
183 else
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
184 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
185 v7 = 70;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
186 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
187 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
188 else
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
189 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
190 v7 = 47;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
191 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
192 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
193 else
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
194 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
195 v7 = 89;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
196 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
197 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
198 else
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
199 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
200 v7 = 46;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
201 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
202 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
203 else
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
204 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
205 v7 = 11;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
206 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
207 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
208 else
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
209 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
210 v7 = 6;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
211 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
212 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
213 else
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
214 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
215 v7 = 81;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
216 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
217 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
218 else
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
219 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
220 v7 = 93;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
221 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
222 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
223 else
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
224 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
225 v7 = 15;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
226 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
227 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
228 else
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
229 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
230 v7 = 51;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
231 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
232 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
233 else
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
234 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
235 v7 = 5;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
236 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
237 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
238 else
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
239 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
240 v7 = 20;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
241 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
242 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
243 else
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
244 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
245 v7 = 17;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
246 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
247 return v7;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
248 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
249 v7 = 86;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
250 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
251 else
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
252 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
253 v7 = 85;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
254 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
255 *(int *)v3 += 2;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
256 result = v7;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
257 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
258 return result;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
259 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
260
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
261 //----- (00454CB4) --------------------------------------------------------
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
262 int ParseAttackType( const char *damage_type_str )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
263 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
264
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
265 switch (tolower(*damage_type_str))
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
266 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
267 case 'f': return 0; //fire
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
268 case 'a': return 1; //air
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
269 case 'w': return 2; //water
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
270 case 'e': return 3; //earth
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
271
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
272 case 's': return 6; //spirit
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
273 case 'm': return 7; //mind
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
274 //m ?? 8
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
275 case 'l': return 9; //light
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
276 case 'd': return 10; //dark
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
277 // d?? 11
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
278 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
279 return 4; //phis
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
280
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
281 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
282
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
283 //----- (00454D7D) --------------------------------------------------------
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
284 void ParseDamage( char *damage_str, unsigned __int8* dice_rolls, unsigned __int8* dice_sides, unsigned __int8* dmg_bonus )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
285 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
286 int str_len=0;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
287 int str_pos=0;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
288 bool dice_flag=false;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
289
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
290 *dice_rolls = 0;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
291 *dice_sides = 1;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
292 *dmg_bonus = 0;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
293
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
294 str_len = strlen(damage_str);
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
295 if (str_len<=0)
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
296 return;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
297 for (str_pos=0;str_pos<str_len;++str_pos )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
298 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
299 if (tolower(damage_str[str_pos])=='d')
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
300 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
301 damage_str[str_pos]='\0';
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
302 *dice_rolls=atoi(damage_str);
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
303 *dice_sides=atoi(&damage_str[str_pos+1]);
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
304 dice_flag=true;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
305 damage_str[str_pos]='d';
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
306 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
307 else if (tolower(damage_str[str_pos])=='+')
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
308 *dmg_bonus=atoi(&damage_str[str_pos+1]);
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
309 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
310 if (!dice_flag)
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
311 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
312 if ((*damage_str>='0')&&(*damage_str<='9'))
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
313 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
314 *dice_rolls =atoi(damage_str);
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
315 *dice_sides = 1;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
316 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
317 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
318 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
319
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
320 //----- (00454E3A) --------------------------------------------------------
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
321 int ParseMissleAttackType(const char *missle_attack_str)
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
322 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
323 if ( !_strcmpi(missle_attack_str, "ARROW") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
324 return 1;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
325 else if ( !_strcmpi(missle_attack_str, "ARROWF") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
326 return 2;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
327 else if ( !_strcmpi(missle_attack_str, "FIRE") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
328 return 3;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
329 else if ( !_strcmpi(missle_attack_str, "AIR") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
330 return 4;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
331 else if ( !_strcmpi(missle_attack_str, "WATER") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
332 return 5;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
333 else if ( !_strcmpi(missle_attack_str, "EARTH") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
334 return 6;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
335 else if ( !_strcmpi(missle_attack_str, "SPIRIT") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
336 return 7;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
337 else if ( !_strcmpi(missle_attack_str, "MIND") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
338 return 8;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
339 else if ( !_strcmpi(missle_attack_str, "BODY") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
340 return 9;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
341 else if ( !_strcmpi(missle_attack_str, "LIGHT") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
342 return 10;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
343 else if ( !_strcmpi(missle_attack_str, "DARK") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
344 return 11;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
345 else if ( !_strcmpi(missle_attack_str, "ENER") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
346 return 13;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
347 else return 0;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
348 }
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
349
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
350
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
351 int ParseSpecialAttack(const char *spec_att_str)
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
352 {
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
353 if ( strstr(spec_att_str, "curse") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
354 return 1;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
355 else if ( strstr(spec_att_str, "weak") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
356 return 2;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
357 else if ( strstr(spec_att_str, "asleep") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
358 return 3;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
359 else if ( strstr(spec_att_str, "afraid") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
360 return 23;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
361 else if ( strstr(spec_att_str, "drunk") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
362 return 4;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
363 else if ( strstr(spec_att_str, "insane") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
364 return 5;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
365 else if ( strstr(spec_att_str, "poison1") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
366 return 6;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
367 else if ( strstr(spec_att_str, "poison2") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
368 return 7;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
369 else if ( strstr(spec_att_str, "poison3") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
370 return 8;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
371 else if ( strstr(spec_att_str, "disease1") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
372 return 9;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
373 else if ( strstr(spec_att_str, "disease2") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
374 return 10;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
375 else if ( strstr(spec_att_str, "disease3") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
376 return 11;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
377 else if ( strstr(spec_att_str, "paralyze") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
378 return 12;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
379 else if ( strstr(spec_att_str, "uncon") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
380 return 13;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
381 else if ( strstr(spec_att_str, "dead") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
382 return 14;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
383 else if ( strstr(spec_att_str, "stone") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
384 return 15;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
385 else if ( strstr(spec_att_str, "errad") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
386 return 16;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
387 else if ( strstr(spec_att_str, "brkitem") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
388 return 17;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
389 else if ( strstr(spec_att_str, "brkarmor") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
390 return 18;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
391 else if ( strstr(spec_att_str, "brkweapon") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
392 return 19;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
393 else if ( strstr(spec_att_str, "steal") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
394 return 20;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
395 else if ( strstr(spec_att_str, "age") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
396 return 21;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
397 else if ( strstr(spec_att_str, "drainsp") )
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
398 return 22;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
399 else return 0;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
400 }
0
Ritor1
parents:
diff changeset
401
Ritor1
parents:
diff changeset
402 //----- (004598FC) --------------------------------------------------------
Ritor1
parents:
diff changeset
403 bool MonsterList::FromFileTxt(const char *Args)
Ritor1
parents:
diff changeset
404 {
Ritor1
parents:
diff changeset
405 MonsterList *v2; // ebx@1
Ritor1
parents:
diff changeset
406 FILE *v3; // eax@1
Ritor1
parents:
diff changeset
407 unsigned int v4; // esi@3
Ritor1
parents:
diff changeset
408 void *v5; // eax@9
Ritor1
parents:
diff changeset
409 FILE *v6; // ST14_4@11
Ritor1
parents:
diff changeset
410 char *i; // eax@11
Ritor1
parents:
diff changeset
411 signed int v8; // esi@12
Ritor1
parents:
diff changeset
412 unsigned __int16 v9; // ax@16
Ritor1
parents:
diff changeset
413 const char *v10; // ST18_4@16
Ritor1
parents:
diff changeset
414 unsigned __int16 v11; // ax@16
Ritor1
parents:
diff changeset
415 const char *v12; // ST14_4@16
Ritor1
parents:
diff changeset
416 unsigned __int16 v13; // ax@16
Ritor1
parents:
diff changeset
417 const char *v14; // ST10_4@16
Ritor1
parents:
diff changeset
418 __int16 v15; // ax@16
Ritor1
parents:
diff changeset
419 const char *v16; // ST0C_4@16
Ritor1
parents:
diff changeset
420 int v17; // esi@16
Ritor1
parents:
diff changeset
421 unsigned __int8 v18; // al@16
Ritor1
parents:
diff changeset
422 signed int v19; // esi@16
Ritor1
parents:
diff changeset
423 unsigned __int16 v20; // ax@17
Ritor1
parents:
diff changeset
424 int v21; // ecx@17
Ritor1
parents:
diff changeset
425 char Buf; // [sp+4h] [bp-304h]@3
Ritor1
parents:
diff changeset
426 FrameTableTxtLine v24; // [sp+1F8h] [bp-110h]@4
Ritor1
parents:
diff changeset
427 FrameTableTxtLine v25; // [sp+274h] [bp-94h]@4
Ritor1
parents:
diff changeset
428 int v26; // [sp+2F0h] [bp-18h]@16
Ritor1
parents:
diff changeset
429 char v27; // [sp+2F4h] [bp-14h]@14
Ritor1
parents:
diff changeset
430 char v28; // [sp+2F5h] [bp-13h]@14
Ritor1
parents:
diff changeset
431 char v29; // [sp+2F6h] [bp-12h]@14
Ritor1
parents:
diff changeset
432 char v30; // [sp+2F7h] [bp-11h]@14
Ritor1
parents:
diff changeset
433 char v31; // [sp+2F8h] [bp-10h]@14
Ritor1
parents:
diff changeset
434 char v32; // [sp+2F9h] [bp-Fh]@14
Ritor1
parents:
diff changeset
435 char v33; // [sp+2FAh] [bp-Eh]@14
Ritor1
parents:
diff changeset
436 char v34; // [sp+2FBh] [bp-Dh]@14
Ritor1
parents:
diff changeset
437 char v35; // [sp+2FCh] [bp-Ch]@14
Ritor1
parents:
diff changeset
438 char v36; // [sp+2FDh] [bp-Bh]@14
Ritor1
parents:
diff changeset
439 char v37; // [sp+2FEh] [bp-Ah]@14
Ritor1
parents:
diff changeset
440 char v38; // [sp+2FFh] [bp-9h]@14
Ritor1
parents:
diff changeset
441 char v39; // [sp+300h] [bp-8h]@14
Ritor1
parents:
diff changeset
442 char v40; // [sp+301h] [bp-7h]@14
Ritor1
parents:
diff changeset
443 char v41; // [sp+302h] [bp-6h]@14
Ritor1
parents:
diff changeset
444 char v42; // [sp+303h] [bp-5h]@14
Ritor1
parents:
diff changeset
445 FILE *File; // [sp+304h] [bp-4h]@1
Ritor1
parents:
diff changeset
446 unsigned int Argsa; // [sp+310h] [bp+8h]@3
Ritor1
parents:
diff changeset
447 int Argsb; // [sp+310h] [bp+8h]@16
Ritor1
parents:
diff changeset
448
Ritor1
parents:
diff changeset
449 v2 = this;
Ritor1
parents:
diff changeset
450 v3 = fopen(Args, "r");
Ritor1
parents:
diff changeset
451 File = v3;
Ritor1
parents:
diff changeset
452 if ( !v3 )
Ritor1
parents:
diff changeset
453 Abortf("MonsterRaceListStruct::load - Unable to open file: %s.");
Ritor1
parents:
diff changeset
454 v4 = 0;
Ritor1
parents:
diff changeset
455 Argsa = 0;
Ritor1
parents:
diff changeset
456 if ( fgets(&Buf, 490, v3) )
Ritor1
parents:
diff changeset
457 {
Ritor1
parents:
diff changeset
458 do
Ritor1
parents:
diff changeset
459 {
Ritor1
parents:
diff changeset
460 *strchr(&Buf, 10) = 0;
Ritor1
parents:
diff changeset
461 memcpy(&v25, frame_table_txt_parser(&Buf, &v24), sizeof(v25));
701
d5b16a44d9b3 frame_table parser, new files for UI func
Gloval
parents: 698
diff changeset
462 if ( v25.uPropCount && *v25.pProperties[0] != 47 )
0
Ritor1
parents:
diff changeset
463 ++Argsa;
Ritor1
parents:
diff changeset
464 }
Ritor1
parents:
diff changeset
465 while ( fgets(&Buf, 490, File) );
Ritor1
parents:
diff changeset
466 v4 = Argsa;
Ritor1
parents:
diff changeset
467 }
Ritor1
parents:
diff changeset
468 v2->uNumMonsters = v4;
Ritor1
parents:
diff changeset
469 v5 = pAllocator->AllocNamedChunk(v2->pMonsters, 152 * v4, "Mon Race");
Ritor1
parents:
diff changeset
470 v2->pMonsters = (MonsterDesc *)v5;
Ritor1
parents:
diff changeset
471 if ( !v5 )
Ritor1
parents:
diff changeset
472 Abortf("MonsterRaceListStruct::load - Out of Memory!");
Ritor1
parents:
diff changeset
473 v6 = File;
Ritor1
parents:
diff changeset
474 v2->uNumMonsters = 0;
Ritor1
parents:
diff changeset
475 fseek(v6, 0, 0);
Ritor1
parents:
diff changeset
476 for ( i = fgets(&Buf, 490, File); i; i = fgets(&Buf, 490, File) )
Ritor1
parents:
diff changeset
477 {
Ritor1
parents:
diff changeset
478 *strchr(&Buf, 10) = 0;
Ritor1
parents:
diff changeset
479 memcpy(&v25, frame_table_txt_parser(&Buf, &v24), sizeof(v25));
Ritor1
parents:
diff changeset
480 v8 = 0;
701
d5b16a44d9b3 frame_table parser, new files for UI func
Gloval
parents: 698
diff changeset
481 if ( v25.uPropCount && *v25.pProperties[0] != 47 )
0
Ritor1
parents:
diff changeset
482 {
Ritor1
parents:
diff changeset
483 strcpy(v2->pMonsters[v2->uNumMonsters].pMonsterName, v25.pProperties[0]);
Ritor1
parents:
diff changeset
484 v35 = 0;
Ritor1
parents:
diff changeset
485 v36 = 1;
Ritor1
parents:
diff changeset
486 v37 = 7;
Ritor1
parents:
diff changeset
487 v38 = 2;
Ritor1
parents:
diff changeset
488 v39 = 3;
Ritor1
parents:
diff changeset
489 v40 = 4;
Ritor1
parents:
diff changeset
490 v41 = 5;
Ritor1
parents:
diff changeset
491 v42 = 6;
Ritor1
parents:
diff changeset
492 v27 = 1;
Ritor1
parents:
diff changeset
493 v28 = 2;
Ritor1
parents:
diff changeset
494 v29 = 3;
Ritor1
parents:
diff changeset
495 v30 = 4;
Ritor1
parents:
diff changeset
496 v31 = 4;
Ritor1
parents:
diff changeset
497 v32 = 5;
Ritor1
parents:
diff changeset
498 v33 = 6;
Ritor1
parents:
diff changeset
499 v34 = 7;
Ritor1
parents:
diff changeset
500 do
Ritor1
parents:
diff changeset
501 {
Ritor1
parents:
diff changeset
502 strcpy(
Ritor1
parents:
diff changeset
503 v2->pMonsters[v2->uNumMonsters].pSpriteNames[(unsigned __int8)*(&v35 + v8)],
Ritor1
parents:
diff changeset
504 v25.pProperties[(unsigned __int8)*(&v27 + v8)]);
Ritor1
parents:
diff changeset
505 ++v8;
Ritor1
parents:
diff changeset
506 }
Ritor1
parents:
diff changeset
507 while ( v8 < 8 );
Ritor1
parents:
diff changeset
508 v9 = atoi(v25.pProperties[8]);
Ritor1
parents:
diff changeset
509 v10 = v25.pProperties[9];
Ritor1
parents:
diff changeset
510 v2->pMonsters[v2->uNumMonsters].uMonsterHeight = v9;
Ritor1
parents:
diff changeset
511 v11 = atoi(v10);
Ritor1
parents:
diff changeset
512 v12 = v25.pProperties[10];
Ritor1
parents:
diff changeset
513 v2->pMonsters[v2->uNumMonsters].uMovementSpeed = v11;
Ritor1
parents:
diff changeset
514 v13 = atoi(v12);
Ritor1
parents:
diff changeset
515 v14 = v25.pProperties[11];
Ritor1
parents:
diff changeset
516 v2->pMonsters[v2->uNumMonsters].uMonsterRadius = v13;
Ritor1
parents:
diff changeset
517 v15 = atoi(v14);
Ritor1
parents:
diff changeset
518 v16 = v25.pProperties[12];
Ritor1
parents:
diff changeset
519 v2->pMonsters[v2->uNumMonsters].uToHitRadius = v15;
Ritor1
parents:
diff changeset
520 v17 = (unsigned __int8)atoi(v16);
701
d5b16a44d9b3 frame_table parser, new files for UI func
Gloval
parents: 698
diff changeset
521 Argsb = atoi(v25.pProperties[13]) & 0xFF;
d5b16a44d9b3 frame_table parser, new files for UI func
Gloval
parents: 698
diff changeset
522 v26 = atoi(v25.pProperties[14]) & 0xFF;
d5b16a44d9b3 frame_table parser, new files for UI func
Gloval
parents: 698
diff changeset
523 v18 = atoi(v25.pProperties[15]);
0
Ritor1
parents:
diff changeset
524 v2->pMonsters[v2->uNumMonsters].uTintColor = v18 | ((v26 | ((Argsb | (v17 << 8)) << 8)) << 8);
Ritor1
parents:
diff changeset
525 v19 = 0;
Ritor1
parents:
diff changeset
526 do
Ritor1
parents:
diff changeset
527 {
701
d5b16a44d9b3 frame_table parser, new files for UI func
Gloval
parents: 698
diff changeset
528 v20 = atoi(v25.pProperties[v19 + 16]);
d5b16a44d9b3 frame_table parser, new files for UI func
Gloval
parents: 698
diff changeset
529 v21 = v19++ ;
d5b16a44d9b3 frame_table parser, new files for UI func
Gloval
parents: 698
diff changeset
530 v2->pMonsters[v2->uNumMonsters].pSoundSampleIDs[v21] = v20;
0
Ritor1
parents:
diff changeset
531 }
Ritor1
parents:
diff changeset
532 while ( v19 < 4 );
Ritor1
parents:
diff changeset
533 ++v2->uNumMonsters;
Ritor1
parents:
diff changeset
534 }
Ritor1
parents:
diff changeset
535 }
Ritor1
parents:
diff changeset
536 fclose(File);
Ritor1
parents:
diff changeset
537 return 1;
Ritor1
parents:
diff changeset
538 }
Ritor1
parents:
diff changeset
539
Ritor1
parents:
diff changeset
540 //----- (004598AF) --------------------------------------------------------
Ritor1
parents:
diff changeset
541 void MonsterList::FromFile(void *pSerialized)
Ritor1
parents:
diff changeset
542 {
Ritor1
parents:
diff changeset
543 uNumMonsters = *(int *)pSerialized;
698
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
544 pMonsters = (MonsterDesc *)pAllocator->AllocNamedChunk(pMonsters, sizeof(MonsterDesc) * uNumMonsters, "Mon Race");
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
545 memcpy(pMonsters, (char *)pSerialized + 4, sizeof(MonsterDesc) * uNumMonsters);
0
Ritor1
parents:
diff changeset
546 }
Ritor1
parents:
diff changeset
547
Ritor1
parents:
diff changeset
548 //----- (00459860) --------------------------------------------------------
Ritor1
parents:
diff changeset
549 void MonsterList::ToFile()
Ritor1
parents:
diff changeset
550 {
Ritor1
parents:
diff changeset
551 MonsterList *v1; // esi@1
Ritor1
parents:
diff changeset
552 FILE *v2; // eax@1
Ritor1
parents:
diff changeset
553 FILE *v3; // edi@1
Ritor1
parents:
diff changeset
554
Ritor1
parents:
diff changeset
555 v1 = this;
Ritor1
parents:
diff changeset
556 v2 = fopen("data\\dmonlist.bin", "wb");
Ritor1
parents:
diff changeset
557 v3 = v2;
Ritor1
parents:
diff changeset
558 if ( !v2 )
Ritor1
parents:
diff changeset
559 Abortf("Unable to save dmonlist.bin!");
Ritor1
parents:
diff changeset
560 fwrite(v1, 4u, 1u, v2);
Ritor1
parents:
diff changeset
561 fwrite(v1->pMonsters, 0x98u, v1->uNumMonsters, v3);
Ritor1
parents:
diff changeset
562 fclose(v3);
Ritor1
parents:
diff changeset
563 }
Ritor1
parents:
diff changeset
564
Ritor1
parents:
diff changeset
565
Ritor1
parents:
diff changeset
566 //----- (004563FF) --------------------------------------------------------
694
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
567 signed int MonsterStats::FindMonsterByName(const char *Str2)
0
Ritor1
parents:
diff changeset
568 {
Ritor1
parents:
diff changeset
569 MonsterStats *v2; // esi@1
Ritor1
parents:
diff changeset
570 signed int v3; // ebx@1
Ritor1
parents:
diff changeset
571 MonsterInfo *v4; // edi@2
Ritor1
parents:
diff changeset
572 signed int result; // eax@6
694
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
573 /*
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
574 for (int i=1; i<=uNumMonsters; ++i)
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
575 {
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
576 if()
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
577 return i;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
578 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
579 return -1;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
580 */
0
Ritor1
parents:
diff changeset
581 v2 = this;
Ritor1
parents:
diff changeset
582 v3 = 1;
Ritor1
parents:
diff changeset
583 if ( (signed int)this->uNumMonsters <= 1 )
Ritor1
parents:
diff changeset
584 {
Ritor1
parents:
diff changeset
585 LABEL_6:
Ritor1
parents:
diff changeset
586 result = -1;
Ritor1
parents:
diff changeset
587 }
Ritor1
parents:
diff changeset
588 else
Ritor1
parents:
diff changeset
589 {
Ritor1
parents:
diff changeset
590 v4 = &this->pInfos[1];
694
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
591 while ( !v4->pName || _strcmpi(v4->pPictureName, Str2) )
0
Ritor1
parents:
diff changeset
592 {
Ritor1
parents:
diff changeset
593 ++v3;
Ritor1
parents:
diff changeset
594 ++v4;
Ritor1
parents:
diff changeset
595 if ( v3 >= (signed int)v2->uNumMonsters )
Ritor1
parents:
diff changeset
596 goto LABEL_6;
Ritor1
parents:
diff changeset
597 }
Ritor1
parents:
diff changeset
598 result = v3;
Ritor1
parents:
diff changeset
599 }
Ritor1
parents:
diff changeset
600 return result;
Ritor1
parents:
diff changeset
601 }
Ritor1
parents:
diff changeset
602
Ritor1
parents:
diff changeset
603
Ritor1
parents:
diff changeset
604 //----- (00454F4E) --------------------------------------------------------
Ritor1
parents:
diff changeset
605 void MonsterStats::InitializePlacements()
Ritor1
parents:
diff changeset
606 {
237
2799737f8a74 more text parsers refactor
Gloval
parents: 190
diff changeset
607 int i;
2799737f8a74 more text parsers refactor
Gloval
parents: 190
diff changeset
608 char* test_string;
2799737f8a74 more text parsers refactor
Gloval
parents: 190
diff changeset
609 unsigned char c;
2799737f8a74 more text parsers refactor
Gloval
parents: 190
diff changeset
610 bool break_loop;
2799737f8a74 more text parsers refactor
Gloval
parents: 190
diff changeset
611 unsigned int temp_str_len;
2799737f8a74 more text parsers refactor
Gloval
parents: 190
diff changeset
612 char* tmp_pos;
2799737f8a74 more text parsers refactor
Gloval
parents: 190
diff changeset
613 int decode_step;
2799737f8a74 more text parsers refactor
Gloval
parents: 190
diff changeset
614 int item_counter;
0
Ritor1
parents:
diff changeset
615
Ritor1
parents:
diff changeset
616 pMonsterPlacementTXT_Raw = (char *)pEvents_LOD->LoadRaw("placemon.txt", 0);
Ritor1
parents:
diff changeset
617 strtok(pMonsterPlacementTXT_Raw, "\r");
237
2799737f8a74 more text parsers refactor
Gloval
parents: 190
diff changeset
618 for (i=1; i<31; ++i)
2799737f8a74 more text parsers refactor
Gloval
parents: 190
diff changeset
619 {
2799737f8a74 more text parsers refactor
Gloval
parents: 190
diff changeset
620 test_string = strtok(NULL, "\r") + 1;
2799737f8a74 more text parsers refactor
Gloval
parents: 190
diff changeset
621 break_loop = false;
2799737f8a74 more text parsers refactor
Gloval
parents: 190
diff changeset
622 decode_step=0;
2799737f8a74 more text parsers refactor
Gloval
parents: 190
diff changeset
623 do
2799737f8a74 more text parsers refactor
Gloval
parents: 190
diff changeset
624 {
2799737f8a74 more text parsers refactor
Gloval
parents: 190
diff changeset
625 c = *(unsigned char*)test_string;
2799737f8a74 more text parsers refactor
Gloval
parents: 190
diff changeset
626 temp_str_len = 0;
2799737f8a74 more text parsers refactor
Gloval
parents: 190
diff changeset
627 while((c!='\t')&&(c>0))
2799737f8a74 more text parsers refactor
Gloval
parents: 190
diff changeset
628 {
2799737f8a74 more text parsers refactor
Gloval
parents: 190
diff changeset
629 ++temp_str_len;
2799737f8a74 more text parsers refactor
Gloval
parents: 190
diff changeset
630 c=test_string[temp_str_len];
2799737f8a74 more text parsers refactor
Gloval
parents: 190
diff changeset
631 }
2799737f8a74 more text parsers refactor
Gloval
parents: 190
diff changeset
632 tmp_pos=test_string+temp_str_len;
2799737f8a74 more text parsers refactor
Gloval
parents: 190
diff changeset
633 if (*tmp_pos == 0)
2799737f8a74 more text parsers refactor
Gloval
parents: 190
diff changeset
634 break_loop = true;
2799737f8a74 more text parsers refactor
Gloval
parents: 190
diff changeset
635 *tmp_pos = 0;
2799737f8a74 more text parsers refactor
Gloval
parents: 190
diff changeset
636 if (temp_str_len)
2799737f8a74 more text parsers refactor
Gloval
parents: 190
diff changeset
637 {
2799737f8a74 more text parsers refactor
Gloval
parents: 190
diff changeset
638 if (decode_step==1)
2799737f8a74 more text parsers refactor
Gloval
parents: 190
diff changeset
639 pPlaceStrings[i]=RemoveQuotes(test_string);
2799737f8a74 more text parsers refactor
Gloval
parents: 190
diff changeset
640 }
2799737f8a74 more text parsers refactor
Gloval
parents: 190
diff changeset
641 else
2799737f8a74 more text parsers refactor
Gloval
parents: 190
diff changeset
642 {
2799737f8a74 more text parsers refactor
Gloval
parents: 190
diff changeset
643 break_loop = true;
2799737f8a74 more text parsers refactor
Gloval
parents: 190
diff changeset
644 }
2799737f8a74 more text parsers refactor
Gloval
parents: 190
diff changeset
645 ++decode_step;
2799737f8a74 more text parsers refactor
Gloval
parents: 190
diff changeset
646 test_string=tmp_pos+1;
2799737f8a74 more text parsers refactor
Gloval
parents: 190
diff changeset
647 } while ((decode_step<3)&&!break_loop);
2799737f8a74 more text parsers refactor
Gloval
parents: 190
diff changeset
648 }
2799737f8a74 more text parsers refactor
Gloval
parents: 190
diff changeset
649 uNumPlacements = 31;
0
Ritor1
parents:
diff changeset
650 }
Ritor1
parents:
diff changeset
651
Ritor1
parents:
diff changeset
652 //----- (0045501E) --------------------------------------------------------
Ritor1
parents:
diff changeset
653 void MonsterStats::Initialize()
694
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
654 {
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
655 MonsterStats *v1; // ebx@1
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
656 int v2; // ebx@4
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
657 char v3; // cl@5
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
658 int v4; // eax@5
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
659 size_t v5; // eax@19
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
660 signed int v6; // edi@19
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
661 MonsterStats *v7; // ecx@23
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
662 int v8; // eax@23
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
663 unsigned int *pHP; // esi@23
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
664 size_t v10; // eax@29
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
665 signed int v11; // edi@29
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
666 MonsterStats *v12; // ecx@33
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
667 int v13; // eax@33
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
668 unsigned int *pExp; // esi@33
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
669 signed int v15; // edi@36
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
670 size_t v16; // esi@36
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
671 int v17; // eax@37
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
672 MonsterInfo *v18; // esi@45
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
673 size_t v19; // edi@50
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
674 int v20; // eax@51
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
675 unsigned __int8 v21; // al@55
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
676 size_t v22; // edi@59
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
677 char v23; // cl@63
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
678 const char *v24; // edi@63
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
679 unsigned __int16 *v25; // esi@114
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
680 int v26; // eax@118
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
681 size_t v27; // eax@136
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
682 int v28; // edi@137
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
683 MonsterStats *v29; // esi@137
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
684 int v30; // eax@138
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
685 int v31; // eax@142
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
686 int v32; // eax@143
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
687 int v33; // eax@144
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
688 int v34; // eax@151
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
689 int v35; // eax@152
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
690 int v36; // eax@153
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
691 int v37; // eax@162
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
692 int v38; // eax@163
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
693 int v39; // eax@164
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
694 int v40; // eax@171
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
695 int v41; // eax@172
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
696 size_t v42; // eax@180
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
697 int v43; // edi@180
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
698 MonsterInfo *v44; // esi@180
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
699 int v45; // edi@184
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
700 MonsterInfo *v46; // eax@232
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
701 char *v47; // edx@232
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
702 char *v48; // ecx@232
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
703 MonsterInfo *v49; // eax@236
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
704 FrameTableTxtLine *v50; // esi@240
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
705 int v51; // eax@240
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
706 int v52; // eax@241
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
707 int v53; // esi@242
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
708 int v54; // edi@242
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
709 char v55; // al@242
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
710 char *v56; // edi@242
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
711 FrameTableTxtLine *v57; // esi@249
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
712 int v58; // eax@249
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
713 MonsterInfo *v59; // eax@250
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
714 MonsterInfo *v60; // esi@251
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
715 int v61; // edi@251
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
716 char v62; // al@251
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
717 char *v63; // edi@251
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
718 char v64; // al@258
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
719 char v65; // al@262
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
720 char v66; // al@266
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
721 char v67; // al@270
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
722 char v68; // al@274
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
723 char v69; // al@278
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
724 char v70; // al@282
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
725 char v71; // al@286
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
726 char v72; // al@290
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
727 unsigned __int8 v73; // al@294
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
728 int v74; // edi@298
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
729 MonsterInfo *v75; // esi@300
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
730 MonsterInfo *v76; // esi@302
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
731 char **v77; // edi@306
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
732 __int16 v78; // ax@316
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
733 MonsterInfo *v79; // esi@323
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
734 const char *v80; // ecx@323
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
735 std::string v81; // [sp-14h] [bp-46Ch]@317
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
736 const char *v82; // [sp-8h] [bp-460h]@306
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
737 char *v83; // [sp-4h] [bp-45Ch]@23
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
738 char *v84; // [sp+0h] [bp-458h]@37
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
739 FrameTableTxtLine v85; // [sp+10h] [bp-448h]@297
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
740 FrameTableTxtLine v86; // [sp+8Ch] [bp-3CCh]@249
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
741 FrameTableTxtLine v87; // [sp+108h] [bp-350h]@240
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
742 char Src[120]; // [sp+184h] [bp-2D4h]@317
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
743 FrameTableTxtLine v89; // [sp+1FCh] [bp-25Ch]@249
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
744 FrameTableTxtLine v90; // [sp+278h] [bp-1E0h]@240
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
745 char Str[64]; // [sp+2F4h] [bp-164h]@240
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
746 char Dest[64]; // [sp+334h] [bp-124h]@249
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
747 char v93[64]; // [sp+374h] [bp-E4h]@297
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
748 FrameTableTxtLine v94; // [sp+3B4h] [bp-A4h]@297
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
749 int v95; // [sp+430h] [bp-28h]@317
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
750 int v96; // [sp+434h] [bp-24h]@9
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
751 int v97; // [sp+438h] [bp-20h]@4
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
752 char a3[5]; // [sp+43Fh] [bp-19h]@4
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
753 int a2; // [sp+444h] [bp-14h]@36
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
754 int v100; // [sp+448h] [bp-10h]@36
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
755 size_t v101; // [sp+44Ch] [bp-Ch]@19
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
756 MonsterStats *v102; // [sp+450h] [bp-8h]@1
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
757 int v103; // [sp+454h] [bp-4h]@3
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
758
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
759 int i,j;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
760 char* test_string;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
761 unsigned char c;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
762 bool break_loop;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
763 unsigned int temp_str_len;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
764 char* tmp_pos;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
765 int decode_step;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
766 int item_counter;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
767 int curr_rec_num;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
768
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
769 v1 = this;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
770 v102 = this;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
771 if ( pMonstersTXT_Raw )
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
772 pAllocator->FreeChunk(pMonstersTXT_Raw);
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
773 pMonstersTXT_Raw = NULL;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
774 pMonstersTXT_Raw = (char *)pEvents_LOD->LoadRaw("monsters.txt", 0);
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
775 strtok(pMonstersTXT_Raw, "\r");
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
776 strtok(NULL, "\r");
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
777 strtok(NULL, "\r");
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
778 strtok(NULL, "\r");
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
779 uNumMonsters = 265;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
780 curr_rec_num=0;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
781 for (i=0;i<uNumMonsters-1;++i)
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
782 {
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
783 test_string = strtok(NULL, "\r") + 1;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
784 break_loop = false;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
785 decode_step=0;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
786 do
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
787 {
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
788 c = *(unsigned char*)test_string;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
789 temp_str_len = 0;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
790 while((c!='\t')&&(c>0))
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
791 {
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
792 ++temp_str_len;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
793 c=test_string[temp_str_len];
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
794 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
795 tmp_pos=test_string+temp_str_len;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
796 if (*tmp_pos == 0)
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
797 break_loop = true;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
798 *tmp_pos = 0;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
799 if (temp_str_len)
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
800 {
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
801 switch (decode_step)
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
802 {
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
803 case 0:
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
804 curr_rec_num=atoi(test_string);
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
805 pInfos[curr_rec_num].uID=curr_rec_num;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
806 break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
807 case 1:
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
808 pInfos[curr_rec_num].pName=RemoveQuotes(test_string);
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
809 break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
810 case 2:
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
811 pInfos[curr_rec_num].pPictureName=RemoveQuotes(test_string);
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
812 break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
813 case 3:
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
814 pInfos[curr_rec_num].uLevel=atoi(test_string);
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
815 break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
816 case 4:
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
817 {
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
818 int str_len=0;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
819 int str_pos=0;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
820 pInfos[curr_rec_num].uHP=0;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
821 if (test_string[0]=='"')
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
822 test_string[0]=' ';
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
823 str_len=strlen(test_string);
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
824 if (str_len==0)
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
825 break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
826 while ((test_string[str_pos]!=',')&&(str_pos<str_len))
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
827 ++str_pos;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
828 if (str_len==str_pos)
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
829 pInfos[curr_rec_num].uHP=atoi(test_string);
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
830 else
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
831 {
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
832 test_string[str_pos]='\0';
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
833 pInfos[curr_rec_num].uHP=1000*atoi(test_string);
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
834 pInfos[curr_rec_num].uHP+=atoi(&test_string[str_pos+1]);
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
835 test_string[str_pos]=',';
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
836 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
837 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
838 break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
839 case 5:
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
840 pInfos[curr_rec_num].uAC=atoi(test_string);
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
841 break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
842 case 6:
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
843 {
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
844 int str_len=0;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
845 int str_pos=0;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
846 pInfos[curr_rec_num].uExp=0;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
847 if (test_string[0]=='"')
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
848 test_string[0]=' ';
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
849 str_len=strlen(test_string);
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
850 if (str_len==0)
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
851 break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
852 while ((test_string[str_pos]!=',')&&(str_pos<str_len))
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
853 ++str_pos;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
854 if (str_len==str_pos)
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
855 pInfos[curr_rec_num].uExp=atoi(test_string);
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
856 else
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
857 {
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
858 test_string[str_pos]='\0';
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
859 pInfos[curr_rec_num].uExp=1000*atoi(test_string);
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
860 pInfos[curr_rec_num].uExp+=atoi(&test_string[str_pos+1]);
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
861 test_string[str_pos]=',';
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
862 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
863 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
864 break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
865 case 7:
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
866 {
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
867 int str_len=0;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
868 int str_pos=0;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
869 bool chance_flag=false;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
870 bool dice_flag=false;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
871 bool item_type_flag=false;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
872 char* item_name;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
873 pInfos[curr_rec_num].uTreasureDropChance=0;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
874 pInfos[curr_rec_num].uTreasureDiceRolls=0;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
875 pInfos[curr_rec_num].uTreasureDiceSides=0;
698
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
876 pInfos[curr_rec_num].uTreasureType=0;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
877 pInfos[curr_rec_num].uTreasureLevel=0;
694
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
878 if (test_string[0]=='"')
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
879 test_string[0]=' ';
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
880 str_len=strlen(test_string);
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
881 do
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
882 {
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
883 switch(tolower(test_string[str_pos]))
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
884 {
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
885 case '%': chance_flag=true; break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
886 case 'd': dice_flag=true; break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
887 case 'l': item_type_flag=true; break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
888 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
889 ++str_pos;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
890 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
891 while(str_pos<str_len);
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
892 if (chance_flag)
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
893 {
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
894 pInfos[curr_rec_num].uTreasureDropChance=atoi(test_string);
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
895 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
896 else
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
897 {
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
898 if ((!dice_flag)&&(!item_type_flag))
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
899 break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
900 pInfos[curr_rec_num].uTreasureDropChance=100;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
901 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
902 if (dice_flag)
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
903 {
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
904 str_pos=0;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
905 dice_flag=false;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
906 do
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
907 {
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
908 switch(tolower(test_string[str_pos]))
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
909 {
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
910 case '%':
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
911 pInfos[curr_rec_num].uTreasureDiceRolls=atoi(&test_string[str_pos+1]);
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
912 dice_flag=true;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
913 break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
914 case 'd':
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
915 if(!dice_flag)
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
916 pInfos[curr_rec_num].uTreasureDiceRolls=atoi(test_string);
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
917 pInfos[curr_rec_num].uTreasureDiceSides=atoi(&test_string[str_pos+1]);
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
918 str_pos=str_len;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
919 break;
0
Ritor1
parents:
diff changeset
920
694
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
921 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
922 ++str_pos;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
923 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
924 while(str_pos<str_len);
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
925 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
926 if (item_type_flag)
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
927 {
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
928 str_pos=0;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
929 do
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
930 {
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
931 if (tolower(test_string[str_pos])=='l')
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
932 break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
933 ++str_pos;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
934 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
935 while(str_pos<str_len);
698
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
936
694
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
937 pInfos[curr_rec_num].uTreasureLevel=test_string[str_pos+1]-'0';
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
938 item_name=&test_string[str_pos+2];
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
939 if (*item_name)
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
940 {
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
941 if ( !_strcmpi(item_name, "WEAPON"))
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
942 pInfos[curr_rec_num].uTreasureType= 20;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
943 else if ( !_strcmpi(item_name, "ARMOR"))
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
944 pInfos[curr_rec_num].uTreasureType= 21;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
945 else if ( !_strcmpi(item_name, "MISC"))
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
946 pInfos[curr_rec_num].uTreasureType= 22;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
947 else if ( !_strcmpi(item_name, "SWORD"))
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
948 pInfos[curr_rec_num].uTreasureType= 23;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
949 else if ( !_strcmpi(item_name, "DAGGER"))
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
950 pInfos[curr_rec_num].uTreasureType= 24;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
951 else if ( !_strcmpi(item_name, "AXE"))
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
952 pInfos[curr_rec_num].uTreasureType= 25;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
953 else if ( !_strcmpi(item_name, "SPEAR"))
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
954 pInfos[curr_rec_num].uTreasureType= 26;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
955 else if ( !_strcmpi(item_name, "BOW"))
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
956 pInfos[curr_rec_num].uTreasureType= 27;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
957 else if ( !_strcmpi(item_name, "MACE"))
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
958 pInfos[curr_rec_num].uTreasureType= 28;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
959 else if ( !_strcmpi(item_name, "CLUB"))
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
960 pInfos[curr_rec_num].uTreasureType= 29;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
961 else if ( !_strcmpi(item_name, "STAFF"))
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
962 pInfos[curr_rec_num].uTreasureType= 30;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
963 else if ( !_strcmpi(item_name, "LEATHER"))
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
964 pInfos[curr_rec_num].uTreasureType= 31;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
965 else if ( !_strcmpi(item_name, "CHAIN"))
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
966 pInfos[curr_rec_num].uTreasureType= 32;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
967 else if ( !_strcmpi(item_name, "PLATE"))
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
968 pInfos[curr_rec_num].uTreasureType= 33;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
969 else if ( !_strcmpi(item_name, "SHIELD"))
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
970 pInfos[curr_rec_num].uTreasureType= 34;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
971 else if ( !_strcmpi(item_name, "HELM"))
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
972 pInfos[curr_rec_num].uTreasureType= 35;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
973 else if ( !_strcmpi(item_name, "BELT"))
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
974 pInfos[curr_rec_num].uTreasureType= 36;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
975 else if ( !_strcmpi(item_name, "CAPE"))
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
976 pInfos[curr_rec_num].uTreasureType= 37;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
977 else if ( !_strcmpi(item_name, "GAUNTLETS"))
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
978 pInfos[curr_rec_num].uTreasureType= 38;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
979 else if ( !_strcmpi(item_name, "BOOTS"))
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
980 pInfos[curr_rec_num].uTreasureType= 39;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
981 else if ( !_strcmpi(item_name, "RING"))
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
982 pInfos[curr_rec_num].uTreasureType= 40;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
983 else if ( !_strcmpi(item_name, "AMULET"))
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
984 pInfos[curr_rec_num].uTreasureType= 41;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
985 else if ( !_strcmpi(item_name, "WAND"))
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
986 pInfos[curr_rec_num].uTreasureType= 42;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
987 else if ( !_strcmpi(item_name, "SCROLL"))
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
988 pInfos[curr_rec_num].uTreasureType= 43;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
989 else if ( !_strcmpi(item_name, "GEM"))
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
990 pInfos[curr_rec_num].uTreasureType= 46;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
991 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
992 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
993
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
994 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
995 break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
996 case 8:
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
997 {
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
998 pInfos[curr_rec_num].bQuestMonster=0;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
999 if (atoi(test_string))
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1000 pInfos[curr_rec_num].bQuestMonster=1;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1001 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1002 break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1003 case 9:
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1004 {
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1005 pInfos[curr_rec_num].uFlying=false;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1006 if (_strnicmp(test_string, "n",1))
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1007 pInfos[curr_rec_num].uFlying=true;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1008 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1009 break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1010 case 10:
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1011 {
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1012 switch(tolower(test_string[0]))
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1013 {
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1014 case 's': pInfos[curr_rec_num].uMovementType=0;// short
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1015 if (tolower(test_string[1])!='h')
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1016 pInfos[curr_rec_num].uMovementType=5; //??
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1017 break; //short
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1018 case 'l': pInfos[curr_rec_num].uMovementType=2; break; //long
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1019 case 'm': pInfos[curr_rec_num].uMovementType=1; break; //med
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1020 case 'g': pInfos[curr_rec_num].uMovementType=3; break; //???
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1021 default:
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1022 pInfos[curr_rec_num].uMovementType=4; //free
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1023 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1024 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1025 break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1026 case 11:
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1027 {
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1028 switch(tolower(test_string[0]))
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1029 {
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1030 case 's': pInfos[curr_rec_num].uAIType=0; break; // suicide
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1031 case 'w': pInfos[curr_rec_num].uAIType=1; break; //wimp
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1032 case 'n': pInfos[curr_rec_num].uAIType=2; break; //normal
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1033 default:
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1034 pInfos[curr_rec_num].uAIType=3; //Agress
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1035 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1036 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1037 break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1038 case 12:
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1039 pInfos[curr_rec_num].uHostilityType=(MonsterInfo::HostilityRadius)atoi(test_string);
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1040 break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1041 case 13:
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1042 pInfos[curr_rec_num].uBaseSpeed=atoi(test_string);
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1043 break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1044 case 14:
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1045 pInfos[curr_rec_num].uRecoveryTime=atoi(test_string);
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1046 break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1047 case 15:
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1048 {
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1049 int str_len=0;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1050 int str_pos=0;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1051 pInfos[curr_rec_num].uAttackPreference=0;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1052 pInfos[curr_rec_num].uNumCharactersAttackedPerSpecialAbility=0;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1053 str_len=strlen(test_string);
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1054 for (str_pos=0;str_pos<str_len;++str_pos )
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1055 {
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1056 switch(tolower(test_string[str_pos]))
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1057 {
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1058 case '0': pInfos[curr_rec_num].uAttackPreference|=0x0004; break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1059 case '2': pInfos[curr_rec_num].uNumCharactersAttackedPerSpecialAbility=2; break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1060 case '3': pInfos[curr_rec_num].uNumCharactersAttackedPerSpecialAbility=3; break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1061 case '4': pInfos[curr_rec_num].uNumCharactersAttackedPerSpecialAbility=4; break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1062 case 'c': pInfos[curr_rec_num].uAttackPreference|=0x0010; break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1063 case 'd': pInfos[curr_rec_num].uAttackPreference|=0x0008; break;
698
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1064 case 'e': pInfos[curr_rec_num].uAttackPreference|=0x1000; break;
694
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1065 case 'f': pInfos[curr_rec_num].uAttackPreference|=0x0400; break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1066 case 'h': pInfos[curr_rec_num].uAttackPreference|=0x0800; break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1067 case 'k': pInfos[curr_rec_num].uAttackPreference|=0x0001; break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1068 case 'm': pInfos[curr_rec_num].uAttackPreference|=0x0100; break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1069 case 'o': pInfos[curr_rec_num].uAttackPreference|=0x0400; break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1070 case 'p': pInfos[curr_rec_num].uAttackPreference|=0x0002; break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1071 case 'r': pInfos[curr_rec_num].uAttackPreference|=0x0040; break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1072 case 's': pInfos[curr_rec_num].uAttackPreference|=0x0020; break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1073 case 't': pInfos[curr_rec_num].uAttackPreference|=0x0080; break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1074 case 'w': pInfos[curr_rec_num].uAttackPreference|=0x2000; break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1075 case 'x': pInfos[curr_rec_num].uAttackPreference|=0x0200; break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1076 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1077 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1078 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1079 break;
698
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1080 case 16:
694
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1081 {
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1082
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1083 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1084 break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1085 case 17:
698
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1086 pInfos[curr_rec_num].uAttack1Type=ParseAttackType(test_string);
694
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1087 break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1088 case 18:
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1089 {
698
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1090 ParseDamage(test_string, &pInfos[curr_rec_num].uAttack1DamageDiceRolls,
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1091 &pInfos[curr_rec_num].uAttack1DamageDiceSides,
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1092 &pInfos[curr_rec_num].uAttack1DamageBonus);
694
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1093 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1094 break;
698
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1095 case 19:
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1096 pInfos[curr_rec_num].uMissleAttack1Type=ParseMissleAttackType(test_string);
694
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1097 break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1098 case 20:
698
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1099 pInfos[curr_rec_num].uAttack2Chance=atoi(test_string);
694
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1100 break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1101 case 21:
698
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1102 pInfos[curr_rec_num].uAttack2Type=ParseAttackType(test_string);
694
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1103 break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1104 case 22:
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1105 {
698
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1106 ParseDamage(test_string, &pInfos[curr_rec_num].uAttack2DamageDiceRolls,
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1107 &pInfos[curr_rec_num].uAttack2DamageDiceSides,
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1108 &pInfos[curr_rec_num].uAttack2DamageBonus);
694
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1109 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1110 break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1111 case 23:
698
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1112 pInfos[curr_rec_num].uMissleAttack2Type=ParseMissleAttackType(test_string);
694
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1113 break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1114 case 24:
698
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1115 pInfos[curr_rec_num].uSpell1UseChance=atoi(test_string);
694
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1116 break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1117 case 25:
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1118 {
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1119
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1120 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1121 break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1122 case 26:
698
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1123 pInfos[curr_rec_num].uSpell2UseChance=atoi(test_string);
694
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1124 break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1125 case 27:
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1126 {
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1127
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1128 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1129 break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1130 case 28:
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1131 {
698
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1132 if (tolower(test_string[0])=='i')
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1133 pInfos[curr_rec_num].uResFire=200;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1134 else
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1135 pInfos[curr_rec_num].uResFire=atoi(test_string);
694
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1136 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1137 break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1138 case 29:
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1139 {
698
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1140 if (tolower(test_string[0])=='i')
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1141 pInfos[curr_rec_num].uResAir=200;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1142 else
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1143 pInfos[curr_rec_num].uResAir=atoi(test_string);
694
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1144 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1145 break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1146 case 30:
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1147 {
698
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1148 if (tolower(test_string[0])=='i')
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1149 pInfos[curr_rec_num].uResWater=200;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1150 else
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1151 pInfos[curr_rec_num].uResWater=atoi(test_string);
694
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1152 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1153 break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1154 case 31:
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1155 {
698
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1156 if (tolower(test_string[0])=='i')
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1157 pInfos[curr_rec_num].uResEarth=200;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1158 else
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1159 pInfos[curr_rec_num].uResEarth=atoi(test_string);
694
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1160 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1161 break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1162 case 32:
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1163 {
698
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1164 if (tolower(test_string[0])=='i')
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1165 pInfos[curr_rec_num].uResMind=200;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1166 else
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1167 pInfos[curr_rec_num].uResMind=atoi(test_string);
694
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1168 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1169 break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1170 case 33:
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1171 {
698
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1172 if (tolower(test_string[0])=='i')
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1173 pInfos[curr_rec_num].uResSpirit=200;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1174 else
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1175 pInfos[curr_rec_num].uResSpirit=atoi(test_string);
694
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1176 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1177 break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1178 case 34:
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1179 {
698
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1180 if (tolower(test_string[0])=='i')
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1181 pInfos[curr_rec_num].uResBody=200;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1182 else
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1183 pInfos[curr_rec_num].uResBody=atoi(test_string);
694
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1184 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1185 break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1186 case 35:
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1187 {
698
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1188 if (tolower(test_string[0])=='i')
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1189 pInfos[curr_rec_num].uResLight=200;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1190 else
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1191 pInfos[curr_rec_num].uResLight=atoi(test_string);
694
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1192 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1193 break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1194 case 36:
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1195 {
698
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1196 if (tolower(test_string[0])=='i')
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1197 pInfos[curr_rec_num].uResDark=200;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1198 else
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1199 pInfos[curr_rec_num].uResDark=atoi(test_string);
694
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1200 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1201 break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1202 case 37:
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1203 {
698
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1204 if (tolower(test_string[0])=='i')
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1205 pInfos[curr_rec_num].uResPhysical=200;
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1206 else
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1207 pInfos[curr_rec_num].uResPhysical=atoi(test_string);
694
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1208 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1209 break;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1210 case 38:
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1211 {
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1212
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1213 }
698
b097497f07e2 monster table continue fixinf
Gloval
parents: 694
diff changeset
1214 break;
694
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1215 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1216 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1217 else
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1218 {
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1219 break_loop = true;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1220 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1221 ++decode_step;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1222 test_string=tmp_pos+1;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1223 } while ((decode_step<39)&&!break_loop);
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1224 }
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1225 uNumMonsters = i;
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1226
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1227 /*
0
Ritor1
parents:
diff changeset
1228 v103 = 0;
Ritor1
parents:
diff changeset
1229 v1->uNumMonsters = 265;
Ritor1
parents:
diff changeset
1230 do
Ritor1
parents:
diff changeset
1231 {
694
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1232 v2 = (int)(strtok(NULL, "\r") + 1);
0
Ritor1
parents:
diff changeset
1233 *(_DWORD *)&a3[1] = 0;
Ritor1
parents:
diff changeset
1234 v97 = 0;
Ritor1
parents:
diff changeset
1235 do
Ritor1
parents:
diff changeset
1236 {
Ritor1
parents:
diff changeset
1237 v3 = *(_BYTE *)v2;
Ritor1
parents:
diff changeset
1238 v4 = 0;
Ritor1
parents:
diff changeset
1239 while ( v3 != 9 && v3 )
Ritor1
parents:
diff changeset
1240 {
Ritor1
parents:
diff changeset
1241 ++v4;
Ritor1
parents:
diff changeset
1242 v3 = *(_BYTE *)(v4 + v2);
Ritor1
parents:
diff changeset
1243 }
Ritor1
parents:
diff changeset
1244 v96 = v4 + v2;
Ritor1
parents:
diff changeset
1245 if ( !*(_BYTE *)(v4 + v2) )
Ritor1
parents:
diff changeset
1246 v97 = 1;
Ritor1
parents:
diff changeset
1247 *(_BYTE *)(v4 + v2) = 0;
Ritor1
parents:
diff changeset
1248 if ( v4 )
Ritor1
parents:
diff changeset
1249 {
Ritor1
parents:
diff changeset
1250 switch ( *(_DWORD *)&a3[1] )
Ritor1
parents:
diff changeset
1251 {
694
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1252 /* case 0:
0
Ritor1
parents:
diff changeset
1253 v103 = atoi((const char *)v2);
Ritor1
parents:
diff changeset
1254 v102->pInfos[v103].uID = v103;
Ritor1
parents:
diff changeset
1255 goto LABEL_325;
Ritor1
parents:
diff changeset
1256 case 2:
694
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
1257 v102->pInfos[v103].pPictureName = RemoveQuotes((char *)v2);
0
Ritor1
parents:
diff changeset
1258 goto LABEL_325;
Ritor1
parents:
diff changeset
1259 case 1:
Ritor1
parents:
diff changeset
1260 v102->pInfos[v103].pName = RemoveQuotes((char *)v2);
Ritor1
parents:
diff changeset
1261 goto LABEL_325;
Ritor1
parents:
diff changeset
1262 case 3:
Ritor1
parents:
diff changeset
1263 v102->pInfos[v103].uLevel = atoi((const char *)v2);
Ritor1
parents:
diff changeset
1264 goto LABEL_325;
Ritor1
parents:
diff changeset
1265 case 4:
Ritor1
parents:
diff changeset
1266 if ( *(_BYTE *)v2 == 34 )
Ritor1
parents:
diff changeset
1267 *(_BYTE *)v2 = 32;
Ritor1
parents:
diff changeset
1268 v5 = strlen((const char *)v2);
Ritor1
parents:
diff changeset
1269 v6 = 0;
Ritor1
parents:
diff changeset
1270 v101 = v5;
Ritor1
parents:
diff changeset
1271 if ( (signed int)v5 <= 0 )
Ritor1
parents:
diff changeset
1272 goto LABEL_24;
Ritor1
parents:
diff changeset
1273 while ( *(_BYTE *)(v6 + v2) != 44 )
Ritor1
parents:
diff changeset
1274 {
Ritor1
parents:
diff changeset
1275 ++v6;
Ritor1
parents:
diff changeset
1276 if ( v6 >= (signed int)v5 )
Ritor1
parents:
diff changeset
1277 goto LABEL_24;
Ritor1
parents:
diff changeset
1278 }
Ritor1
parents:
diff changeset
1279 v7 = v102;
Ritor1
parents:
diff changeset
1280 v8 = v103;
Ritor1
parents:
diff changeset
1281 *(_BYTE *)(v6 + v2) = 0;
Ritor1
parents:
diff changeset
1282 pHP = &v7->pInfos[v8].uHP;
Ritor1
parents:
diff changeset
1283 *pHP = 1000 * atoi((const char *)v2);
Ritor1
parents:
diff changeset
1284 v83 = (char *)(v6 + v2 + 1);
Ritor1
parents:
diff changeset
1285 *(_BYTE *)(v6 + v2) = 44;
Ritor1
parents:
diff changeset
1286 *pHP += atoi(v83);
Ritor1
parents:
diff changeset
1287 LABEL_24:
Ritor1
parents:
diff changeset
1288 if ( v6 == v101 )
Ritor1
parents:
diff changeset
1289 v102->pInfos[v103].uHP = atoi((const char *)v2);
Ritor1
parents:
diff changeset
1290 goto LABEL_325;
Ritor1
parents:
diff changeset
1291 case 5:
Ritor1
parents:
diff changeset
1292 v102->pInfos[v103].uAC = atoi((const char *)v2);
Ritor1
parents:
diff changeset
1293 goto LABEL_325;
Ritor1
parents:
diff changeset
1294 case 6:
Ritor1
parents:
diff changeset
1295 if ( *(_BYTE *)v2 == 34 )
Ritor1
parents:
diff changeset
1296 *(_BYTE *)v2 = 32;
Ritor1
parents:
diff changeset
1297 v10 = strlen((const char *)v2);
Ritor1
parents:
diff changeset
1298 v11 = 0;
Ritor1
parents:
diff changeset
1299 v101 = v10;
Ritor1
parents:
diff changeset
1300 if ( (signed int)v10 <= 0 )
Ritor1
parents:
diff changeset
1301 goto LABEL_34;
Ritor1
parents:
diff changeset
1302 while ( *(_BYTE *)(v11 + v2) != 44 )
Ritor1
parents:
diff changeset
1303 {
Ritor1
parents:
diff changeset
1304 ++v11;
Ritor1
parents:
diff changeset
1305 if ( v11 >= (signed int)v10 )
Ritor1
parents:
diff changeset
1306 goto LABEL_34;
Ritor1
parents:
diff changeset
1307 }
Ritor1
parents:
diff changeset
1308 v12 = v102;
Ritor1
parents:
diff changeset
1309 v13 = v103;
Ritor1
parents:
diff changeset
1310 *(_BYTE *)(v11 + v2) = 0;
Ritor1
parents:
diff changeset
1311 pExp = &v12->pInfos[v13].uExp;
Ritor1
parents:
diff changeset
1312 *pExp = 1000 * atoi((const char *)v2);
Ritor1
parents:
diff changeset
1313 v83 = (char *)(v11 + v2 + 1);
Ritor1
parents:
diff changeset
1314 *(_BYTE *)(v11 + v2) = 44;
Ritor1
parents:
diff changeset
1315 *pExp += atoi(v83);
Ritor1
parents:
diff changeset
1316 LABEL_34:
Ritor1
parents:
diff changeset
1317 if ( v11 == v101 )
Ritor1
parents:
diff changeset
1318 v102->pInfos[v103].uExp = atoi((const char *)v2);
Ritor1
parents:
diff changeset
1319 goto LABEL_325;
Ritor1
parents:
diff changeset
1320 case 7:
Ritor1
parents:
diff changeset
1321 v15 = 0;
Ritor1
parents:
diff changeset
1322 a2 = 0;
Ritor1
parents:
diff changeset
1323 v100 = 0;
Ritor1
parents:
diff changeset
1324 v16 = 0;
Ritor1
parents:
diff changeset
1325 v101 = strlen((const char *)v2);
Ritor1
parents:
diff changeset
1326 if ( (signed int)v101 <= 0 )
Ritor1
parents:
diff changeset
1327 goto LABEL_325;
Ritor1
parents:
diff changeset
1328 do
Ritor1
parents:
diff changeset
1329 {
Ritor1
parents:
diff changeset
1330 v84 = (char *)*(_BYTE *)(v16 + v2);
Ritor1
parents:
diff changeset
1331 v17 = tolower((int)v84);
Ritor1
parents:
diff changeset
1332 switch ( v17 )
Ritor1
parents:
diff changeset
1333 {
Ritor1
parents:
diff changeset
1334 case 37:
Ritor1
parents:
diff changeset
1335 v15 = 1;
Ritor1
parents:
diff changeset
1336 break;
Ritor1
parents:
diff changeset
1337 case 100:
Ritor1
parents:
diff changeset
1338 v100 = 1;
Ritor1
parents:
diff changeset
1339 break;
Ritor1
parents:
diff changeset
1340 case 108:
Ritor1
parents:
diff changeset
1341 a2 = 1;
Ritor1
parents:
diff changeset
1342 break;
Ritor1
parents:
diff changeset
1343 }
Ritor1
parents:
diff changeset
1344 ++v16;
Ritor1
parents:
diff changeset
1345 }
Ritor1
parents:
diff changeset
1346 while ( (signed int)v16 < (signed int)v101 );
Ritor1
parents:
diff changeset
1347 if ( v15 )
Ritor1
parents:
diff changeset
1348 {
Ritor1
parents:
diff changeset
1349 v18 = &v102->pInfos[v103];
Ritor1
parents:
diff changeset
1350 v18->uTreasureDropChance = atoi((const char *)v2);
Ritor1
parents:
diff changeset
1351 }
Ritor1
parents:
diff changeset
1352 else
Ritor1
parents:
diff changeset
1353 {
Ritor1
parents:
diff changeset
1354 if ( !v100 && !a2 )
Ritor1
parents:
diff changeset
1355 goto LABEL_325;
Ritor1
parents:
diff changeset
1356 v18 = &v102->pInfos[v103];
Ritor1
parents:
diff changeset
1357 v18->uTreasureDropChance = 100;
Ritor1
parents:
diff changeset
1358 }
Ritor1
parents:
diff changeset
1359 if ( v100 )
Ritor1
parents:
diff changeset
1360 {
Ritor1
parents:
diff changeset
1361 v19 = 0;
Ritor1
parents:
diff changeset
1362 v100 = 0;
Ritor1
parents:
diff changeset
1363 do
Ritor1
parents:
diff changeset
1364 {
Ritor1
parents:
diff changeset
1365 v84 = (char *)*(_BYTE *)(v19 + v2);
Ritor1
parents:
diff changeset
1366 v20 = tolower((int)v84);
Ritor1
parents:
diff changeset
1367 if ( v20 == 37 )
Ritor1
parents:
diff changeset
1368 {
Ritor1
parents:
diff changeset
1369 v84 = (char *)(v19 + v2 + 1);
Ritor1
parents:
diff changeset
1370 v18->uTreasureDiceRolls = atoi(v84);
Ritor1
parents:
diff changeset
1371 v100 = 1;
Ritor1
parents:
diff changeset
1372 }
Ritor1
parents:
diff changeset
1373 else
Ritor1
parents:
diff changeset
1374 {
Ritor1
parents:
diff changeset
1375 if ( v20 == 100 )
Ritor1
parents:
diff changeset
1376 {
Ritor1
parents:
diff changeset
1377 if ( !v100 )
Ritor1
parents:
diff changeset
1378 v18->uTreasureDiceRolls = atoi((const char *)v2);
Ritor1
parents:
diff changeset
1379 v84 = (char *)(v19 + v2 + 1);
Ritor1
parents:
diff changeset
1380 v21 = atoi(v84);
Ritor1
parents:
diff changeset
1381 v19 = v101;
Ritor1
parents:
diff changeset
1382 v18->uTreasureDiceSides = v21;
Ritor1
parents:
diff changeset
1383 }
Ritor1
parents:
diff changeset
1384 }
Ritor1
parents:
diff changeset
1385 ++v19;
Ritor1
parents:
diff changeset
1386 }
Ritor1
parents:
diff changeset
1387 while ( (signed int)v19 < (signed int)v101 );
Ritor1
parents:
diff changeset
1388 }
Ritor1
parents:
diff changeset
1389 if ( a2 )
Ritor1
parents:
diff changeset
1390 {
Ritor1
parents:
diff changeset
1391 v22 = 0;
Ritor1
parents:
diff changeset
1392 while ( 1 )
Ritor1
parents:
diff changeset
1393 {
Ritor1
parents:
diff changeset
1394 v84 = (char *)*(_BYTE *)(v22 + v2);
Ritor1
parents:
diff changeset
1395 if ( tolower((int)v84) == 108 )
Ritor1
parents:
diff changeset
1396 break;
Ritor1
parents:
diff changeset
1397 ++v22;
Ritor1
parents:
diff changeset
1398 if ( (signed int)v22 >= (signed int)v101 )
Ritor1
parents:
diff changeset
1399 goto LABEL_325;
Ritor1
parents:
diff changeset
1400 }
Ritor1
parents:
diff changeset
1401 v23 = *(_BYTE *)(v22 + v2 + 1);
Ritor1
parents:
diff changeset
1402 v24 = (const char *)(v22 + v2 + 2);
Ritor1
parents:
diff changeset
1403 v18->uTreasureLevel = v23 - 48;
Ritor1
parents:
diff changeset
1404 if ( *v24 )
Ritor1
parents:
diff changeset
1405 {
Ritor1
parents:
diff changeset
1406 if ( _strcmpi(v24, "WEAPON") )
Ritor1
parents:
diff changeset
1407 {
Ritor1
parents:
diff changeset
1408 if ( _strcmpi(v24, "ARMOR") )
Ritor1
parents:
diff changeset
1409 {
Ritor1
parents:
diff changeset
1410 if ( _strcmpi(v24, "MISC") )
Ritor1
parents:
diff changeset
1411 {
Ritor1
parents:
diff changeset
1412 if ( _strcmpi(v24, "SWORD") )
Ritor1
parents:
diff changeset
1413 {
Ritor1
parents:
diff changeset
1414 if ( _strcmpi(v24, "DAGGER") )
Ritor1
parents:
diff changeset
1415 {
Ritor1
parents:
diff changeset
1416 if ( _strcmpi(v24, "AXE") )
Ritor1
parents:
diff changeset
1417 {
Ritor1
parents:
diff changeset
1418 if ( _strcmpi(v24, "SPEAR") )
Ritor1
parents:
diff changeset
1419 {
Ritor1
parents:
diff changeset
1420 if ( _strcmpi(v24, "BOW") )
Ritor1
parents:
diff changeset
1421 {
Ritor1
parents:
diff changeset
1422 if ( _strcmpi(v24, "MACE") )
Ritor1
parents:
diff changeset
1423 {
Ritor1
parents:
diff changeset
1424 if ( _strcmpi(v24, "CLUB") )
Ritor1
parents:
diff changeset
1425 {
Ritor1
parents:
diff changeset
1426 if ( _strcmpi(v24, "STAFF") )
Ritor1
parents:
diff changeset
1427 {
Ritor1
parents:
diff changeset
1428 if ( _strcmpi(v24, "LEATHER") )
Ritor1
parents:
diff changeset
1429 {
Ritor1
parents:
diff changeset
1430 if ( _strcmpi(v24, "CHAIN") )
Ritor1
parents:
diff changeset
1431 {
Ritor1
parents:
diff changeset
1432 if ( _strcmpi(v24, "PLATE") )
Ritor1
parents:
diff changeset
1433 {
Ritor1
parents:
diff changeset
1434 if ( _strcmpi(v24, "SHIELD") )
Ritor1
parents:
diff changeset
1435 {
Ritor1
parents:
diff changeset
1436 if ( _strcmpi(v24, "HELM") )
Ritor1
parents:
diff changeset
1437 {
Ritor1
parents:
diff changeset
1438 if ( _strcmpi(v24, "BELT") )
Ritor1
parents:
diff changeset
1439 {
Ritor1
parents:
diff changeset
1440 if ( _strcmpi(v24, "CAPE") )
Ritor1
parents:
diff changeset
1441 {
Ritor1
parents:
diff changeset
1442 if ( _strcmpi(v24, "GAUNTLETS") )
Ritor1
parents:
diff changeset
1443 {
Ritor1
parents:
diff changeset
1444 if ( _strcmpi(v24, "BOOTS") )
Ritor1
parents:
diff changeset
1445 {
Ritor1
parents:
diff changeset
1446 if ( _strcmpi(v24, "RING") )
Ritor1
parents:
diff changeset
1447 {
Ritor1
parents:
diff changeset
1448 if ( _strcmpi(v24, "AMULET") )
Ritor1
parents:
diff changeset
1449 {
Ritor1
parents:
diff changeset
1450 if ( _strcmpi(v24, "WAND") )
Ritor1
parents:
diff changeset
1451 {
Ritor1
parents:
diff changeset
1452 if ( _strcmpi(v24, "SCROLL") )
Ritor1
parents:
diff changeset
1453 {
Ritor1
parents:
diff changeset
1454 if ( !_strcmpi(v24, "GEM") )
Ritor1
parents:
diff changeset
1455 v18->uTreasureType = 46;
Ritor1
parents:
diff changeset
1456 }
Ritor1
parents:
diff changeset
1457 else
Ritor1
parents:
diff changeset
1458 {
Ritor1
parents:
diff changeset
1459 v18->uTreasureType = 43;
Ritor1
parents:
diff changeset
1460 }
Ritor1
parents:
diff changeset
1461 }
Ritor1
parents:
diff changeset
1462 else
Ritor1
parents:
diff changeset
1463 {
Ritor1
parents:
diff changeset
1464 v18->uTreasureType = 42;
Ritor1
parents:
diff changeset
1465 }
Ritor1
parents:
diff changeset
1466 }
Ritor1
parents:
diff changeset
1467 else
Ritor1
parents:
diff changeset
1468 {
Ritor1
parents:
diff changeset
1469 v18->uTreasureType = 41;
Ritor1
parents:
diff changeset
1470 }
Ritor1
parents:
diff changeset
1471 }
Ritor1
parents:
diff changeset
1472 else
Ritor1
parents:
diff changeset
1473 {
Ritor1
parents:
diff changeset
1474 v18->uTreasureType = 40;
Ritor1
parents:
diff changeset
1475 }
Ritor1
parents:
diff changeset
1476 }
Ritor1
parents:
diff changeset
1477 else
Ritor1
parents:
diff changeset
1478 {
Ritor1
parents:
diff changeset
1479 v18->uTreasureType = 39;
Ritor1
parents:
diff changeset
1480 }
Ritor1
parents:
diff changeset
1481 }
Ritor1
parents:
diff changeset
1482 else
Ritor1
parents:
diff changeset
1483 {
Ritor1
parents:
diff changeset
1484 v18->uTreasureType = 38;
Ritor1
parents:
diff changeset
1485 }
Ritor1
parents:
diff changeset
1486 }
Ritor1
parents:
diff changeset
1487 else
Ritor1
parents:
diff changeset
1488 {
Ritor1
parents:
diff changeset
1489 v18->uTreasureType = 37;
Ritor1
parents:
diff changeset
1490 }
Ritor1
parents:
diff changeset
1491 }
Ritor1
parents:
diff changeset
1492 else
Ritor1
parents:
diff changeset
1493 {
Ritor1
parents:
diff changeset
1494 v18->uTreasureType = 36;
Ritor1
parents:
diff changeset
1495 }
Ritor1
parents:
diff changeset
1496 }
Ritor1
parents:
diff changeset
1497 else
Ritor1
parents:
diff changeset
1498 {
Ritor1
parents:
diff changeset
1499 v18->uTreasureType = 35;
Ritor1
parents:
diff changeset
1500 }
Ritor1
parents:
diff changeset
1501 }
Ritor1
parents:
diff changeset
1502 else
Ritor1
parents:
diff changeset
1503 {
Ritor1
parents:
diff changeset
1504 v18->uTreasureType = 34;
Ritor1
parents:
diff changeset
1505 }
Ritor1
parents:
diff changeset
1506 }
Ritor1
parents:
diff changeset
1507 else
Ritor1
parents:
diff changeset
1508 {
Ritor1
parents:
diff changeset
1509 v18->uTreasureType = 33;
Ritor1
parents:
diff changeset
1510 }
Ritor1
parents:
diff changeset
1511 }
Ritor1
parents:
diff changeset
1512 else
Ritor1
parents:
diff changeset
1513 {
Ritor1
parents:
diff changeset
1514 v18->uTreasureType = 32;
Ritor1
parents:
diff changeset
1515 }
Ritor1
parents:
diff changeset
1516 }
Ritor1
parents:
diff changeset
1517 else
Ritor1
parents:
diff changeset
1518 {
Ritor1
parents:
diff changeset
1519 v18->uTreasureType = 31;
Ritor1
parents:
diff changeset
1520 }
Ritor1
parents:
diff changeset
1521 }
Ritor1
parents:
diff changeset
1522 else
Ritor1
parents:
diff changeset
1523 {
Ritor1
parents:
diff changeset
1524 v18->uTreasureType = 30;
Ritor1
parents:
diff changeset
1525 }
Ritor1
parents:
diff changeset
1526 }
Ritor1
parents:
diff changeset
1527 else
Ritor1
parents:
diff changeset
1528 {
Ritor1
parents:
diff changeset
1529 v18->uTreasureType = 29;
Ritor1
parents:
diff changeset
1530 }
Ritor1
parents:
diff changeset
1531 }
Ritor1
parents:
diff changeset
1532 else
Ritor1
parents:
diff changeset
1533 {
Ritor1
parents:
diff changeset
1534 v18->uTreasureType = 28;
Ritor1
parents:
diff changeset
1535 }
Ritor1
parents:
diff changeset
1536 }
Ritor1
parents:
diff changeset
1537 else
Ritor1
parents:
diff changeset
1538 {
Ritor1
parents:
diff changeset
1539 v18->uTreasureType = 27;
Ritor1
parents:
diff changeset
1540 }
Ritor1
parents:
diff changeset
1541 }
Ritor1
parents:
diff changeset
1542 else
Ritor1
parents:
diff changeset
1543 {
Ritor1
parents:
diff changeset
1544 v18->uTreasureType = 26;
Ritor1
parents:
diff changeset
1545 }
Ritor1
parents:
diff changeset
1546 }
Ritor1
parents:
diff changeset
1547 else
Ritor1
parents:
diff changeset
1548 {
Ritor1
parents:
diff changeset
1549 v18->uTreasureType = 25;
Ritor1
parents:
diff changeset
1550 }
Ritor1
parents:
diff changeset
1551 }
Ritor1
parents:
diff changeset
1552 else
Ritor1
parents:
diff changeset
1553 {
Ritor1
parents:
diff changeset
1554 v18->uTreasureType = 24;
Ritor1
parents:
diff changeset
1555 }
Ritor1
parents:
diff changeset
1556 }
Ritor1
parents:
diff changeset
1557 else
Ritor1
parents:
diff changeset
1558 {
Ritor1
parents:
diff changeset
1559 v18->uTreasureType = 23;
Ritor1
parents:
diff changeset
1560 }
Ritor1
parents:
diff changeset
1561 }
Ritor1
parents:
diff changeset
1562 else
Ritor1
parents:
diff changeset
1563 {
Ritor1
parents:
diff changeset
1564 v18->uTreasureType = 22;
Ritor1
parents:
diff changeset
1565 }
Ritor1
parents:
diff changeset
1566 }
Ritor1
parents:
diff changeset
1567 else
Ritor1
parents:
diff changeset
1568 {
Ritor1
parents:
diff changeset
1569 v18->uTreasureType = 21;
Ritor1
parents:
diff changeset
1570 }
Ritor1
parents:
diff changeset
1571 }
Ritor1
parents:
diff changeset
1572 else
Ritor1
parents:
diff changeset
1573 {
Ritor1
parents:
diff changeset
1574 v18->uTreasureType = 20;
Ritor1
parents:
diff changeset
1575 }
Ritor1
parents:
diff changeset
1576 }
Ritor1
parents:
diff changeset
1577 }
Ritor1
parents:
diff changeset
1578 goto LABEL_325;
Ritor1
parents:
diff changeset
1579 case 8:
Ritor1
parents:
diff changeset
1580 v84 = (char *)v2;
Ritor1
parents:
diff changeset
1581 v25 = &v102->pInfos[v103].bQuestMonster;
Ritor1
parents:
diff changeset
1582 *v25 = 0;
Ritor1
parents:
diff changeset
1583 if ( atoi(v84) )
Ritor1
parents:
diff changeset
1584 *(_BYTE *)v25 |= 1u;
Ritor1
parents:
diff changeset
1585 goto LABEL_325;
Ritor1
parents:
diff changeset
1586 case 9:
Ritor1
parents:
diff changeset
1587 v102->pInfos[v103].uFlying = _strnicmp((const char *)v2, "n", 1u);
Ritor1
parents:
diff changeset
1588 goto LABEL_325;
Ritor1
parents:
diff changeset
1589 case 0xA:
Ritor1
parents:
diff changeset
1590 v84 = (char *)*(_BYTE *)v2;
Ritor1
parents:
diff changeset
1591 v101 = 4;
Ritor1
parents:
diff changeset
1592 if ( tolower((int)v84) == 's' )
Ritor1
parents:
diff changeset
1593 {
Ritor1
parents:
diff changeset
1594 v84 = (char *)*(_BYTE *)(v2 + 1);
Ritor1
parents:
diff changeset
1595 v26 = tolower((int)v84) != 'h' ? 5 : 0;
Ritor1
parents:
diff changeset
1596 }
Ritor1
parents:
diff changeset
1597 else
Ritor1
parents:
diff changeset
1598 {
Ritor1
parents:
diff changeset
1599 v84 = (char *)*(_BYTE *)v2;
Ritor1
parents:
diff changeset
1600 if ( tolower((int)v84) == 'm' )
Ritor1
parents:
diff changeset
1601 {
Ritor1
parents:
diff changeset
1602 v101 = 1;
Ritor1
parents:
diff changeset
1603 }
Ritor1
parents:
diff changeset
1604 else
Ritor1
parents:
diff changeset
1605 {
Ritor1
parents:
diff changeset
1606 v84 = (char *)*(_BYTE *)v2;
Ritor1
parents:
diff changeset
1607 if ( tolower((int)v84) == 'l' )
Ritor1
parents:
diff changeset
1608 {
Ritor1
parents:
diff changeset
1609 v101 = 2;
Ritor1
parents:
diff changeset
1610 }
Ritor1
parents:
diff changeset
1611 else
Ritor1
parents:
diff changeset
1612 {
Ritor1
parents:
diff changeset
1613 v84 = (char *)*(_BYTE *)v2;
Ritor1
parents:
diff changeset
1614 if ( tolower((int)v84) == 'g' )
Ritor1
parents:
diff changeset
1615 v101 = 3;
Ritor1
parents:
diff changeset
1616 }
Ritor1
parents:
diff changeset
1617 }
Ritor1
parents:
diff changeset
1618 LOBYTE(v26) = v101;
Ritor1
parents:
diff changeset
1619 }
Ritor1
parents:
diff changeset
1620 v102->pInfos[v103].uMovementType = v26;
Ritor1
parents:
diff changeset
1621 goto LABEL_325;
Ritor1
parents:
diff changeset
1622 case 0xB:
Ritor1
parents:
diff changeset
1623 v84 = (char *)*(_BYTE *)v2;
Ritor1
parents:
diff changeset
1624 v101 = 3;
Ritor1
parents:
diff changeset
1625 if ( tolower((int)v84) == 's' )
Ritor1
parents:
diff changeset
1626 {
Ritor1
parents:
diff changeset
1627 v101 = 0;
Ritor1
parents:
diff changeset
1628 }
Ritor1
parents:
diff changeset
1629 else
Ritor1
parents:
diff changeset
1630 {
Ritor1
parents:
diff changeset
1631 v84 = (char *)*(_BYTE *)v2;
Ritor1
parents:
diff changeset
1632 if ( tolower((int)v84) == 'w' )
Ritor1
parents:
diff changeset
1633 {
Ritor1
parents:
diff changeset
1634 v101 = 1;
Ritor1
parents:
diff changeset
1635 }
Ritor1
parents:
diff changeset
1636 else
Ritor1
parents:
diff changeset
1637 {
Ritor1
parents:
diff changeset
1638 v84 = (char *)*(_BYTE *)v2;
Ritor1
parents:
diff changeset
1639 if ( tolower((int)v84) == 'n' )
Ritor1
parents:
diff changeset
1640 v101 = 2;
Ritor1
parents:
diff changeset
1641 }
Ritor1
parents:
diff changeset
1642 }
Ritor1
parents:
diff changeset
1643 v102->pInfos[v103].uAIType = v101;
Ritor1
parents:
diff changeset
1644 goto LABEL_325;
Ritor1
parents:
diff changeset
1645 case 0xC:
Ritor1
parents:
diff changeset
1646 v102->pInfos[v103].uHostilityType = (MonsterInfo::HostilityRadius)atoi((const char *)v2);
Ritor1
parents:
diff changeset
1647 goto LABEL_325;
Ritor1
parents:
diff changeset
1648 case 0xD:
Ritor1
parents:
diff changeset
1649 v102->pInfos[v103].uBaseSpeed = atoi((const char *)v2);
Ritor1
parents:
diff changeset
1650 goto LABEL_325;
Ritor1
parents:
diff changeset
1651 case 0xF:
Ritor1
parents:
diff changeset
1652 v27 = strlen((const char *)v2);
Ritor1
parents:
diff changeset
1653 v100 = 0;
Ritor1
parents:
diff changeset
1654 v101 = v27;
Ritor1
parents:
diff changeset
1655 if ( (signed int)v27 > 0 )
Ritor1
parents:
diff changeset
1656 {
Ritor1
parents:
diff changeset
1657 v28 = v103;
Ritor1
parents:
diff changeset
1658 v29 = v102;
Ritor1
parents:
diff changeset
1659 do
Ritor1
parents:
diff changeset
1660 {
Ritor1
parents:
diff changeset
1661 v84 = (char *)*(_BYTE *)(v100 + v2);
Ritor1
parents:
diff changeset
1662 v30 = tolower((int)v84);
Ritor1
parents:
diff changeset
1663 if ( v30 > 107 )
Ritor1
parents:
diff changeset
1664 {
Ritor1
parents:
diff changeset
1665 if ( v30 > 115 )
Ritor1
parents:
diff changeset
1666 {
Ritor1
parents:
diff changeset
1667 v40 = v30 - 116;
Ritor1
parents:
diff changeset
1668 if ( v40 )
Ritor1
parents:
diff changeset
1669 {
Ritor1
parents:
diff changeset
1670 v41 = v40 - 3;
Ritor1
parents:
diff changeset
1671 if ( v41 )
Ritor1
parents:
diff changeset
1672 {
Ritor1
parents:
diff changeset
1673 if ( v41 == 1 )
Ritor1
parents:
diff changeset
1674 BYTE1(v29->pInfos[v28].uAttackPreference) |= 2u;
Ritor1
parents:
diff changeset
1675 }
Ritor1
parents:
diff changeset
1676 else
Ritor1
parents:
diff changeset
1677 {
Ritor1
parents:
diff changeset
1678 BYTE1(v29->pInfos[v28].uAttackPreference) |= 0x20u;
Ritor1
parents:
diff changeset
1679 }
Ritor1
parents:
diff changeset
1680 }
Ritor1
parents:
diff changeset
1681 else
Ritor1
parents:
diff changeset
1682 {
Ritor1
parents:
diff changeset
1683 LOBYTE(v29->pInfos[v28].uAttackPreference) |= 0x80u;
Ritor1
parents:
diff changeset
1684 }
Ritor1
parents:
diff changeset
1685 }
Ritor1
parents:
diff changeset
1686 else
Ritor1
parents:
diff changeset
1687 {
Ritor1
parents:
diff changeset
1688 if ( v30 == 115 )
Ritor1
parents:
diff changeset
1689 {
Ritor1
parents:
diff changeset
1690 v29->pInfos[v28].uAttackPreference |= 0x20u;
Ritor1
parents:
diff changeset
1691 }
Ritor1
parents:
diff changeset
1692 else
Ritor1
parents:
diff changeset
1693 {
Ritor1
parents:
diff changeset
1694 v37 = v30 - 109;
Ritor1
parents:
diff changeset
1695 if ( v37 )
Ritor1
parents:
diff changeset
1696 {
Ritor1
parents:
diff changeset
1697 v38 = v37 - 2;
Ritor1
parents:
diff changeset
1698 if ( v38 )
Ritor1
parents:
diff changeset
1699 {
Ritor1
parents:
diff changeset
1700 v39 = v38 - 1;
Ritor1
parents:
diff changeset
1701 if ( v39 )
Ritor1
parents:
diff changeset
1702 {
Ritor1
parents:
diff changeset
1703 if ( v39 == 2 )
Ritor1
parents:
diff changeset
1704 v29->pInfos[v28].uAttackPreference |= 0x40u;
Ritor1
parents:
diff changeset
1705 }
Ritor1
parents:
diff changeset
1706 else
Ritor1
parents:
diff changeset
1707 {
Ritor1
parents:
diff changeset
1708 v29->pInfos[v28].uAttackPreference |= 2u;
Ritor1
parents:
diff changeset
1709 }
Ritor1
parents:
diff changeset
1710 }
Ritor1
parents:
diff changeset
1711 else
Ritor1
parents:
diff changeset
1712 {
Ritor1
parents:
diff changeset
1713 BYTE1(v29->pInfos[v28].uAttackPreference) |= 4u;
Ritor1
parents:
diff changeset
1714 }
Ritor1
parents:
diff changeset
1715 }
Ritor1
parents:
diff changeset
1716 else
Ritor1
parents:
diff changeset
1717 {
Ritor1
parents:
diff changeset
1718 BYTE1(v29->pInfos[v28].uAttackPreference) |= 1u;
Ritor1
parents:
diff changeset
1719 }
Ritor1
parents:
diff changeset
1720 }
Ritor1
parents:
diff changeset
1721 }
Ritor1
parents:
diff changeset
1722 }
Ritor1
parents:
diff changeset
1723 else
Ritor1
parents:
diff changeset
1724 {
Ritor1
parents:
diff changeset
1725 if ( v30 == 107 )
Ritor1
parents:
diff changeset
1726 {
Ritor1
parents:
diff changeset
1727 v29->pInfos[v28].uAttackPreference |= 1u;
Ritor1
parents:
diff changeset
1728 }
Ritor1
parents:
diff changeset
1729 else
Ritor1
parents:
diff changeset
1730 {
Ritor1
parents:
diff changeset
1731 if ( v30 > 99 )
Ritor1
parents:
diff changeset
1732 {
Ritor1
parents:
diff changeset
1733 v34 = v30 - 100;
Ritor1
parents:
diff changeset
1734 if ( v34 )
Ritor1
parents:
diff changeset
1735 {
Ritor1
parents:
diff changeset
1736 v35 = v34 - 1;
Ritor1
parents:
diff changeset
1737 if ( v35 )
Ritor1
parents:
diff changeset
1738 {
Ritor1
parents:
diff changeset
1739 v36 = v35 - 2;
Ritor1
parents:
diff changeset
1740 if ( v36 )
Ritor1
parents:
diff changeset
1741 {
Ritor1
parents:
diff changeset
1742 if ( v36 == 1 )
Ritor1
parents:
diff changeset
1743 BYTE1(v29->pInfos[v28].uAttackPreference) |= 8u;
Ritor1
parents:
diff changeset
1744 }
Ritor1
parents:
diff changeset
1745 else
Ritor1
parents:
diff changeset
1746 {
Ritor1
parents:
diff changeset
1747 BYTE1(v29->pInfos[v28].uAttackPreference) |= 0x40u;
Ritor1
parents:
diff changeset
1748 }
Ritor1
parents:
diff changeset
1749 }
Ritor1
parents:
diff changeset
1750 else
Ritor1
parents:
diff changeset
1751 {
Ritor1
parents:
diff changeset
1752 BYTE1(v29->pInfos[v28].uAttackPreference) |= 0x10u;
Ritor1
parents:
diff changeset
1753 }
Ritor1
parents:
diff changeset
1754 }
Ritor1
parents:
diff changeset
1755 else
Ritor1
parents:
diff changeset
1756 {
Ritor1
parents:
diff changeset
1757 v29->pInfos[v28].uAttackPreference |= 8u;
Ritor1
parents:
diff changeset
1758 }
Ritor1
parents:
diff changeset
1759 }
Ritor1
parents:
diff changeset
1760 else
Ritor1
parents:
diff changeset
1761 {
Ritor1
parents:
diff changeset
1762 if ( v30 == 99 )
Ritor1
parents:
diff changeset
1763 {
Ritor1
parents:
diff changeset
1764 v29->pInfos[v28].uAttackPreference |= 0x10u;
Ritor1
parents:
diff changeset
1765 }
Ritor1
parents:
diff changeset
1766 else
Ritor1
parents:
diff changeset
1767 {
Ritor1
parents:
diff changeset
1768 v31 = v30 - 50;
Ritor1
parents:
diff changeset
1769 if ( v31 )
Ritor1
parents:
diff changeset
1770 {
Ritor1
parents:
diff changeset
1771 v32 = v31 - 1;
Ritor1
parents:
diff changeset
1772 if ( v32 )
Ritor1
parents:
diff changeset
1773 {
Ritor1
parents:
diff changeset
1774 v33 = v32 - 1;
Ritor1
parents:
diff changeset
1775 if ( v33 )
Ritor1
parents:
diff changeset
1776 {
Ritor1
parents:
diff changeset
1777 if ( v33 == 45 )
Ritor1
parents:
diff changeset
1778 v29->pInfos[v28].uAttackPreference |= 4u;
Ritor1
parents:
diff changeset
1779 }
Ritor1
parents:
diff changeset
1780 else
Ritor1
parents:
diff changeset
1781 {
Ritor1
parents:
diff changeset
1782 v29->pInfos[v28].uNumCharactersAttackedPerSpecialAbility = 4;
Ritor1
parents:
diff changeset
1783 }
Ritor1
parents:
diff changeset
1784 }
Ritor1
parents:
diff changeset
1785 else
Ritor1
parents:
diff changeset
1786 {
Ritor1
parents:
diff changeset
1787 v29->pInfos[v28].uNumCharactersAttackedPerSpecialAbility = 3;
Ritor1
parents:
diff changeset
1788 }
Ritor1
parents:
diff changeset
1789 }
Ritor1
parents:
diff changeset
1790 else
Ritor1
parents:
diff changeset
1791 {
Ritor1
parents:
diff changeset
1792 v29->pInfos[v28].uNumCharactersAttackedPerSpecialAbility = 2;
Ritor1
parents:
diff changeset
1793 }
Ritor1
parents:
diff changeset
1794 }
Ritor1
parents:
diff changeset
1795 }
Ritor1
parents:
diff changeset
1796 }
Ritor1
parents:
diff changeset
1797 }
Ritor1
parents:
diff changeset
1798 ++v100;
Ritor1
parents:
diff changeset
1799 }
Ritor1
parents:
diff changeset
1800 while ( v100 < (signed int)v101 );
Ritor1
parents:
diff changeset
1801 }
Ritor1
parents:
diff changeset
1802 goto LABEL_325;
Ritor1
parents:
diff changeset
1803 case 0xE:
Ritor1
parents:
diff changeset
1804 v102->pInfos[v103].uRecoveryTime = atoi((const char *)v2);
Ritor1
parents:
diff changeset
1805 goto LABEL_325;
Ritor1
parents:
diff changeset
1806 case 0x10:
Ritor1
parents:
diff changeset
1807 v42 = strlen((const char *)v2);
Ritor1
parents:
diff changeset
1808 v43 = 0;
Ritor1
parents:
diff changeset
1809 v44 = &v102->pInfos[v103];
Ritor1
parents:
diff changeset
1810 v100 = v42;
Ritor1
parents:
diff changeset
1811 v44->uSpecialAttackType = 1;
Ritor1
parents:
diff changeset
1812 if ( (signed int)v42 <= 0 )
Ritor1
parents:
diff changeset
1813 goto LABEL_185;
Ritor1
parents:
diff changeset
1814 break;
Ritor1
parents:
diff changeset
1815 case 0x11:
Ritor1
parents:
diff changeset
1816 v102->pInfos[v103].uAttack1Type = ParseAttackType((unsigned __int8 *)v2);
Ritor1
parents:
diff changeset
1817 goto LABEL_325;
Ritor1
parents:
diff changeset
1818 case 0x12:
Ritor1
parents:
diff changeset
1819 v46 = &v102->pInfos[v103];
Ritor1
parents:
diff changeset
1820 v47 = (char *)&v46->uAttack1DamageDiceRolls;
Ritor1
parents:
diff changeset
1821 v84 = (char *)&v46->uAttack1DamageBonus;
Ritor1
parents:
diff changeset
1822 v48 = (char *)&v46->uAttack1DamageDiceSides;
Ritor1
parents:
diff changeset
1823 goto LABEL_237;
Ritor1
parents:
diff changeset
1824 case 0x13:
Ritor1
parents:
diff changeset
1825 v102->pInfos[v103].uMissleAttack1Type = ParseMissleAttackType((const char *)v2);
Ritor1
parents:
diff changeset
1826 goto LABEL_325;
Ritor1
parents:
diff changeset
1827 case 0x14:
Ritor1
parents:
diff changeset
1828 v102->pInfos[v103].uAttack2Chance = atoi((const char *)v2);
Ritor1
parents:
diff changeset
1829 goto LABEL_325;
Ritor1
parents:
diff changeset
1830 case 0x15:
Ritor1
parents:
diff changeset
1831 v102->pInfos[v103].uAttack2Type = ParseAttackType((unsigned __int8 *)v2);
Ritor1
parents:
diff changeset
1832 goto LABEL_325;
Ritor1
parents:
diff changeset
1833 case 0x16:
Ritor1
parents:
diff changeset
1834 v49 = &v102->pInfos[v103];
Ritor1
parents:
diff changeset
1835 v47 = (char *)&v49->uAttack2DamageDiceRolls;
Ritor1
parents:
diff changeset
1836 v84 = (char *)&v49->uAttack2DamageBonus;
Ritor1
parents:
diff changeset
1837 v48 = (char *)&v49->uAttack2DamageDiceSides;
Ritor1
parents:
diff changeset
1838 LABEL_237:
Ritor1
parents:
diff changeset
1839 ParseDamage((const char *)v2, (int)v47, (int)v48, (int)v84);
Ritor1
parents:
diff changeset
1840 goto LABEL_325;
Ritor1
parents:
diff changeset
1841 case 0x17:
Ritor1
parents:
diff changeset
1842 v102->pInfos[v103].uMissleAttack2Type = ParseMissleAttackType((const char *)v2);
Ritor1
parents:
diff changeset
1843 goto LABEL_325;
Ritor1
parents:
diff changeset
1844 case 0x18:
Ritor1
parents:
diff changeset
1845 v102->pInfos[v103].uSpell1UseChance = atoi((const char *)v2);
Ritor1
parents:
diff changeset
1846 goto LABEL_325;
Ritor1
parents:
diff changeset
1847 case 0x19:
Ritor1
parents:
diff changeset
1848 strcpy(Str, (const char *)v2);
Ritor1
parents:
diff changeset
1849 Str[0] = ' ';
Ritor1
parents:
diff changeset
1850 Str[strlen(Str) - 1] = ' ';
Ritor1
parents:
diff changeset
1851 v50 = texture_frame_table_txt_parser(Str, &v87);
Ritor1
parents:
diff changeset
1852 v51 = 88 * v103;
Ritor1
parents:
diff changeset
1853 memcpy(&v90, v50, sizeof(v90));
Ritor1
parents:
diff changeset
1854 if ( v90.field_0 >= 3 )
Ritor1
parents:
diff changeset
1855 {
Ritor1
parents:
diff changeset
1856 v53 = (int)((char *)v102 + v51);
Ritor1
parents:
diff changeset
1857 a2 = 1;
Ritor1
parents:
diff changeset
1858 v102->pInfos[v51 / 0x58u].uSpell1ID = ParseSpellType(&v90, (int)&a2);
Ritor1
parents:
diff changeset
1859 v54 = a2;
Ritor1
parents:
diff changeset
1860 v84 = (char *)v90.pProperties[a2 + 1];
Ritor1
parents:
diff changeset
1861 v55 = atoi(v84);
Ritor1
parents:
diff changeset
1862 v56 = (char *)v90.pProperties[v54];
Ritor1
parents:
diff changeset
1863 v84 = "E";
Ritor1
parents:
diff changeset
1864 v83 = v56;
Ritor1
parents:
diff changeset
1865 *(_WORD *)(v53 + 56) = v55 & 0x3F;
Ritor1
parents:
diff changeset
1866 if ( _strcmpi(v83, v84) )
Ritor1
parents:
diff changeset
1867 {
Ritor1
parents:
diff changeset
1868 if ( _strcmpi(v56, "M") )
Ritor1
parents:
diff changeset
1869 {
Ritor1
parents:
diff changeset
1870 if ( !_strcmpi(v56, "G") )
Ritor1
parents:
diff changeset
1871 *(_BYTE *)(v53 + 57) |= 1u;
Ritor1
parents:
diff changeset
1872 }
Ritor1
parents:
diff changeset
1873 else
Ritor1
parents:
diff changeset
1874 {
Ritor1
parents:
diff changeset
1875 *(_BYTE *)(v53 + 56) |= 0x80u;
Ritor1
parents:
diff changeset
1876 }
Ritor1
parents:
diff changeset
1877 }
Ritor1
parents:
diff changeset
1878 else
Ritor1
parents:
diff changeset
1879 {
Ritor1
parents:
diff changeset
1880 *(_BYTE *)(v53 + 56) |= 0x40u;
Ritor1
parents:
diff changeset
1881 }
Ritor1
parents:
diff changeset
1882 }
Ritor1
parents:
diff changeset
1883 else
Ritor1
parents:
diff changeset
1884 {
Ritor1
parents:
diff changeset
1885 v52 = (int)((char *)v102 + v51);
Ritor1
parents:
diff changeset
1886 *(_BYTE *)(v52 + 33) = 0;
Ritor1
parents:
diff changeset
1887 *(_WORD *)(v52 + 56) = 0;
Ritor1
parents:
diff changeset
1888 }
Ritor1
parents:
diff changeset
1889 goto LABEL_325;
Ritor1
parents:
diff changeset
1890 case 0x1A:
Ritor1
parents:
diff changeset
1891 v102->pInfos[v103].uSpell2UseChance = atoi((const char *)v2);
Ritor1
parents:
diff changeset
1892 goto LABEL_325;
186
d65528fc3bda D3D constants, shore tiles, camera flags
Nomad
parents: 0
diff changeset
1893
0
Ritor1
parents:
diff changeset
1894 case 0x1B:
Ritor1
parents:
diff changeset
1895 strcpy(Dest, (const char *)v2);
Ritor1
parents:
diff changeset
1896 Dest[0] = ' ';
Ritor1
parents:
diff changeset
1897 Dest[strlen(Dest) - 1] = ' ';
Ritor1
parents:
diff changeset
1898 v57 = texture_frame_table_txt_parser(Dest, &v86);
Ritor1
parents:
diff changeset
1899 v58 = v103;
Ritor1
parents:
diff changeset
1900 memcpy(&v89, v57, sizeof(v89));
Ritor1
parents:
diff changeset
1901 if ( v89.field_0 >= 3 )
Ritor1
parents:
diff changeset
1902 {
Ritor1
parents:
diff changeset
1903 v60 = &v102->pInfos[v58];
Ritor1
parents:
diff changeset
1904 a2 = 1;
Ritor1
parents:
diff changeset
1905 v102->pInfos[v58].uSpell2ID = ParseSpellType(&v89, (int)&a2);
Ritor1
parents:
diff changeset
1906 v61 = a2;
Ritor1
parents:
diff changeset
1907 v84 = (char *)v89.pProperties[a2 + 1];
Ritor1
parents:
diff changeset
1908 v62 = atoi(v84);
Ritor1
parents:
diff changeset
1909 v63 = (char *)v89.pProperties[v61];
Ritor1
parents:
diff changeset
1910 v84 = "E";
Ritor1
parents:
diff changeset
1911 v83 = v63;
Ritor1
parents:
diff changeset
1912 v60->uSpellSkillAndMastery2 = v62 & 0x3F;
Ritor1
parents:
diff changeset
1913 if ( _strcmpi(v83, v84) )
Ritor1
parents:
diff changeset
1914 {
Ritor1
parents:
diff changeset
1915 if ( _strcmpi(v63, "M") )
Ritor1
parents:
diff changeset
1916 {
Ritor1
parents:
diff changeset
1917 if ( !_strcmpi(v63, "G") )
Ritor1
parents:
diff changeset
1918 HIBYTE(v60->uSpellSkillAndMastery2) |= 1u;
Ritor1
parents:
diff changeset
1919 }
Ritor1
parents:
diff changeset
1920 else
Ritor1
parents:
diff changeset
1921 {
Ritor1
parents:
diff changeset
1922 LOBYTE(v60->uSpellSkillAndMastery2) |= 0x80u;
Ritor1
parents:
diff changeset
1923 }
Ritor1
parents:
diff changeset
1924 }
Ritor1
parents:
diff changeset
1925 else
Ritor1
parents:
diff changeset
1926 {
Ritor1
parents:
diff changeset
1927 LOBYTE(v60->uSpellSkillAndMastery2) |= 0x40u;
Ritor1
parents:
diff changeset
1928 }
Ritor1
parents:
diff changeset
1929 }
Ritor1
parents:
diff changeset
1930 else
Ritor1
parents:
diff changeset
1931 {
Ritor1
parents:
diff changeset
1932 v59 = &v102->pInfos[v58];
Ritor1
parents:
diff changeset
1933 v59->uSpell2ID = 0;
Ritor1
parents:
diff changeset
1934 v59->uSpellSkillAndMastery2 = 0;
Ritor1
parents:
diff changeset
1935 }
Ritor1
parents:
diff changeset
1936 goto LABEL_325;
Ritor1
parents:
diff changeset
1937 case 0x1C:
Ritor1
parents:
diff changeset
1938 v84 = (char *)*(_BYTE *)v2;
Ritor1
parents:
diff changeset
1939 if ( tolower((int)v84) == 'i' )
Ritor1
parents:
diff changeset
1940 v64 = 200;
Ritor1
parents:
diff changeset
1941 else
Ritor1
parents:
diff changeset
1942 v64 = atoi((const char *)v2);
Ritor1
parents:
diff changeset
1943 v102->pInfos[v103].uResFire = v64;
Ritor1
parents:
diff changeset
1944 goto LABEL_325;
Ritor1
parents:
diff changeset
1945 case 0x1D:
Ritor1
parents:
diff changeset
1946 v84 = (char *)*(_BYTE *)v2;
Ritor1
parents:
diff changeset
1947 if ( tolower((int)v84) == 'i' )
Ritor1
parents:
diff changeset
1948 v65 = 200;
Ritor1
parents:
diff changeset
1949 else
Ritor1
parents:
diff changeset
1950 v65 = atoi((const char *)v2);
Ritor1
parents:
diff changeset
1951 v102->pInfos[v103].uResAir = v65;
Ritor1
parents:
diff changeset
1952 goto LABEL_325;
Ritor1
parents:
diff changeset
1953 case 0x1E:
Ritor1
parents:
diff changeset
1954 v84 = (char *)*(_BYTE *)v2;
Ritor1
parents:
diff changeset
1955 if ( tolower((int)v84) == 'i' )
Ritor1
parents:
diff changeset
1956 v66 = 200;
Ritor1
parents:
diff changeset
1957 else
Ritor1
parents:
diff changeset
1958 v66 = atoi((const char *)v2);
Ritor1
parents:
diff changeset
1959 v102->pInfos[v103].uResWater = v66;
Ritor1
parents:
diff changeset
1960 goto LABEL_325;
Ritor1
parents:
diff changeset
1961 case 0x1F:
Ritor1
parents:
diff changeset
1962 v84 = (char *)*(_BYTE *)v2;
Ritor1
parents:
diff changeset
1963 if ( tolower((int)v84) == 'i' )
Ritor1
parents:
diff changeset
1964 v67 = 200;
Ritor1
parents:
diff changeset
1965 else
Ritor1
parents:
diff changeset
1966 v67 = atoi((const char *)v2);
Ritor1
parents:
diff changeset
1967 v102->pInfos[v103].uResEarth = v67;
Ritor1
parents:
diff changeset
1968 goto LABEL_325;
Ritor1
parents:
diff changeset
1969 case 0x20:
Ritor1
parents:
diff changeset
1970 v84 = (char *)*(_BYTE *)v2;
Ritor1
parents:
diff changeset
1971 if ( tolower((int)v84) == 'i' )
Ritor1
parents:
diff changeset
1972 v68 = 200;
Ritor1
parents:
diff changeset
1973 else
Ritor1
parents:
diff changeset
1974 v68 = atoi((const char *)v2);
Ritor1
parents:
diff changeset
1975 v102->pInfos[v103].uResMind = v68;
Ritor1
parents:
diff changeset
1976 goto LABEL_325;
Ritor1
parents:
diff changeset
1977 case 0x21:
Ritor1
parents:
diff changeset
1978 v84 = (char *)*(_BYTE *)v2;
Ritor1
parents:
diff changeset
1979 if ( tolower((int)v84) == 'i' )
Ritor1
parents:
diff changeset
1980 v69 = 200;
Ritor1
parents:
diff changeset
1981 else
Ritor1
parents:
diff changeset
1982 v69 = atoi((const char *)v2);
Ritor1
parents:
diff changeset
1983 v102->pInfos[v103].uResSpirit = v69;
Ritor1
parents:
diff changeset
1984 goto LABEL_325;
Ritor1
parents:
diff changeset
1985 case 0x22:
Ritor1
parents:
diff changeset
1986 v84 = (char *)*(_BYTE *)v2;
Ritor1
parents:
diff changeset
1987 if ( tolower((int)v84) == 'i' )
Ritor1
parents:
diff changeset
1988 v70 = 200;
Ritor1
parents:
diff changeset
1989 else
Ritor1
parents:
diff changeset
1990 v70 = atoi((const char *)v2);
Ritor1
parents:
diff changeset
1991 v102->pInfos[v103].uResBody = v70;
Ritor1
parents:
diff changeset
1992 goto LABEL_325;
Ritor1
parents:
diff changeset
1993 case 0x23:
Ritor1
parents:
diff changeset
1994 v84 = (char *)*(_BYTE *)v2;
Ritor1
parents:
diff changeset
1995 if ( tolower((int)v84) == 'i' )
Ritor1
parents:
diff changeset
1996 v71 = 200;
Ritor1
parents:
diff changeset
1997 else
Ritor1
parents:
diff changeset
1998 v71 = atoi((const char *)v2);
Ritor1
parents:
diff changeset
1999 v102->pInfos[v103].uResLight = v71;
Ritor1
parents:
diff changeset
2000 goto LABEL_325;
Ritor1
parents:
diff changeset
2001 case 0x24:
Ritor1
parents:
diff changeset
2002 v84 = (char *)*(_BYTE *)v2;
Ritor1
parents:
diff changeset
2003 if ( tolower((int)v84) == 'i' )
Ritor1
parents:
diff changeset
2004 v72 = 200;
Ritor1
parents:
diff changeset
2005 else
Ritor1
parents:
diff changeset
2006 v72 = atoi((const char *)v2);
Ritor1
parents:
diff changeset
2007 v102->pInfos[v103].uResDark = v72;
Ritor1
parents:
diff changeset
2008 goto LABEL_325;
Ritor1
parents:
diff changeset
2009 case 0x25:
Ritor1
parents:
diff changeset
2010 v84 = (char *)*(_BYTE *)v2;
Ritor1
parents:
diff changeset
2011 if ( tolower((int)v84) == 'i' )
Ritor1
parents:
diff changeset
2012 v73 = 200;
Ritor1
parents:
diff changeset
2013 else
Ritor1
parents:
diff changeset
2014 v73 = atoi((const char *)v2);
Ritor1
parents:
diff changeset
2015 v102->pInfos[v103].uResPhysical = v73;
Ritor1
parents:
diff changeset
2016 goto LABEL_325;
Ritor1
parents:
diff changeset
2017 case 0x26:
Ritor1
parents:
diff changeset
2018 strcpy(v93, (const char *)v2);
Ritor1
parents:
diff changeset
2019 v93[0] = ' ';
Ritor1
parents:
diff changeset
2020 v93[strlen(v93) - 1] = ' ';
Ritor1
parents:
diff changeset
2021 memcpy(&v94, texture_frame_table_txt_parser(v93, &v85), sizeof(v94));
Ritor1
parents:
diff changeset
2022 if ( v94.field_0 )
Ritor1
parents:
diff changeset
2023 {
Ritor1
parents:
diff changeset
2024 v74 = v94.field_0;
Ritor1
parents:
diff changeset
2025 if ( v94.field_0 < 10 )
Ritor1
parents:
diff changeset
2026 {
Ritor1
parents:
diff changeset
2027 if ( _strcmpi(v94.pProperties[0], "shot") )
Ritor1
parents:
diff changeset
2028 {
Ritor1
parents:
diff changeset
2029 if ( _strcmpi(v94.pProperties[0], "summon") )
Ritor1
parents:
diff changeset
2030 {
Ritor1
parents:
diff changeset
2031 if ( !_strcmpi(v94.pProperties[0], "explode") )
Ritor1
parents:
diff changeset
2032 {
Ritor1
parents:
diff changeset
2033 v79 = &v102->pInfos[v103];
Ritor1
parents:
diff changeset
2034 v80 = v94.pProperties[1];
Ritor1
parents:
diff changeset
2035 v84 = (char *)&v79->uSpecialAbilityDamageDiceBonus;
Ritor1
parents:
diff changeset
2036 v83 = (char *)&v79->uSpecialAbilityDamageDiceSides;
Ritor1
parents:
diff changeset
2037 v79->uSpecialAbilityType = 3;
Ritor1
parents:
diff changeset
2038 ParseDamage(v80, (int)&v79->uSpecialAbilityDamageDiceRolls, (int)v83, (int)v84);
Ritor1
parents:
diff changeset
2039 v79->field_3C_some_special_attack = ParseAttackType((unsigned __int8 *)v2);
Ritor1
parents:
diff changeset
2040 }
Ritor1
parents:
diff changeset
2041 }
Ritor1
parents:
diff changeset
2042 else
Ritor1
parents:
diff changeset
2043 {
Ritor1
parents:
diff changeset
2044 v76 = &v102->pInfos[v103];
Ritor1
parents:
diff changeset
2045 v76->uSpecialAbilityType = 2;
Ritor1
parents:
diff changeset
2046 if ( v74 > 1 )
Ritor1
parents:
diff changeset
2047 {
Ritor1
parents:
diff changeset
2048 pTmpBuf[0] = 0;
Ritor1
parents:
diff changeset
2049 strcpy(pTmpBuf, v94.pProperties[2]);
Ritor1
parents:
diff changeset
2050 if ( v74 > 2 )
Ritor1
parents:
diff changeset
2051 {
Ritor1
parents:
diff changeset
2052 v100 = 3;
Ritor1
parents:
diff changeset
2053 if ( v74 > 3 )
Ritor1
parents:
diff changeset
2054 {
Ritor1
parents:
diff changeset
2055 do
Ritor1
parents:
diff changeset
2056 {
Ritor1
parents:
diff changeset
2057 strcat(pTmpBuf, " ");
Ritor1
parents:
diff changeset
2058 v77 = (char **)v94.pProperties[v100];
Ritor1
parents:
diff changeset
2059 v82 = v94.pProperties[v100];
Ritor1
parents:
diff changeset
2060 strcat(pTmpBuf, v82);
Ritor1
parents:
diff changeset
2061 if ( v100 == v94.field_0 - 1 )
Ritor1
parents:
diff changeset
2062 {
Ritor1
parents:
diff changeset
2063 v84 = (char *)*(_BYTE *)v77;
Ritor1
parents:
diff changeset
2064 if ( tolower((int)v84) == 'a' )
Ritor1
parents:
diff changeset
2065 {
Ritor1
parents:
diff changeset
2066 v76->uSpecialAbilityDamageDiceRolls = 1;
Ritor1
parents:
diff changeset
2067 }
Ritor1
parents:
diff changeset
2068 else
Ritor1
parents:
diff changeset
2069 {
Ritor1
parents:
diff changeset
2070 v84 = (char *)*(_BYTE *)v77;
Ritor1
parents:
diff changeset
2071 if ( tolower((int)v84) == 'b' )
Ritor1
parents:
diff changeset
2072 {
Ritor1
parents:
diff changeset
2073 v76->uSpecialAbilityDamageDiceRolls = 2;
Ritor1
parents:
diff changeset
2074 }
Ritor1
parents:
diff changeset
2075 else
Ritor1
parents:
diff changeset
2076 {
Ritor1
parents:
diff changeset
2077 v84 = (char *)*(_BYTE *)v77;
Ritor1
parents:
diff changeset
2078 if ( tolower((int)v84) == 'c' )
Ritor1
parents:
diff changeset
2079 v76->uSpecialAbilityDamageDiceRolls = 3;
Ritor1
parents:
diff changeset
2080 else
Ritor1
parents:
diff changeset
2081 v76->uSpecialAbilityDamageDiceRolls = 0;
Ritor1
parents:
diff changeset
2082 }
Ritor1
parents:
diff changeset
2083 }
Ritor1
parents:
diff changeset
2084 }
Ritor1
parents:
diff changeset
2085 ++v100;
Ritor1
parents:
diff changeset
2086 }
Ritor1
parents:
diff changeset
2087 while ( v100 < v94.field_0 );
Ritor1
parents:
diff changeset
2088 }
Ritor1
parents:
diff changeset
2089 }
Ritor1
parents:
diff changeset
2090 else
Ritor1
parents:
diff changeset
2091 {
Ritor1
parents:
diff changeset
2092 v76->uSpecialAbilityDamageDiceRolls = 0;
Ritor1
parents:
diff changeset
2093 }
Ritor1
parents:
diff changeset
2094 if ( pMonsterList->uNumMonsters )
Ritor1
parents:
diff changeset
2095 {
Ritor1
parents:
diff changeset
2096 v78 = pMonsterList->GetMonsterByName(pTmpBuf) + 1;
Ritor1
parents:
diff changeset
2097 v76->field_3C_some_special_attack = v78;
Ritor1
parents:
diff changeset
2098 if ( v78 == -1 )
Ritor1
parents:
diff changeset
2099 {
Ritor1
parents:
diff changeset
2100 sprintf(Src, "Can't create random monster: '%s' See MapStats!", Src);
Ritor1
parents:
diff changeset
2101 MessageBoxA(nullptr, Src, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Itemdata.cpp:2239", 0);
Ritor1
parents:
diff changeset
2102 }
Ritor1
parents:
diff changeset
2103 }
Ritor1
parents:
diff changeset
2104 v76->uSpecialAbilityDamageDiceSides = 0;
Ritor1
parents:
diff changeset
2105 if ( !_strcmpi(v94.pProperties[1], "ground") )
Ritor1
parents:
diff changeset
2106 v76->uSpecialAbilityDamageDiceSides = 1;
Ritor1
parents:
diff changeset
2107 if ( v76->field_3C_some_special_attack == -1 )
Ritor1
parents:
diff changeset
2108 v76->uSpecialAbilityType = 0;
Ritor1
parents:
diff changeset
2109 }
Ritor1
parents:
diff changeset
2110 }
Ritor1
parents:
diff changeset
2111 }
Ritor1
parents:
diff changeset
2112 else
Ritor1
parents:
diff changeset
2113 {
Ritor1
parents:
diff changeset
2114 v75 = &v102->pInfos[v103];
Ritor1
parents:
diff changeset
2115 v84 = (char *)(v94.pProperties[1] + 1);
Ritor1
parents:
diff changeset
2116 v75->uSpecialAbilityType = 1;
Ritor1
parents:
diff changeset
2117 v75->uSpecialAbilityDamageDiceBonus = atoi(v84);
Ritor1
parents:
diff changeset
2118 }
Ritor1
parents:
diff changeset
2119 }
Ritor1
parents:
diff changeset
2120 }
Ritor1
parents:
diff changeset
2121 goto LABEL_325;
Ritor1
parents:
diff changeset
2122 default:
Ritor1
parents:
diff changeset
2123 goto LABEL_325;
Ritor1
parents:
diff changeset
2124 }
Ritor1
parents:
diff changeset
2125 while ( 1 )
Ritor1
parents:
diff changeset
2126 {
Ritor1
parents:
diff changeset
2127 v84 = (char *)*(_BYTE *)(v43 + v2);
Ritor1
parents:
diff changeset
2128 if ( tolower((int)v84) == 'x' )
Ritor1
parents:
diff changeset
2129 break;
Ritor1
parents:
diff changeset
2130 ++v43;
Ritor1
parents:
diff changeset
2131 if ( v43 >= v100 )
Ritor1
parents:
diff changeset
2132 goto LABEL_185;
Ritor1
parents:
diff changeset
2133 }
Ritor1
parents:
diff changeset
2134 v45 = v2 + v43;
Ritor1
parents:
diff changeset
2135 *(_BYTE *)v45 = 0;
Ritor1
parents:
diff changeset
2136 v44->uSpecialAttackType = atoi((const char *)(v45 + 1));
Ritor1
parents:
diff changeset
2137 *(_BYTE *)v45 = 100;
Ritor1
parents:
diff changeset
2138 LABEL_185:
Ritor1
parents:
diff changeset
2139 _strlwr((char *)v2);
Ritor1
parents:
diff changeset
2140 if ( strstr((const char *)v2, "curse") )
Ritor1
parents:
diff changeset
2141 {
Ritor1
parents:
diff changeset
2142 v44->uSpecialAttack = 1;
Ritor1
parents:
diff changeset
2143 }
Ritor1
parents:
diff changeset
2144 else
Ritor1
parents:
diff changeset
2145 {
Ritor1
parents:
diff changeset
2146 if ( strstr((const char *)v2, "weak") )
Ritor1
parents:
diff changeset
2147 {
Ritor1
parents:
diff changeset
2148 v44->uSpecialAttack = 2;
Ritor1
parents:
diff changeset
2149 }
Ritor1
parents:
diff changeset
2150 else
Ritor1
parents:
diff changeset
2151 {
Ritor1
parents:
diff changeset
2152 if ( strstr((const char *)v2, "asleep") )
Ritor1
parents:
diff changeset
2153 {
Ritor1
parents:
diff changeset
2154 v44->uSpecialAttack = 3;
Ritor1
parents:
diff changeset
2155 }
Ritor1
parents:
diff changeset
2156 else
Ritor1
parents:
diff changeset
2157 {
Ritor1
parents:
diff changeset
2158 if ( strstr((const char *)v2, "afraid") )
Ritor1
parents:
diff changeset
2159 {
Ritor1
parents:
diff changeset
2160 v44->uSpecialAttack = 23;
Ritor1
parents:
diff changeset
2161 }
Ritor1
parents:
diff changeset
2162 else
Ritor1
parents:
diff changeset
2163 {
Ritor1
parents:
diff changeset
2164 if ( strstr((const char *)v2, "drunk") )
Ritor1
parents:
diff changeset
2165 {
Ritor1
parents:
diff changeset
2166 v44->uSpecialAttack = 4;
Ritor1
parents:
diff changeset
2167 }
Ritor1
parents:
diff changeset
2168 else
Ritor1
parents:
diff changeset
2169 {
Ritor1
parents:
diff changeset
2170 if ( strstr((const char *)v2, "insane") )
Ritor1
parents:
diff changeset
2171 {
Ritor1
parents:
diff changeset
2172 v44->uSpecialAttack = 5;
Ritor1
parents:
diff changeset
2173 }
Ritor1
parents:
diff changeset
2174 else
Ritor1
parents:
diff changeset
2175 {
Ritor1
parents:
diff changeset
2176 if ( strstr((const char *)v2, "poison1") )
Ritor1
parents:
diff changeset
2177 {
Ritor1
parents:
diff changeset
2178 v44->uSpecialAttack = 6;
Ritor1
parents:
diff changeset
2179 }
Ritor1
parents:
diff changeset
2180 else
Ritor1
parents:
diff changeset
2181 {
Ritor1
parents:
diff changeset
2182 if ( strstr((const char *)v2, "poison2") )
Ritor1
parents:
diff changeset
2183 {
Ritor1
parents:
diff changeset
2184 v44->uSpecialAttack = 7;
Ritor1
parents:
diff changeset
2185 }
Ritor1
parents:
diff changeset
2186 else
Ritor1
parents:
diff changeset
2187 {
Ritor1
parents:
diff changeset
2188 if ( strstr((const char *)v2, "poison3") )
Ritor1
parents:
diff changeset
2189 {
Ritor1
parents:
diff changeset
2190 v44->uSpecialAttack = 8;
Ritor1
parents:
diff changeset
2191 }
Ritor1
parents:
diff changeset
2192 else
Ritor1
parents:
diff changeset
2193 {
Ritor1
parents:
diff changeset
2194 if ( strstr((const char *)v2, "disease1") )
Ritor1
parents:
diff changeset
2195 {
Ritor1
parents:
diff changeset
2196 v44->uSpecialAttack = 9;
Ritor1
parents:
diff changeset
2197 }
Ritor1
parents:
diff changeset
2198 else
Ritor1
parents:
diff changeset
2199 {
Ritor1
parents:
diff changeset
2200 if ( strstr((const char *)v2, "disease2") )
Ritor1
parents:
diff changeset
2201 {
Ritor1
parents:
diff changeset
2202 v44->uSpecialAttack = 10;
Ritor1
parents:
diff changeset
2203 }
Ritor1
parents:
diff changeset
2204 else
Ritor1
parents:
diff changeset
2205 {
Ritor1
parents:
diff changeset
2206 if ( strstr((const char *)v2, "disease3") )
Ritor1
parents:
diff changeset
2207 {
Ritor1
parents:
diff changeset
2208 v44->uSpecialAttack = 11;
Ritor1
parents:
diff changeset
2209 }
Ritor1
parents:
diff changeset
2210 else
Ritor1
parents:
diff changeset
2211 {
Ritor1
parents:
diff changeset
2212 if ( strstr((const char *)v2, "paralyze") )
Ritor1
parents:
diff changeset
2213 {
Ritor1
parents:
diff changeset
2214 v44->uSpecialAttack = 12;
Ritor1
parents:
diff changeset
2215 }
Ritor1
parents:
diff changeset
2216 else
Ritor1
parents:
diff changeset
2217 {
Ritor1
parents:
diff changeset
2218 if ( strstr((const char *)v2, "uncon") )
Ritor1
parents:
diff changeset
2219 {
Ritor1
parents:
diff changeset
2220 v44->uSpecialAttack = 13;
Ritor1
parents:
diff changeset
2221 }
Ritor1
parents:
diff changeset
2222 else
Ritor1
parents:
diff changeset
2223 {
Ritor1
parents:
diff changeset
2224 if ( strstr((const char *)v2, "dead") )
Ritor1
parents:
diff changeset
2225 {
Ritor1
parents:
diff changeset
2226 v44->uSpecialAttack = 14;
Ritor1
parents:
diff changeset
2227 }
Ritor1
parents:
diff changeset
2228 else
Ritor1
parents:
diff changeset
2229 {
Ritor1
parents:
diff changeset
2230 if ( strstr((const char *)v2, "stone") )
Ritor1
parents:
diff changeset
2231 {
Ritor1
parents:
diff changeset
2232 v44->uSpecialAttack = 15;
Ritor1
parents:
diff changeset
2233 }
Ritor1
parents:
diff changeset
2234 else
Ritor1
parents:
diff changeset
2235 {
Ritor1
parents:
diff changeset
2236 if ( strstr((const char *)v2, "errad") )
Ritor1
parents:
diff changeset
2237 {
Ritor1
parents:
diff changeset
2238 v44->uSpecialAttack = 16;
Ritor1
parents:
diff changeset
2239 }
Ritor1
parents:
diff changeset
2240 else
Ritor1
parents:
diff changeset
2241 {
Ritor1
parents:
diff changeset
2242 if ( strstr((const char *)v2, "brkitem") )
Ritor1
parents:
diff changeset
2243 {
Ritor1
parents:
diff changeset
2244 v44->uSpecialAttack = 17;
Ritor1
parents:
diff changeset
2245 }
Ritor1
parents:
diff changeset
2246 else
Ritor1
parents:
diff changeset
2247 {
Ritor1
parents:
diff changeset
2248 if ( strstr((const char *)v2, "brkarmor") )
Ritor1
parents:
diff changeset
2249 {
Ritor1
parents:
diff changeset
2250 v44->uSpecialAttack = 18;
Ritor1
parents:
diff changeset
2251 }
Ritor1
parents:
diff changeset
2252 else
Ritor1
parents:
diff changeset
2253 {
Ritor1
parents:
diff changeset
2254 if ( strstr((const char *)v2, "brkweapon") )
Ritor1
parents:
diff changeset
2255 {
Ritor1
parents:
diff changeset
2256 v44->uSpecialAttack = 19;
Ritor1
parents:
diff changeset
2257 }
Ritor1
parents:
diff changeset
2258 else
Ritor1
parents:
diff changeset
2259 {
Ritor1
parents:
diff changeset
2260 if ( strstr((const char *)v2, "steal") )
Ritor1
parents:
diff changeset
2261 {
Ritor1
parents:
diff changeset
2262 v44->uSpecialAttack = 20;
Ritor1
parents:
diff changeset
2263 }
Ritor1
parents:
diff changeset
2264 else
Ritor1
parents:
diff changeset
2265 {
Ritor1
parents:
diff changeset
2266 if ( strstr((const char *)v2, "age") )
Ritor1
parents:
diff changeset
2267 {
Ritor1
parents:
diff changeset
2268 v44->uSpecialAttack = 21;
Ritor1
parents:
diff changeset
2269 }
Ritor1
parents:
diff changeset
2270 else
Ritor1
parents:
diff changeset
2271 {
Ritor1
parents:
diff changeset
2272 if ( strstr((const char *)v2, "drainsp") )
Ritor1
parents:
diff changeset
2273 v44->uSpecialAttack = 22;
Ritor1
parents:
diff changeset
2274 }
Ritor1
parents:
diff changeset
2275 }
Ritor1
parents:
diff changeset
2276 }
Ritor1
parents:
diff changeset
2277 }
Ritor1
parents:
diff changeset
2278 }
Ritor1
parents:
diff changeset
2279 }
Ritor1
parents:
diff changeset
2280 }
Ritor1
parents:
diff changeset
2281 }
Ritor1
parents:
diff changeset
2282 }
Ritor1
parents:
diff changeset
2283 }
Ritor1
parents:
diff changeset
2284 }
Ritor1
parents:
diff changeset
2285 }
Ritor1
parents:
diff changeset
2286 }
Ritor1
parents:
diff changeset
2287 }
Ritor1
parents:
diff changeset
2288 }
Ritor1
parents:
diff changeset
2289 }
Ritor1
parents:
diff changeset
2290 }
Ritor1
parents:
diff changeset
2291 }
Ritor1
parents:
diff changeset
2292 }
Ritor1
parents:
diff changeset
2293 }
Ritor1
parents:
diff changeset
2294 }
Ritor1
parents:
diff changeset
2295 }
Ritor1
parents:
diff changeset
2296 }
Ritor1
parents:
diff changeset
2297 else
Ritor1
parents:
diff changeset
2298 {
Ritor1
parents:
diff changeset
2299 v97 = 1;
Ritor1
parents:
diff changeset
2300 }
Ritor1
parents:
diff changeset
2301 LABEL_325:
Ritor1
parents:
diff changeset
2302 ++*(_DWORD *)&a3[1];
Ritor1
parents:
diff changeset
2303 v2 = v96 + 1;
Ritor1
parents:
diff changeset
2304 }
Ritor1
parents:
diff changeset
2305 while ( *(_DWORD *)&a3[1] - 1 <= (signed int)v102->uNumMonsters && !v97 );
Ritor1
parents:
diff changeset
2306 ++v103;
Ritor1
parents:
diff changeset
2307 }
Ritor1
parents:
diff changeset
2308 while ( v103 < 265 );
Ritor1
parents:
diff changeset
2309 v102->uNumMonsters = v103;
694
52329962fcdb monster table init rework started
Gloval
parents: 237
diff changeset
2310 */
0
Ritor1
parents:
diff changeset
2311 }
Ritor1
parents:
diff changeset
2312
Ritor1
parents:
diff changeset
2313
Ritor1
parents:
diff changeset
2314
Ritor1
parents:
diff changeset
2315
Ritor1
parents:
diff changeset
2316 //----- (0044FA08) --------------------------------------------------------
Ritor1
parents:
diff changeset
2317 unsigned __int16 MonsterList::GetMonsterByName(const char *pMonsterName)
Ritor1
parents:
diff changeset
2318 {
Ritor1
parents:
diff changeset
2319 signed int v2; // ebx@1
Ritor1
parents:
diff changeset
2320 MonsterList *v3; // esi@1
Ritor1
parents:
diff changeset
2321 int v4; // edi@3
Ritor1
parents:
diff changeset
2322 unsigned __int16 result; // ax@6
Ritor1
parents:
diff changeset
2323
Ritor1
parents:
diff changeset
2324 v2 = 0;
Ritor1
parents:
diff changeset
2325 v3 = this;
Ritor1
parents:
diff changeset
2326 if ( pMonsterName && (signed int)this->uNumMonsters > 0 )
Ritor1
parents:
diff changeset
2327 {
Ritor1
parents:
diff changeset
2328 v4 = 0;
Ritor1
parents:
diff changeset
2329 while ( _strcmpi(pMonsterName, v3->pMonsters[v4].pMonsterName) )
Ritor1
parents:
diff changeset
2330 {
Ritor1
parents:
diff changeset
2331 ++v2;
Ritor1
parents:
diff changeset
2332 ++v4;
Ritor1
parents:
diff changeset
2333 if ( v2 >= (signed int)v3->uNumMonsters )
Ritor1
parents:
diff changeset
2334 goto LABEL_6;
Ritor1
parents:
diff changeset
2335 }
Ritor1
parents:
diff changeset
2336 result = v2;
Ritor1
parents:
diff changeset
2337 }
Ritor1
parents:
diff changeset
2338 else
Ritor1
parents:
diff changeset
2339 {
Ritor1
parents:
diff changeset
2340 LABEL_6:
Ritor1
parents:
diff changeset
2341 result = -1;
Ritor1
parents:
diff changeset
2342 }
Ritor1
parents:
diff changeset
2343 return result;
Ritor1
parents:
diff changeset
2344 }