comparison mm7_2.cpp @ 698:b097497f07e2

monster table continue fixinf
author Gloval
date Sun, 17 Mar 2013 18:31:54 +0400
parents 52329962fcdb
children 1d05543f522d
comparison
equal deleted inserted replaced
694:52329962fcdb 698:b097497f07e2
7000 pAllocator->FreeChunk(pHostileTXT_Raw); 7000 pAllocator->FreeChunk(pHostileTXT_Raw);
7001 pHostileTXT_Raw = NULL; 7001 pHostileTXT_Raw = NULL;
7002 } 7002 }
7003 } 7003 }
7004 7004
7005 //----- (004548E2) --------------------------------------------------------
7006 unsigned int __fastcall ParseSpellType(FrameTableTxtLine *a1, int a2)
7007 {
7008 int v2; // edi@1
7009 int v3; // esi@1
7010 unsigned int result; // eax@1
7011 std::string v5; // [sp-18h] [bp-28h]@75
7012 const char *v6; // [sp-8h] [bp-18h]@75
7013 signed int v7; // [sp-4h] [bp-14h]@3
7014 std::string *v8; // [sp+8h] [bp-8h]@75
7015 int a3; // [sp+Fh] [bp-1h]@75
7016
7017 v2 = (int)a1;
7018 v3 = a2;
7019 result = (int)a1->pProperties[0];
7020 if ( result )
7021 {
7022 if ( !_strcmpi((const char *)result, "Dispel") )
7023 {
7024 v7 = 80;
7025 LABEL_71:
7026 result = v7;
7027 LABEL_76:
7028 ++*(int *)v3;
7029 return result;
7030 }
7031 if ( _strcmpi(*(const char **)(v2 + 4), "Day") )
7032 {
7033 if ( _strcmpi(*(const char **)(v2 + 4), "Hour") )
7034 {
7035 if ( _strcmpi(*(const char **)(v2 + 4), "Shield") )
7036 {
7037 if ( !_strcmpi(*(const char **)(v2 + 4), "Spirit") )
7038 {
7039 v7 = 52;
7040 goto LABEL_71;
7041 }
7042 if ( !_strcmpi(*(const char **)(v2 + 4), "Power") )
7043 {
7044 v7 = 77;
7045 goto LABEL_71;
7046 }
7047 if ( !_strcmpi(*(const char **)(v2 + 4), "Meteor") )
7048 {
7049 v7 = 9;
7050 goto LABEL_71;
7051 }
7052 if ( !_strcmpi(*(const char **)(v2 + 4), "Lightning") )
7053 {
7054 v7 = 18;
7055 goto LABEL_71;
7056 }
7057 if ( _strcmpi(*(const char **)(v2 + 4), "Implosion") )
7058 {
7059 if ( !_strcmpi(*(const char **)(v2 + 4), "Stone") )
7060 {
7061 v7 = 38;
7062 goto LABEL_71;
7063 }
7064 if ( _strcmpi(*(const char **)(v2 + 4), "Haste") )
7065 {
7066 if ( _strcmpi(*(const char **)(v2 + 4), "Heroism") )
7067 {
7068 if ( !_strcmpi(*(const char **)(v2 + 4), "Pain") )
7069 {
7070 v7 = 95;
7071 goto LABEL_71;
7072 }
7073 if ( _strcmpi(*(const char **)(v2 + 4), "Sparks") )
7074 {
7075 if ( !_strcmpi(*(const char **)(v2 + 4), "Light") )
7076 {
7077 v7 = 78;
7078 goto LABEL_71;
7079 }
7080 if ( !_strcmpi(*(const char **)(v2 + 4), "Toxic") )
7081 {
7082 v7 = 90;
7083 goto LABEL_71;
7084 }
7085 if ( _strcmpi(*(const char **)(v2 + 4), "ShrapMetal") )
7086 {
7087 if ( _strcmpi(*(const char **)(v2 + 4), "Paralyze") )
7088 {
7089 if ( _strcmpi(*(const char **)(v2 + 4), "Fireball") )
7090 {
7091 if ( _strcmpi(*(const char **)(v2 + 4), "Incinerate") )
7092 {
7093 if ( !_strcmpi(*(const char **)(v2 + 4), "Fire") )
7094 {
7095 v7 = 2;
7096 goto LABEL_71;
7097 }
7098 if ( !_strcmpi(*(const char **)(v2 + 4), "Rock") )
7099 {
7100 v7 = 41;
7101 goto LABEL_71;
7102 }
7103 if ( !_strcmpi(*(const char **)(v2 + 4), "Mass") )
7104 {
7105 v7 = 44;
7106 goto LABEL_71;
7107 }
7108 if ( !_strcmpi(*(const char **)(v2 + 4), "Ice") )
7109 {
7110 v7 = 26;
7111 goto LABEL_71;
7112 }
7113 if ( !_strcmpi(*(const char **)(v2 + 4), "Acid") )
7114 {
7115 v7 = 29;
7116 goto LABEL_71;
7117 }
7118 if ( _strcmpi(*(const char **)(v2 + 4), "Bless") )
7119 {
7120 if ( !_strcmpi(*(const char **)(v2 + 4), "Dragon") )
7121 {
7122 v7 = 97;
7123 goto LABEL_71;
7124 }
7125 if ( _strcmpi(*(const char **)(v2 + 4), "Reanimate") )
7126 {
7127 if ( !_strcmpi(*(const char **)(v2 + 4), "Summon") )
7128 {
7129 v7 = 82;
7130 goto LABEL_71;
7131 }
7132 if ( _strcmpi(*(const char **)(v2 + 4), "Fate") )
7133 {
7134 if ( _strcmpi(*(const char **)(v2 + 4), "Harm") )
7135 {
7136 if ( !_strcmpi(*(const char **)(v2 + 4), "Mind") )
7137 {
7138 v7 = 57;
7139 goto LABEL_71;
7140 }
7141 if ( _strcmpi(*(const char **)(v2 + 4), "Blades") )
7142 {
7143 if ( !_strcmpi(*(const char **)(v2 + 4), "Psychic") )
7144 {
7145 v7 = 65;
7146 goto LABEL_71;
7147 }
7148 if ( _strcmpi(*(const char **)(v2 + 4), "Hammerhands") )
7149 {
7150 sprintf(pTmpBuf, "Unknown monster spell %s", *(int *)(v2 + 4));
7151 MessageBoxA(nullptr, pTmpBuf, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Itemdata.cpp:1562", 0);
7152 result = 0;
7153 goto LABEL_76;
7154 }
7155 v7 = 73;
7156 }
7157 else
7158 {
7159 v7 = 39;
7160 }
7161 }
7162 else
7163 {
7164 v7 = 70;
7165 }
7166 }
7167 else
7168 {
7169 v7 = 47;
7170 }
7171 }
7172 else
7173 {
7174 v7 = 89;
7175 }
7176 }
7177 else
7178 {
7179 v7 = 46;
7180 }
7181 }
7182 else
7183 {
7184 v7 = 11;
7185 }
7186 }
7187 else
7188 {
7189 v7 = 6;
7190 }
7191 }
7192 else
7193 {
7194 v7 = 81;
7195 }
7196 }
7197 else
7198 {
7199 v7 = 93;
7200 }
7201 }
7202 else
7203 {
7204 v7 = 15;
7205 }
7206 }
7207 else
7208 {
7209 v7 = 51;
7210 }
7211 }
7212 else
7213 {
7214 v7 = 5;
7215 }
7216 }
7217 else
7218 {
7219 v7 = 20;
7220 }
7221 }
7222 else
7223 {
7224 v7 = 17;
7225 }
7226 return v7;
7227 }
7228 v7 = 86;
7229 }
7230 else
7231 {
7232 v7 = 85;
7233 }
7234 *(int *)v3 += 2;
7235 result = v7;
7236 }
7237 return result;
7238 }
7239
7240 //----- (00454CB4) --------------------------------------------------------
7241 int __thiscall ParseAttackType(unsigned __int8 *a1)
7242 {
7243 unsigned __int8 *v1; // esi@1
7244 int result; // eax@4
7245 int v3; // eax@15
7246 int v4; // eax@18
7247
7248 v1 = a1;
7249 if ( !a1 )
7250 return 4;
7251 if ( tolower(*a1) == 'f' )
7252 return 0;
7253 if ( tolower(*v1) == 'a' )
7254 return 1;
7255 if ( tolower(*v1) == 'w' )
7256 return 2;
7257 if ( tolower(*v1) == 'e' )
7258 {
7259 tolower(v1[1]);
7260 return 3;
7261 }
7262 if ( tolower(*v1) == 's' )
7263 return 6;
7264 if ( tolower(*v1) == 'm' )
7265 {
7266 v3 = -(tolower(v1[1]) != 'i');
7267 LOBYTE(v3) = v3 & 0xFE;
7268 result = v3 + 7;
7269 }
7270 else
7271 {
7272 if ( tolower(*v1) == 'l' )
7273 return 9;
7274 v4 = -(tolower(*v1) != 'd');
7275 LOBYTE(v4) = v4 & 0xFA;
7276 result = v4 + 10;
7277 }
7278 return result;
7279 }
7280
7281 //----- (00454D7D) --------------------------------------------------------
7282 char __fastcall ParseDamage(const char *Str, int a2, int a3, int a4)
7283 {
7284 int v4; // esi@1
7285 const char *v5; // edi@1
7286 signed int v6; // ebx@1
7287 int *v7; // esi@2
7288 int v8; // eax@3
7289 size_t v10; // [sp+Ch] [bp-Ch]@1
7290 int v11; // [sp+10h] [bp-8h]@1
7291 signed int v12; // [sp+14h] [bp-4h]@1
7292
7293 v4 = a2;
7294 v5 = Str;
7295 *(char *)a2 = 0;
7296 *(char *)a3 = 1;
7297 v11 = a2;
7298 *(char *)a4 = 0;
7299 v6 = 0;
7300 v10 = strlen(Str);
7301 v12 = 0;
7302 if ( (signed int)v10 <= 0 )
7303 {
7304 LABEL_9:
7305 LOBYTE(v8) = *v5;
7306 if ( (unsigned __int8)*v5 >= 0x30u && (unsigned __int8)v8 <= 0x39u )
7307 {
7308 *(char *)v4 = atoi(v5);
7309 LOBYTE(v8) = a3;
7310 *(char *)a3 = 1;
7311 }
7312 return v8;
7313 }
7314 do
7315 {
7316 v7 = (int *)&v5[v6];
7317 if ( tolower((unsigned __int8)v5[v6]) == 100 )
7318 {
7319 *(char *)v7 = 0;
7320 *(char *)v11 = atoi(v5);
7321 LOBYTE(v8) = atoi(&v5[v6 + 1]);
7322 v12 = 1;
7323 *(char *)a3 = v8;
7324 *(char *)v7 = 100;
7325 }
7326 else
7327 {
7328 v8 = tolower(*(char *)v7);
7329 if ( v8 == 43 )
7330 {
7331 LOBYTE(v8) = atoi(&v5[v6 + 1]);
7332 *(char *)a4 = v8;
7333 }
7334 }
7335 ++v6;
7336 }
7337 while ( v6 < (signed int)v10 );
7338 if ( !v12 )
7339 {
7340 v4 = v11;
7341 goto LABEL_9;
7342 }
7343 return v8;
7344 }
7345
7346 //----- (00454E3A) --------------------------------------------------------
7347 int __fastcall ParseMissleAttackType(const char *Str1)
7348 {
7349 const char *v1; // esi@1
7350 int v2; // edi@1
7351 int v4; // [sp-4h] [bp-Ch]@4
7352
7353 v1 = Str1;
7354 v2 = 0;
7355 if ( _strcmpi(Str1, "ARROW") )
7356 {
7357 if ( _strcmpi(v1, "ARROWF") )
7358 {
7359 if ( _strcmpi(v1, "FIRE") )
7360 {
7361 if ( _strcmpi(v1, "AIR") )
7362 {
7363 if ( _strcmpi(v1, "WATER") )
7364 {
7365 if ( _strcmpi(v1, "EARTH") )
7366 {
7367 if ( _strcmpi(v1, "SPIRIT") )
7368 {
7369 if ( _strcmpi(v1, "MIND") )
7370 {
7371 if ( _strcmpi(v1, "BODY") )
7372 {
7373 if ( _strcmpi(v1, "LIGHT") )
7374 {
7375 if ( _strcmpi(v1, "DARK") )
7376 {
7377 if ( _strcmpi(v1, "ENER") )
7378 return v2;
7379 v4 = 13;
7380 }
7381 else
7382 {
7383 v4 = 11;
7384 }
7385 }
7386 else
7387 {
7388 v4 = 10;
7389 }
7390 }
7391 else
7392 {
7393 v4 = 9;
7394 }
7395 }
7396 else
7397 {
7398 v4 = 8;
7399 }
7400 }
7401 else
7402 {
7403 v4 = 7;
7404 }
7405 }
7406 else
7407 {
7408 v4 = 6;
7409 }
7410 }
7411 else
7412 {
7413 v4 = 5;
7414 }
7415 }
7416 else
7417 {
7418 v4 = 4;
7419 }
7420 }
7421 else
7422 {
7423 v4 = 3;
7424 }
7425 }
7426 else
7427 {
7428 v4 = 2;
7429 }
7430 return v4;
7431 }
7432 return 1;
7433 }
7434
7435 7005
7436 7006
7437 7007
7438 7008
7439 7009