annotate Monsters.cpp @ 729:8323734d58c8

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