Mercurial > mm7
comparison mm7_6.cpp @ 486:7887a9cf9e7b
Spells
author | Nomad |
---|---|
date | Wed, 27 Feb 2013 17:29:05 +0200 |
parents | 9898e6b413d8 |
children | a3939d5067c4 |
comparison
equal
deleted
inserted
replaced
485:b6bdfaa3ae0f | 486:7887a9cf9e7b |
---|---|
2172 | 2172 |
2173 //----- (0042777D) -------------------------------------------------------- | 2173 //----- (0042777D) -------------------------------------------------------- |
2174 void _42777D_CastSpell_UseWand_ShootArrow(int a1, unsigned int uPlayerID, unsigned int a4, __int16 a5, int a6) | 2174 void _42777D_CastSpell_UseWand_ShootArrow(int a1, unsigned int uPlayerID, unsigned int a4, __int16 a5, int a6) |
2175 { | 2175 { |
2176 //bool result; // eax@2 | 2176 //bool result; // eax@2 |
2177 __int16 v6; // bx@4 | 2177 //__int16 v6; // bx@4 |
2178 //Player *v7; // eax@4 | 2178 //Player *v7; // eax@4 |
2179 char v8; // zf@12 | 2179 //char v8; // zf@12 |
2180 unsigned __int16 v9; // cx@16 | 2180 unsigned __int16 v9; // cx@16 |
2181 unsigned int v10; // eax@18 | 2181 unsigned int v10; // eax@18 |
2182 unsigned __int8 v11; // sf@18 | 2182 unsigned __int8 v11; // sf@18 |
2183 unsigned __int8 v12; // of@18 | 2183 unsigned __int8 v12; // of@18 |
2184 unsigned __int16 v13; // cx@21 | 2184 unsigned __int16 v13; // cx@21 |
2185 unsigned int v14; // eax@23 | 2185 unsigned int v14; // eax@23 |
2186 stru277 *v15; // esi@27 | 2186 //stru277 *v15; // esi@27 |
2187 stru277 *v16; // eax@28 | 2187 //stru277 *v16; // eax@28 |
2188 GUIWindow *v17; // eax@43 | 2188 GUIWindow *v17; // eax@43 |
2189 GUIWindow *v18; // [sp-30h] [bp-48h]@44 | 2189 GUIWindow *v18; // [sp-30h] [bp-48h]@44 |
2190 unsigned int v19; // [sp-2Ch] [bp-44h]@44 | 2190 unsigned int v19; // [sp-2Ch] [bp-44h]@44 |
2191 unsigned int v20; // [sp-28h] [bp-40h]@44 | 2191 unsigned int v20; // [sp-28h] [bp-40h]@44 |
2192 unsigned int v21; // [sp-24h] [bp-3Ch]@44 | 2192 unsigned int v21; // [sp-24h] [bp-3Ch]@44 |
2196 unsigned int v25; // [sp-14h] [bp-2Ch]@43 | 2196 unsigned int v25; // [sp-14h] [bp-2Ch]@43 |
2197 unsigned int v26; // [sp-10h] [bp-28h]@43 | 2197 unsigned int v26; // [sp-10h] [bp-28h]@43 |
2198 unsigned __int8 v27; // [sp-Ch] [bp-24h]@43 | 2198 unsigned __int8 v27; // [sp-Ch] [bp-24h]@43 |
2199 char *v28; // [sp-8h] [bp-20h]@43 | 2199 char *v28; // [sp-8h] [bp-20h]@43 |
2200 Texture *v29; // [sp-4h] [bp-1Ch]@43 | 2200 Texture *v29; // [sp-4h] [bp-1Ch]@43 |
2201 __int16 a3a; // [sp+10h] [bp-8h]@1 | 2201 //__int16 a3a; // [sp+10h] [bp-8h]@1 |
2202 __int16 a2a; // [sp+14h] [bp-4h]@1 | 2202 //__int16 a2a; // [sp+14h] [bp-4h]@1 |
2203 | 2203 |
2204 a3a = uPlayerID; | 2204 //a3a = uPlayerID; |
2205 a2a = a1; | 2205 //a2a = a1; |
2206 | 2206 |
2207 //if ( pParty->bTurnBasedModeOn != 1 | 2207 //if ( pParty->bTurnBasedModeOn != 1 |
2208 // || (result = pTurnEngine->field_4, pTurnEngine->field_4 != 1) && pTurnEngine->field_4 != 3 ) | 2208 // || (result = pTurnEngine->field_4, pTurnEngine->field_4 != 1) && pTurnEngine->field_4 != 3 ) |
2209 if (pParty->bTurnBasedModeOn) | 2209 if (pParty->bTurnBasedModeOn) |
2210 { | 2210 { |
2211 if (pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 3) | 2211 if (pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 3) |
2212 return; | 2212 return; |
2213 } | 2213 } |
2214 | 2214 |
2215 | 2215 |
2216 v6 = a5; | 2216 //v6 = a5; |
2217 //v7 = &pParty->pPlayers[uPlayerID]; | 2217 //v7 = &pParty->pPlayers[uPlayerID]; |
2218 assert(uPlayerID < 4); | 2218 assert(uPlayerID < 4); |
2219 auto player = &pParty->pPlayers[uPlayerID]; | 2219 auto player = &pParty->pPlayers[uPlayerID]; |
2220 if ( !(a5 & 0x10) ) | 2220 if ( !(a5 & 0x10) ) |
2221 { | 2221 { |
2222 switch ( a1 ) | 2222 switch ( a1 ) |
2223 { | 2223 { |
2224 case 47: | 2224 case SPELL_SPIRIT_FATE: |
2225 case 68: | 2225 case SPELL_BODY_FIRST_AID: |
2226 case 89: | 2226 case SPELL_DARK_REANIMATE: |
2227 HIBYTE(v6) = HIBYTE(a5) | 1; | 2227 //HIBYTE(v6) = HIBYTE(a5) | 1; |
2228 a5 |= 0x0100; | |
2228 break; | 2229 break; |
2229 case 4: | 2230 |
2230 case 28: | 2231 case SPELL_FIRE_FIRE_AURA: |
2231 case 30: | 2232 case SPELL_WATER_RECHARGE_ITEM: |
2232 case 91: | 2233 case SPELL_WATER_ENCHANT_ITEM: |
2233 LOBYTE(v6) = a5 | 0x80; | 2234 case SPELL_DARK_VAMPIRIC_WEAPON: |
2235 //LOBYTE(v6) = a5 | 0x80; | |
2236 a5 |= 0x0080; | |
2234 break; | 2237 break; |
2235 case 2: | 2238 |
2236 case 6: | 2239 case SPELL_FIRE_FIRE_BOLT: |
2237 case 11: | 2240 case SPELL_FIRE_FIREBALL: |
2238 case 18: | 2241 case SPELL_FIRE_INCINERATE: |
2239 case 20: | 2242 case SPELL_AIR_LIGHNING_BOLT: |
2240 case 24: | 2243 case SPELL_AIR_IMPLOSION: |
2241 case 26: | 2244 case SPELL_WATER_POISON_SPRAY: |
2242 case 29: | 2245 case SPELL_WATER_ICE_BOLT: |
2243 case 32: | 2246 case SPELL_WATER_ACID_BURST: |
2244 case 34: | 2247 case SPELL_WATER_ICE_BLAST: |
2245 case 35: | 2248 case SPELL_EARTH_STUN: |
2246 case 37: | 2249 case SPELL_EARTH_SLOW: |
2247 case 39: | 2250 case SPELL_EARTH_DEADLY_SWARM: |
2248 case 44: | 2251 case SPELL_EARTH_BLADES: |
2249 case 52: | 2252 case SPELL_EARTH_MASS_DISTORTION: |
2250 case 57: | 2253 case SPELL_SPIRIT_SPIRIT_LASH: |
2251 case 60: | 2254 case SPELL_MIND_MIND_BLAST: |
2252 case 65: | 2255 case SPELL_MIND_CHARM: |
2253 case 70: | 2256 case SPELL_MIND_PSYCHIC_SHOCK: |
2254 case 76: | 2257 case SPELL_BODY_HARM: |
2255 case 78: | 2258 case SPELL_BODY_FLYING_FIST: |
2256 case 79: | 2259 case SPELL_LIGHT_LIGHT_BOLT: |
2257 case 87: | 2260 case SPELL_LIGHT_DESTROY_UNDEAD: |
2258 case 90: | 2261 case SPELL_LIGHT_SUNRAY: |
2259 case 92: | 2262 case SPELL_DARK_TOXIC_CLOUD: |
2260 case 93: | 2263 case SPELL_DARK_SHRINKING_RAY: |
2261 case 97: | 2264 case SPELL_DARK_SHARPMETAL: |
2265 case SPELL_DARK_DRAGON_BREATH: | |
2262 if ( !a6 ) | 2266 if ( !a6 ) |
2263 goto LABEL_9; | 2267 a5 |= 0x0008; |
2264 break; | 2268 break; |
2265 case 59: | 2269 case SPELL_MIND_TELEPATHY: |
2266 case 62: | 2270 case SPELL_MIND_BERSERK: |
2267 case 66: | 2271 case SPELL_MIND_ENSLAVE: |
2268 case 81: | 2272 case SPELL_LIGHT_PARALYZE: |
2269 case 94: | 2273 case SPELL_DARK_CONTROL_UNDEAD: |
2270 LABEL_9: | 2274 //LABEL_9: |
2271 v6 = a5 | 8; | 2275 //v6 = a5 | 8; |
2276 a5 |= 0x0008; | |
2272 break; | 2277 break; |
2273 case 42: | 2278 |
2274 v6 = a5 | 0x40; | 2279 case SPELL_EARTH_TELEKINESIS: |
2280 a5 |= 0x0040; | |
2275 break; | 2281 break; |
2276 case 46: | 2282 |
2277 if ( a4 ) | 2283 case SPELL_SPIRIT_BLESS: |
2278 v8 = (a4 & 0x1C0) == 0; | 2284 if (a4 && ~a4 & 0x01C0) |
2279 else | 2285 goto LABEL_25; |
2280 v8 = (player->pActiveSkills[PLAYER_SKILL_SPIRIT] & 0x1C0) == 0; | 2286 else if ((player->pActiveSkills[PLAYER_SKILL_SPIRIT] & 0x1C0) == 0); |
2281 if ( v8 ) | |
2282 goto LABEL_25; | 2287 goto LABEL_25; |
2283 break; | 2288 break; |
2284 case 50: | 2289 |
2290 case SPELL_SPIRIT_PRESERVATION: | |
2285 v9 = a4; | 2291 v9 = a4; |
2286 if ( !a4 ) | 2292 if ( !a4 ) |
2287 v9 = player->pActiveSkills[PLAYER_SKILL_SPIRIT]; | 2293 v9 = player->pActiveSkills[PLAYER_SKILL_SPIRIT]; |
2288 goto LABEL_18; | 2294 goto LABEL_18; |
2289 case 95: | 2295 |
2296 case SPELL_DARK_PAIN_REFLECTION: | |
2290 v9 = a4; | 2297 v9 = a4; |
2291 if ( !a4 ) | 2298 if ( !a4 ) |
2292 v9 = player->pActiveSkills[PLAYER_SKILL_DARK]; | 2299 v9 = player->pActiveSkills[PLAYER_SKILL_DARK]; |
2293 LABEL_18: | 2300 LABEL_18: |
2294 v10 = SkillToMastery(v9); | 2301 v10 = SkillToMastery(v9); |
2295 v12 = __OFSUB__(v10, 3); | 2302 v12 = __OFSUB__(v10, 3); |
2296 v11 = ((v10 - 3) & 0x80000000u) != 0; | 2303 v11 = ((v10 - 3) & 0x80000000u) != 0; |
2297 goto LABEL_24; | 2304 goto LABEL_24; |
2298 case 73: | 2305 |
2306 case SPELL_BODY_HAMMERHANDS: | |
2299 v13 = a4; | 2307 v13 = a4; |
2300 if ( !a4 ) | 2308 if ( !a4 ) |
2301 v13 = player->pActiveSkills[PLAYER_SKILL_BODY]; | 2309 v13 = player->pActiveSkills[PLAYER_SKILL_BODY]; |
2302 v14 = SkillToMastery(v13); | 2310 v14 = SkillToMastery(v13); |
2303 v12 = __OFSUB__(v14, 4); | 2311 v12 = __OFSUB__(v14, 4); |
2304 v11 = ((v14 - 4) & 0x80000000u) != 0; | 2312 v11 = ((v14 - 4) & 0x80000000u) != 0; |
2305 LABEL_24: | 2313 LABEL_24: |
2306 if ( v11 ^ v12 ) | 2314 if ( v11 ^ v12 ) |
2307 goto LABEL_25; | 2315 goto LABEL_25; |
2308 break; | 2316 break; |
2309 case 40: | 2317 |
2310 case 49: | 2318 case SPELL_EARTH_STONE_TO_FLESH: |
2311 case 53: | 2319 case SPELL_SPIRIT_REMOVE_CURSE: |
2312 case 55: | 2320 case SPELL_SPIRIT_RAISE_DEAD: |
2313 case 56: | 2321 case SPELL_SPIRIT_RESSURECTION: |
2314 case 61: | 2322 case SPELL_MIND_REMOVE_FEAR: |
2315 case 64: | 2323 case SPELL_MIND_CURE_PARALYSIS: |
2316 case 67: | 2324 case SPELL_MIND_CURE_INSANITY: |
2317 case 71: | 2325 case SPELL_BODY_CURE_WEAKNESS: |
2318 case 72: | 2326 case SPELL_BODY_REGENERATION: |
2319 case 74: | 2327 case SPELL_BODY_CURE_POISON: |
2328 case SPELL_BODY_CURE_DISEASE: | |
2320 LABEL_25: | 2329 LABEL_25: |
2321 v6 = a5 | 2; | 2330 //v6 = a5 | 2; |
2331 a5 |= 0x0002; | |
2322 break; | 2332 break; |
2323 case 96: | 2333 |
2324 HIBYTE(v6) = HIBYTE(a5) | 2; | 2334 case SPELL_DARK_SACRIFICE: |
2335 //HIBYTE(v6) = HIBYTE(a5) | 2; | |
2336 a5 |= 0x0200; | |
2325 break; | 2337 break; |
2326 default: | 2338 default: |
2327 break; | 2339 break; |
2328 } | 2340 } |
2329 } | 2341 } |
2330 | 2342 |
2331 v15 = pStru277; | 2343 |
2332 if ( v6 & 0x3CA ) | 2344 if (a5 & 0x3CA) |
2333 { | 2345 { |
2334 v16 = pStru277; | 2346 assert(sizeof(pStru277) / sizeof(*pStru277) == 10); |
2335 while ( !(v16->field_8 & 0x3CA) ) | 2347 for (uint i = 0; i < 10; ++i) |
2348 if (pStru277[i].field_8 & 0x3CA) | |
2349 { | |
2350 pStru277[i].spellnum = 0; | |
2351 break; | |
2352 } | |
2353 } | |
2354 | |
2355 assert(sizeof(pStru277) / sizeof(*pStru277) == 10); | |
2356 for (uint i = 0; i < 10; ++i) | |
2357 { | |
2358 auto spell = pStru277 + i; | |
2359 if (!spell->spellnum) | |
2360 continue; | |
2361 | |
2362 spell->spellnum = 0; | |
2363 if (spell->field_8 & 0x3CA) | |
2336 { | 2364 { |
2337 ++v16; | 2365 pGUIWindow_Settings->Release(); |
2338 if ( (signed int)v16 >= (signed int)&unk_50C190 ) | 2366 pGUIWindow_Settings = nullptr; |
2339 goto LABEL_33; | 2367 pMouse->SetCursorBitmap("MICON1"); |
2368 GameUI_StatusBar_TimedStringTimeLeft = 0; | |
2369 unk_50C9A0 = 0; | |
2370 back_to_game(); | |
2340 } | 2371 } |
2341 v16->spellnum = 0; | |
2342 } | 2372 } |
2343 do | 2373 |
2344 { | 2374 int result = pStru277->PushStru277(a1, uPlayerID, a4, a5, a6); |
2345 LABEL_33: | |
2346 if ( v15->spellnum ) | |
2347 { | |
2348 v8 = (v15->field_8 & 0x3CA) == 0; | |
2349 v15->spellnum = 0; | |
2350 if ( !v8 ) | |
2351 { | |
2352 pGUIWindow_Settings->Release(); | |
2353 pGUIWindow_Settings = 0; | |
2354 pMouse->SetCursorBitmap("MICON1"); | |
2355 GameUI_StatusBar_TimedStringTimeLeft = 0; | |
2356 unk_50C9A0 = 0; | |
2357 back_to_game(); | |
2358 } | |
2359 } | |
2360 ++v15; | |
2361 } | |
2362 while (v15 < pStru277 + 10); | |
2363 int result = pStru277->PushStru277(a2a, a3a, a4, v6, a6); | |
2364 if ( result != -1 ) | 2375 if ( result != -1 ) |
2365 { | 2376 { |
2366 if ( v6 & 2 ) | 2377 if ( a5 & 2 ) |
2367 { | 2378 { |
2368 if ( pGUIWindow_Settings ) | 2379 if ( pGUIWindow_Settings ) |
2369 return; | 2380 return; |
2370 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); | 2381 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); |
2371 pGUIWindow_Settings->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 0, 0x31u, "", 0); | 2382 pGUIWindow_Settings->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 0, 0x31u, "", 0); |
2373 pGUIWindow_Settings->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 2u, 0x33u, "", 0); | 2384 pGUIWindow_Settings->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 2u, 0x33u, "", 0); |
2374 pGUIWindow_Settings->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 3u, 0x34u, "", 0); | 2385 pGUIWindow_Settings->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, 0x45u, 3u, 0x34u, "", 0); |
2375 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | 2386 sub_421B2C_PlaceInInventory_or_DropPickedItem(); |
2376 return; | 2387 return; |
2377 } | 2388 } |
2378 if ( v6 & 8 ) | 2389 if ( a5 & 8 ) |
2379 { | 2390 { |
2380 if ( pGUIWindow_Settings ) | 2391 if ( pGUIWindow_Settings ) |
2381 return; | 2392 return; |
2382 v17 = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); | 2393 v17 = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); |
2383 v29 = 0; | 2394 v29 = 0; |
2397 LABEL_56: | 2408 LABEL_56: |
2398 v18->CreateButton(v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29); | 2409 v18->CreateButton(v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29); |
2399 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | 2410 sub_421B2C_PlaceInInventory_or_DropPickedItem(); |
2400 return; | 2411 return; |
2401 } | 2412 } |
2402 if ( v6 & 0x40 ) | 2413 if ( a5 & 0x40 ) |
2403 { | 2414 { |
2404 if ( pGUIWindow_Settings ) | 2415 if ( pGUIWindow_Settings ) |
2405 return; | 2416 return; |
2406 v17 = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); | 2417 v17 = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); |
2407 v29 = 0; | 2418 v29 = 0; |
2409 v27 = 0; | 2420 v27 = 0; |
2410 v26 = 0; | 2421 v26 = 0; |
2411 v25 = 190; | 2422 v25 = 190; |
2412 goto LABEL_44; | 2423 goto LABEL_44; |
2413 } | 2424 } |
2414 if ( (char)v6 < 0 ) | 2425 if ( (char)a5 < 0 ) |
2415 { | 2426 { |
2416 if ( pGUIWindow_Settings ) | 2427 if ( pGUIWindow_Settings ) |
2417 return; | 2428 return; |
2418 ++pIcons_LOD->uTexturePacksCount; | 2429 ++pIcons_LOD->uTexturePacksCount; |
2419 if ( !pIcons_LOD->uNumPrevLoadedFiles ) | 2430 if ( !pIcons_LOD->uNumPrevLoadedFiles ) |
2422 unk_50C9A0 = 1; | 2433 unk_50C9A0 = 1; |
2423 some_active_character = uActiveCharacter; | 2434 some_active_character = uActiveCharacter; |
2424 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | 2435 sub_421B2C_PlaceInInventory_or_DropPickedItem(); |
2425 return; | 2436 return; |
2426 } | 2437 } |
2427 if ( HIBYTE(v6) & 1 ) | 2438 if ( HIBYTE(a5) & 1 ) |
2428 { | 2439 { |
2429 if ( pGUIWindow_Settings ) | 2440 if ( pGUIWindow_Settings ) |
2430 return; | 2441 return; |
2431 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); | 2442 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); |
2432 pGUIWindow_Settings->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 0, 0x31u, "", 0); | 2443 pGUIWindow_Settings->CreateButton(0x34u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 0, 0x31u, "", 0); |
2434 pGUIWindow_Settings->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 2u, 0x33u, "", 0); | 2445 pGUIWindow_Settings->CreateButton(0x118u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 2u, 0x33u, "", 0); |
2435 pGUIWindow_Settings->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 3u, 0x34u, "", 0); | 2446 pGUIWindow_Settings->CreateButton(0x186u, 0x1A6u, 0x23u, 0, 2, 0, 0x8Du, 3u, 0x34u, "", 0); |
2436 pGUIWindow_Settings->CreateButton(8, 8, 460, 344, 1, 0, 140, 0, 0, "", NULL); | 2447 pGUIWindow_Settings->CreateButton(8, 8, 460, 344, 1, 0, 140, 0, 0, "", NULL); |
2437 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | 2448 sub_421B2C_PlaceInInventory_or_DropPickedItem(); |
2438 } | 2449 } |
2439 if ( HIBYTE(v6) & 2 && !pGUIWindow_Settings ) | 2450 if ( HIBYTE(a5) & 2 && !pGUIWindow_Settings ) |
2440 { | 2451 { |
2441 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); | 2452 pGUIWindow_Settings = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|0x2), (int)&pStru277[result], 0); |
2442 pBtn_NPCLeft = pGUIWindow_Settings->CreateButton( | 2453 pBtn_NPCLeft = pGUIWindow_Settings->CreateButton( |
2443 0x1D5u, | 2454 0x1D5u, |
2444 0xB2u, | 2455 0xB2u, |
2535 } | 2546 } |
2536 | 2547 |
2537 //----- (00427E01) -------------------------------------------------------- | 2548 //----- (00427E01) -------------------------------------------------------- |
2538 void stru277::_427E01_cast_spell() | 2549 void stru277::_427E01_cast_spell() |
2539 { | 2550 { |
2540 int v1; // esi@1 | 2551 //int v1; // esi@1 |
2541 int v2; // edi@1 | 2552 int v2; // edi@1 |
2542 stru277 *v3; // ebx@2 | 2553 stru277 *v3; // ebx@2 |
2543 signed int v4; // eax@8 | 2554 signed int v4; // eax@8 |
2544 __int16 v5; // ax@9 | 2555 __int16 v5; // ax@9 |
2545 signed int v6; // eax@14 | 2556 signed int v6; // eax@14 |
3281 v711 = ecx0; | 3292 v711 = ecx0; |
3282 | 3293 |
3283 LayingItem a1; // [sp+DDCh] [bp-A8h]@1 | 3294 LayingItem a1; // [sp+DDCh] [bp-A8h]@1 |
3284 //LayingItem::LayingItem(&a1); | 3295 //LayingItem::LayingItem(&a1); |
3285 | 3296 |
3286 v1 = 0; | 3297 //v1 = 0; |
3287 v2 = 0; | 3298 v2 = 0; |
3288 amount = 0; | 3299 amount = 0; |
3289 LODWORD(v733) = 0; | 3300 LODWORD(v733) = 0; |
3290 v723 = 0; | 3301 v723 = 0; |
3291 v727 = 0.0; | 3302 v727 = 0.0; |
3292 n = 0; | 3303 n = 0; |
3293 while ( 1 ) | 3304 while ( 1 ) |
3294 { | 3305 { |
3295 v3 = &v711[n]; | 3306 v3 = &v711[n]; |
3296 HIDWORD(v733) = (int)v3; | 3307 HIDWORD(v733) = (int)v3; |
3297 if ( v3->spellnum == (short)v1 ) | 3308 if ( v3->spellnum == 0 ) |
3298 goto LABEL_1166; | 3309 goto LABEL_1166; |
3299 if ( pParty->pPartyBuffs[11].NotExpired() ) | 3310 |
3300 pParty->pPartyBuffs[11].Reset(); | 3311 if (pParty->Invisible()) |
3312 pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset(); | |
3313 | |
3301 if ( v3->field_8 & 0x3CA ) | 3314 if ( v3->field_8 & 0x3CA ) |
3302 { | 3315 { |
3303 if ( !pParty->pPlayers[v3->uPlayerID].CanAct() ) | 3316 if ( !pParty->pPlayers[v3->uPlayerID].CanAct() ) |
3304 v711->_427D48(1u); | 3317 v711->_427D48(1u); |
3305 goto LABEL_1166; | 3318 goto LABEL_1166; |
3306 } | 3319 } |
3307 pPlayer = &pParty->pPlayers[v3->uPlayerID]; | 3320 pPlayer = &pParty->pPlayers[v3->uPlayerID]; |
3308 v4 = *(int *)&v3->field_C; | 3321 v4 = *(int *)&v3->field_C; |
3309 if ( v4 != v1 ) | 3322 if (v4) |
3310 goto LABEL_18; | 3323 goto LABEL_18; |
3311 v5 = v3->spellnum; | 3324 v5 = v3->spellnum; |
3312 if ( v3->spellnum == 79 || v5 == 48 || v5 == 94 ) | 3325 if ( v3->spellnum == 79 || v5 == 48 || v5 == 94 ) |
3313 v666 = 1; | 3326 v666 = 1; |
3314 else | 3327 else |
3315 v666 = v1; | 3328 v666 = 0; |
3316 a2 = stru_50C198.FindClosestActor(5120, 1, v666); | 3329 a2 = stru_50C198.FindClosestActor(5120, 1, v666); |
3317 v6 = pMouse->uPointingObjectID; | 3330 v6 = pMouse->uPointingObjectID; |
3318 if ( pMouse->uPointingObjectID != v1 && (v6 & 7) == OBJECT_Actor && pActors[v6 >> 3].CanAct() ) | 3331 if ( pMouse->uPointingObjectID && (v6 & 7) == OBJECT_Actor && pActors[v6 >> 3].CanAct() ) |
3319 { | 3332 { |
3320 v4 = pMouse->uPointingObjectID; | 3333 v4 = pMouse->uPointingObjectID; |
3321 LABEL_18: | 3334 LABEL_18: |
3322 a2 = v4; | 3335 a2 = v4; |
3323 } | 3336 } |
3324 a1.uItemType = stru_4E3ACC[v3->spellnum].uItemType; | 3337 a1.uItemType = stru_4E3ACC[v3->spellnum].uItemType; |
3325 if ( (short)a1.uItemType != (short)v1 ) | 3338 if (a1.uItemType) |
3326 { | 3339 { |
3327 if ( (a2 & 7) == OBJECT_Actor) | 3340 if ( (a2 & 7) == OBJECT_Actor) |
3328 { | 3341 { |
3329 memcpy(&v715, Actor::GetDirectionInfo((8 * v3->uPlayerID + 8) | OBJECT_Player, a2, &a3, 0), sizeof(v715)); | 3342 memcpy(&v715, Actor::GetDirectionInfo((8 * v3->uPlayerID + 8) | OBJECT_Player, a2, &a3, 0), sizeof(v715)); |
3330 v2 = v723; | 3343 v2 = v723; |
3331 v1 = 0; | 3344 //v1 = 0; |
3332 } | 3345 } |
3333 else | 3346 else |
3334 { | 3347 { |
3335 v715.uYawAngle = pParty->sRotationY; | 3348 v715.uYawAngle = pParty->sRotationY; |
3336 v715.uPitchAngle = pParty->sRotationX; | 3349 v715.uPitchAngle = pParty->sRotationX; |
3337 } | 3350 } |
3338 } | 3351 } |
3339 v7 = v3->field_A; | 3352 v7 = v3->field_A; |
3340 LODWORD(v725) = v1; | 3353 LODWORD(v725) = 0; |
3341 _this = (ItemGen *)v1; | 3354 _this = 0; |
3342 if ( v7 == (short)v1 ) | 3355 if (!v7) |
3343 { | 3356 { |
3344 v8 = v3->spellnum; | 3357 v8 = v3->spellnum; |
3345 if ( v3->spellnum >= 12 ) | 3358 if ( v3->spellnum >= 12 ) |
3346 { | 3359 { |
3347 if ( v8 >= 23 ) | 3360 if ( v8 >= 23 ) |
3443 v12 = v731; | 3456 v12 = v731; |
3444 } | 3457 } |
3445 LOWORD(v10) = v3->spellnum; | 3458 LOWORD(v10) = v3->spellnum; |
3446 v730 = v10; | 3459 v730 = v10; |
3447 v13 = v12 + 10 * (signed __int16)v10; | 3460 v13 = v12 + 10 * (signed __int16)v10; |
3448 v14 = v3->field_A == (short)v1; | 3461 v14 = v3->field_A == 0; |
3449 v15 = (unsigned __int16)word_4E3C66[v13]; // pSpellDatas [negoffset] indexing | 3462 v15 = (unsigned __int16)word_4E3C66[v13]; // pSpellDatas [negoffset] indexing |
3450 v16 = *(unsigned __int16 *)((char *)&pSpellDatas[0].uMagisterLevelMana + v13 * 2); | 3463 v16 = *(unsigned __int16 *)((char *)&pSpellDatas[0].uMagisterLevelMana + v13 * 2); |
3451 uRequiredMana = v15; | 3464 uRequiredMana = v15; |
3452 sRecoveryTime = v16; | 3465 sRecoveryTime = v16; |
3453 if ( !v14 ) | 3466 if ( !v14 ) |
3454 uRequiredMana = v1; | 3467 uRequiredMana = 0; |
3455 if ( pParty->uCurrentHour == v1 ) | 3468 if ( pParty->uCurrentHour == 0 ) |
3456 { | 3469 { |
3457 if ( pParty->uCurrentMinute != v1 ) | 3470 if ( pParty->uCurrentMinute != 0 ) |
3458 goto LABEL_62; | 3471 goto LABEL_62; |
3459 if ( LODWORD(v725) == 20 ) | 3472 if ( LODWORD(v725) == 20 ) |
3460 goto LABEL_61; | 3473 goto LABEL_61; |
3461 } | 3474 } |
3462 if ( pParty->uCurrentHour == 12 && pParty->uCurrentMinute == v1 && LODWORD(v725) == 19 ) | 3475 if ( pParty->uCurrentHour == 12 && pParty->uCurrentMinute == 0 && LODWORD(v725) == 19 ) |
3463 LABEL_61: | 3476 LABEL_61: |
3464 uRequiredMana = v1; | 3477 uRequiredMana = 0; |
3465 LABEL_62: | 3478 LABEL_62: |
3466 if ( (signed __int16)v730 >= 100 || ((pPlayer->sMana - uRequiredMana) & 0x80000000u) == 0 ) | 3479 if ( (signed __int16)v730 >= 100 || ((pPlayer->sMana - uRequiredMana) & 0x80000000u) == 0 ) |
3467 break; | 3480 break; |
3468 ShowStatusBarString(pGlobalTXT_LocalizationStrings[586], 2u); | 3481 ShowStatusBarString(pGlobalTXT_LocalizationStrings[586], 2u); |
3469 LABEL_203: | 3482 LABEL_203: |
3470 v3->spellnum = v1; | 3483 v3->spellnum = 0; |
3471 LABEL_1166: | 3484 LABEL_1166: |
3472 ++n; | 3485 ++n; |
3473 if ( n >= 10 ) | 3486 if ( n >= 10 ) |
3474 return; | 3487 return; |
3475 } | 3488 } |
3580 { | 3593 { |
3581 amount = 3; | 3594 amount = 3; |
3582 } | 3595 } |
3583 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 3596 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
3584 goto LABEL_83; | 3597 goto LABEL_83; |
3585 v668 = v1; | 3598 v668 = 0; |
3586 v658 = v1; | 3599 v658 = 0; |
3587 v653 = amount; | 3600 v653 = amount; |
3588 v651 = v731; | 3601 v651 = v731; |
3589 v26 = (signed __int64)((double)(signed int)v733 * 4.2666669); | 3602 v26 = (signed __int64)((double)(signed int)v733 * 4.2666669); |
3590 v27 = (char *)&pParty->pPartyBuffs[16]; | 3603 v27 = (char *)&pParty->pPartyBuffs[16]; |
3591 goto LABEL_101; | 3604 goto LABEL_101; |
3609 else | 3622 else |
3610 { | 3623 { |
3611 amount = 5; | 3624 amount = 5; |
3612 } | 3625 } |
3613 v31 = v3->uPlayerID; | 3626 v31 = v3->uPlayerID; |
3614 HIDWORD(v733) = v1; | 3627 HIDWORD(v733) = 0; |
3615 v32 = 8 * v31; | 3628 v32 = 8 * v31; |
3616 LOBYTE(v32) = v32 | 4; | 3629 LOBYTE(v32) = v32 | OBJECT_Player; |
3617 if ( (signed int)uNumLayingItems > v1 ) | 3630 if ( (signed int)uNumLayingItems > 0 ) |
3618 { | 3631 { |
3619 v33 = (char *)&pLayingItems[0].field_48; | 3632 v33 = (char *)&pLayingItems[0].field_48; |
3620 v730 = uNumLayingItems; | 3633 v730 = uNumLayingItems; |
3621 do | 3634 do |
3622 { | 3635 { |
3623 if ( *((short *)v33 - 36) != (short)v1 && *(int *)v33 == 7 && *((int *)v33 + 4) == v32 ) | 3636 if ( *((short *)v33 - 36) && *(int *)v33 == 7 && *((int *)v33 + 4) == v32 ) |
3624 ++HIDWORD(v733); | 3637 ++HIDWORD(v733); |
3625 v33 += 112; | 3638 v33 += 112; |
3626 --v730; | 3639 --v730; |
3627 } | 3640 } |
3628 while ( v730 ); | 3641 while ( v730 ); |
3636 a1.field_4C = v2; | 3649 a1.field_4C = v2; |
3637 a1.field_50 = v731; | 3650 a1.field_50 = v731; |
3638 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | 3651 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); |
3639 a1.vPosition.y = pParty->vPosition.y; | 3652 a1.vPosition.y = pParty->vPosition.y; |
3640 a1.vPosition.x = pParty->vPosition.x; | 3653 a1.vPosition.x = pParty->vPosition.x; |
3641 a1.uAttributes = v1; | 3654 a1.uAttributes = 0; |
3642 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | 3655 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
3643 a1.uSectorID = pIndoor->GetSector( | 3656 a1.uSectorID = pIndoor->GetSector( |
3644 pParty->vPosition.x, | 3657 pParty->vPosition.x, |
3645 pParty->vPosition.y, | 3658 pParty->vPosition.y, |
3646 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | 3659 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); |
3647 a1.uSpriteFrameID = v1; | 3660 a1.uSpriteFrameID = 0; |
3648 v34 = 8 * v3->uPlayerID; | 3661 v34 = 8 * v3->uPlayerID; |
3649 LOBYTE(v34) = v34 | OBJECT_Player; | 3662 LOBYTE(v34) = v34 | OBJECT_Player; |
3650 a1.field_58_pid = v34; | 3663 a1.field_58_pid = v34; |
3651 a1.field_5C = a2; | 3664 a1.field_5C = a2; |
3652 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | 3665 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); |
3659 v35 = pParty->sRotationX + 10; | 3672 v35 = pParty->sRotationX + 10; |
3660 goto LABEL_124; | 3673 goto LABEL_124; |
3661 case 20: | 3674 case 20: |
3662 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 3675 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
3663 goto LABEL_83; | 3676 goto LABEL_83; |
3664 if ( a2 == v1 ) | 3677 if (!a2) |
3665 goto LABEL_200; | 3678 goto LABEL_200; |
3666 if ( (a2 & 7) != OBJECT_Actor) | 3679 if ( (a2 & 7) != OBJECT_Actor) |
3667 goto LABEL_1056; | 3680 goto LABEL_1056; |
3668 v699 = v1; | 3681 v699 = 0; |
3669 v698 = v1; | 3682 v698 = 0; |
3670 v697 = v1; | 3683 v697 = 0; |
3671 a1.stru_24.Reset(); | 3684 a1.stru_24.Reset(); |
3672 a1.field_48 = v3->spellnum; | 3685 a1.field_48 = v3->spellnum; |
3673 a1.field_4C = v2; | 3686 a1.field_4C = v2; |
3674 a1.field_50 = v731; | 3687 a1.field_50 = v731; |
3675 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | 3688 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); |
3676 a1.uAttributes = v1; | 3689 a1.uAttributes = 0; |
3677 a1.uSectorID = v1; | 3690 a1.uSectorID = 0; |
3678 a1.uSpriteFrameID = v1; | 3691 a1.uSpriteFrameID = 0; |
3679 v37 = v3->uPlayerID; | 3692 v37 = v3->uPlayerID; |
3680 a1.field_60_distance_related_prolly_lod = 0; | 3693 a1.field_60_distance_related_prolly_lod = 0; |
3681 v37 *= 8; | 3694 v37 *= 8; |
3682 LOBYTE(v37) = v37 | OBJECT_Player; | 3695 LOBYTE(v37) = v37 | OBJECT_Player; |
3683 a1.uFacing = v1; | 3696 a1.uFacing = 0; |
3684 a1.field_58_pid = v37; | 3697 a1.field_58_pid = v37; |
3685 v38 = a2 >> 3; | 3698 v38 = a2 >> 3; |
3686 a1.uSoundID = LOWORD(v3->field_10); | 3699 a1.uSoundID = LOWORD(v3->field_10); |
3687 v39 = a2 >> 3; | 3700 v39 = a2 >> 3; |
3688 a1.vPosition.x = pActors[v39].vPosition.x; | 3701 a1.vPosition.x = pActors[v39].vPosition.x; |
3689 v40 = pActors[v39].vPosition.y; | 3702 v40 = pActors[v39].vPosition.y; |
3690 a1.vPosition.z = pActors[v39].vPosition.z; | 3703 a1.vPosition.z = pActors[v39].vPosition.z; |
3691 v41 = 8 * (a2 >> 3); | 3704 v41 = 8 * (a2 >> 3); |
3692 a1.vPosition.y = v40; | 3705 a1.vPosition.y = v40; |
3693 LOBYTE(v41) = v41 | 3; | 3706 LOBYTE(v41) = v41 | OBJECT_Actor; |
3694 a1.field_5C = v41; | 3707 a1.field_5C = v41; |
3695 v42 = a1.Create(0, v1, v1, v1); | 3708 v42 = a1.Create(0, 0, 0, 0); |
3696 v43 = &v697; | 3709 v43 = &v697; |
3697 goto LABEL_133; | 3710 goto LABEL_133; |
3698 case 44: | 3711 case 44: |
3699 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 3712 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
3700 goto LABEL_83; | 3713 goto LABEL_83; |
3701 v726 = (Player *)(a2 >> 3); | 3714 v726 = (Player *)(a2 >> 3); |
3702 HIDWORD(v733) = 836 * (a2 >> 3); | 3715 HIDWORD(v733) = 836 * (a2 >> 3); |
3703 if ( !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 3u) ) | 3716 if ( !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 3u) ) |
3704 goto LABEL_1056; | 3717 goto LABEL_1056; |
3705 pActors[a2 >> 3].pActorBuffs[10].Apply( | 3718 pActors[a2 >> 3].pActorBuffs[10].Apply( |
3706 pMiscTimer->uTotalGameTimeElapsed + 128, | 3719 pMiscTimer->uTotalGameTimeElapsed + 128, 0, 0, 0, 0); |
3707 v1, | 3720 v706 = 0; |
3708 v1, | 3721 v705 = 0; |
3709 v1, | 3722 v704 = 0; |
3710 v1); | |
3711 v706 = v1; | |
3712 v705 = v1; | |
3713 v704 = v1; | |
3714 a1.stru_24.Reset(); | 3723 a1.stru_24.Reset(); |
3715 a1.field_48 = v3->spellnum; | 3724 a1.field_48 = v3->spellnum; |
3716 a1.field_4C = v2; | 3725 a1.field_4C = v2; |
3717 a1.field_50 = v731; | 3726 a1.field_50 = v731; |
3718 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | 3727 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); |
3719 a1.uAttributes = v1; | 3728 a1.uAttributes = 0; |
3720 a1.uSectorID = v1; | 3729 a1.uSectorID = 0; |
3721 a1.uSpriteFrameID = v1; | 3730 a1.uSpriteFrameID = 0; |
3722 v44 = v3->uPlayerID; | 3731 v44 = v3->uPlayerID; |
3723 a1.field_60_distance_related_prolly_lod = 0; | 3732 a1.field_60_distance_related_prolly_lod = 0; |
3724 a1.uFacing = v1; | 3733 a1.uFacing = 0; |
3725 v44 *= 8; | 3734 v44 *= 8; |
3726 LOBYTE(v44) = v44 | OBJECT_Player; | 3735 LOBYTE(v44) = v44 | OBJECT_Player; |
3727 v38 = (signed int)v726; | 3736 v38 = (signed int)v726; |
3728 a1.field_58_pid = v44; | 3737 a1.field_58_pid = v44; |
3729 a1.uSoundID = LOWORD(v3->field_10); | 3738 a1.uSoundID = LOWORD(v3->field_10); |
3730 a1.vPosition.x = *(__int16 *)((char *)&pActors[0].vPosition.x + HIDWORD(v733)); | 3739 a1.vPosition.x = *(__int16 *)((char *)&pActors[0].vPosition.x + HIDWORD(v733)); |
3731 v45 = *(__int16 *)((char *)&pActors[0].vPosition.y + HIDWORD(v733)); | 3740 v45 = *(__int16 *)((char *)&pActors[0].vPosition.y + HIDWORD(v733)); |
3732 a1.vPosition.z = *(__int16 *)((char *)&pActors[0].vPosition.z + HIDWORD(v733)); | 3741 a1.vPosition.z = *(__int16 *)((char *)&pActors[0].vPosition.z + HIDWORD(v733)); |
3733 v46 = 8 * (int)v726; | 3742 v46 = 8 * (int)v726; |
3734 a1.vPosition.y = v45; | 3743 a1.vPosition.y = v45; |
3735 LOBYTE(v46) = 8 * (char)v726 | 3; | 3744 LOBYTE(v46) = 8 * (char)v726 | OBJECT_Actor; |
3736 a1.field_5C = v46; | 3745 a1.field_5C = v46; |
3737 v42 = a1.Create(0, v1, v1, v1); | 3746 v42 = a1.Create(0, 0, 0, 0); |
3738 v43 = &v704; | 3747 v43 = &v704; |
3739 LABEL_133: | 3748 LABEL_133: |
3740 v670 = (Vec3_int_ *)v43; | 3749 v670 = (Vec3_int_ *)v43; |
3741 v47 = v38; | 3750 v47 = v38; |
3742 goto LABEL_139; | 3751 goto LABEL_139; |
3743 case 79: | 3752 case 79: |
3744 if ( !pPlayer->CanCastSpell(uRequiredMana) || a2 == v1 || (a2 & 7) != OBJECT_Actor) | 3753 if ( !pPlayer->CanCastSpell(uRequiredMana) || !a2 || (a2 & 7) != OBJECT_Actor) |
3745 goto LABEL_83; | 3754 goto LABEL_83; |
3746 v730 = a2 >> 3; | 3755 v730 = a2 >> 3; |
3747 v693 = v1; | 3756 v693 = 0; |
3748 HIDWORD(v733) = (int)&pActors[a2 >> 3]; | 3757 HIDWORD(v733) = (int)&pActors[a2 >> 3]; |
3749 v692 = v1; | 3758 v692 = 0; |
3750 v691 = v1; | 3759 v691 = 0; |
3751 a1.stru_24.Reset(); | 3760 a1.stru_24.Reset(); |
3752 a1.field_48 = v3->spellnum; | 3761 a1.field_48 = v3->spellnum; |
3753 a1.field_4C = v2; | 3762 a1.field_4C = v2; |
3754 a1.field_50 = v731; | 3763 a1.field_50 = v731; |
3755 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | 3764 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); |
3756 a1.vPosition.x = *(short *)(HIDWORD(v733) + 142); | 3765 a1.vPosition.x = *(short *)(HIDWORD(v733) + 142); |
3757 a1.vPosition.y = *(short *)(HIDWORD(v733) + 144); | 3766 a1.vPosition.y = *(short *)(HIDWORD(v733) + 144); |
3758 v48 = *(short *)(HIDWORD(v733) + 138); | 3767 v48 = *(short *)(HIDWORD(v733) + 138); |
3759 a1.vPosition.z = *(short *)(HIDWORD(v733) + 138); | 3768 a1.vPosition.z = *(short *)(HIDWORD(v733) + 138); |
3760 a1.uAttributes = v1; | 3769 a1.uAttributes = 0; |
3761 a1.uSectorID = pIndoor->GetSector(a1.vPosition.x, a1.vPosition.y, v48); | 3770 a1.uSectorID = pIndoor->GetSector(a1.vPosition.x, a1.vPosition.y, v48); |
3762 a1.uSpriteFrameID = v1; | 3771 a1.uSpriteFrameID = 0; |
3763 v49 = 8 * v3->uPlayerID; | 3772 v49 = 8 * v3->uPlayerID; |
3764 LOBYTE(v49) = v49 | OBJECT_Player; | 3773 LOBYTE(v49) = v49 | OBJECT_Player; |
3765 a1.field_58_pid = v49; | 3774 a1.field_58_pid = v49; |
3766 a1.field_5C = a2; | 3775 a1.field_5C = a2; |
3767 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | 3776 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); |
3768 a1.uFacing = LOWORD(v715.uYawAngle); | 3777 a1.uFacing = LOWORD(v715.uYawAngle); |
3769 LOWORD(v49) = LOWORD(v3->field_10); | 3778 LOWORD(v49) = LOWORD(v3->field_10); |
3770 LOBYTE(a1.uAttributes) |= 0x80u; | 3779 LOBYTE(a1.uAttributes) |= 0x80u; |
3771 a1.uSoundID = v49; | 3780 a1.uSoundID = v49; |
3772 v726 = (Player *)a1.Create(0, v1, v1, v1); | 3781 v726 = (Player *)a1.Create(0, 0, 0, 0); |
3773 if ( !MonsterStats::BelongsToSupertype(*(short *)(HIDWORD(v733) + 96), MONSTER_SUPERTYPE_UNDEAD) ) | 3782 if ( !MonsterStats::BelongsToSupertype(*(short *)(HIDWORD(v733) + 96), MONSTER_SUPERTYPE_UNDEAD) ) |
3774 goto LABEL_200; | 3783 goto LABEL_200; |
3775 v47 = v730; | 3784 v47 = v730; |
3776 v670 = (Vec3_int_ *)&v691; | 3785 v670 = (Vec3_int_ *)&v691; |
3777 v42 = (signed int)v726; | 3786 v42 = (signed int)v726; |
3798 a1.field_4C = v2; | 3807 a1.field_4C = v2; |
3799 a1.field_50 = v731; | 3808 a1.field_50 = v731; |
3800 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | 3809 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); |
3801 a1.vPosition.y = pParty->vPosition.y; | 3810 a1.vPosition.y = pParty->vPosition.y; |
3802 a1.vPosition.x = pParty->vPosition.x; | 3811 a1.vPosition.x = pParty->vPosition.x; |
3803 a1.uAttributes = v1; | 3812 a1.uAttributes = 0; |
3804 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | 3813 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
3805 a1.uSectorID = pIndoor->GetSector( | 3814 a1.uSectorID = pIndoor->GetSector( |
3806 pParty->vPosition.x, | 3815 pParty->vPosition.x, |
3807 pParty->vPosition.y, | 3816 pParty->vPosition.y, |
3808 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | 3817 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); |
3809 a1.uSpriteFrameID = v1; | 3818 a1.uSpriteFrameID = 0; |
3810 v50 = 8 * v3->uPlayerID; | 3819 v50 = 8 * v3->uPlayerID; |
3811 LOBYTE(v50) = v50 | OBJECT_Player; | 3820 LOBYTE(v50) = v50 | OBJECT_Player; |
3812 a1.field_58_pid = v50; | 3821 a1.field_58_pid = v50; |
3813 a1.field_5C = a2; | 3822 a1.field_5C = a2; |
3814 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | 3823 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); |
3843 goto LABEL_152; | 3852 goto LABEL_152; |
3844 goto LABEL_83; | 3853 goto LABEL_83; |
3845 case 81: | 3854 case 81: |
3846 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 3855 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
3847 goto LABEL_83; | 3856 goto LABEL_83; |
3848 if ( a2 == v1 | 3857 if ( !a2 |
3849 || (a2 & 7) != OBJECT_Actor | 3858 || (a2 & 7) != OBJECT_Actor |
3850 || (v730 = a2 >> 3, | 3859 || (v730 = a2 >> 3, |
3851 v721 = (int)&pActors[a2 >> 3], | 3860 v721 = (int)&pActors[a2 >> 3], |
3852 !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 9u)) ) | 3861 !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 9u)) ) |
3853 goto LABEL_1056; | 3862 goto LABEL_1056; |
3854 Actor::AI_Stand(v730, 4u, 0x80u, (AIDirection *)v1); | 3863 Actor::AI_Stand(v730, 4u, 0x80u, 0); |
3855 v726 = (Player *)(23040 * v2); | 3864 v726 = (Player *)(23040 * v2); |
3856 v54 = (signed __int64)((double)(23040 * v2) * 0.033333335); | 3865 v54 = (signed __int64)((double)(23040 * v2) * 0.033333335); |
3857 v55 = v721; | 3866 v55 = v721; |
3858 ((SpellBuff *)(v721 + 308))->Apply(pParty->uTimePlayed + (signed int)v54, v731, v1, v1, v1); | 3867 ((SpellBuff *)(v721 + 308))->Apply(pParty->uTimePlayed + (signed int)v54, v731, 0, 0, 0); |
3859 *(char *)(v55 + 38) |= 8u; | 3868 *(char *)(v55 + 38) |= 8u; |
3860 *(short *)(v55 + 148) = v1; | 3869 *(short *)(v55 + 148) = 0; |
3861 v672 = v1; | 3870 v672 = 0; |
3862 *(short *)(v55 + 150) = v1; | 3871 *(short *)(v55 + 150) = 0; |
3863 v661 = (Actor *)v55; | 3872 v661 = (Actor *)v55; |
3864 goto LABEL_165; | 3873 goto LABEL_165; |
3865 case 35: | 3874 case 35: |
3866 if ( v12 == 2 ) | 3875 if ( v12 == 2 ) |
3867 { | 3876 { |
3899 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[7] + v721))->Apply( | 3908 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[7] + v721))->Apply( |
3900 pActors[a2 >> 3].pActorBuffs[7].Apply( | 3909 pActors[a2 >> 3].pActorBuffs[7].Apply( |
3901 pParty->uTimePlayed + (signed int)v58, | 3910 pParty->uTimePlayed + (signed int)v58, |
3902 v731, | 3911 v731, |
3903 amount, | 3912 amount, |
3904 v1, | 3913 0, |
3905 v1); | 3914 0); |
3906 *((char *)&pActors[0].uAttributes + v59 + 2) |= 8u; | 3915 *((char *)&pActors[0].uAttributes + v59 + 2) |= 8u; |
3907 v672 = v1; | 3916 v672 = 0; |
3908 v661 = (Actor *)LODWORD(v718); | 3917 v661 = (Actor *)LODWORD(v718); |
3909 goto LABEL_165; | 3918 goto LABEL_165; |
3910 case 60: | 3919 case 60: |
3911 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 3920 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
3912 goto LABEL_83; | 3921 goto LABEL_83; |
3929 pActors[a2 >> 3].pActorBuffs[12].Reset(); | 3938 pActors[a2 >> 3].pActorBuffs[12].Reset(); |
3930 v726 = (Player *)((int)v733 << 7); | 3939 v726 = (Player *)((int)v733 << 7); |
3931 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[1] + v730))->Apply( | 3940 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[1] + v730))->Apply( |
3932 pActors[a2 >> 3].pActorBuffs[1].Apply( | 3941 pActors[a2 >> 3].pActorBuffs[1].Apply( |
3933 pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), | 3942 pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), |
3934 v731, | 3943 v731, 0, 0, 0); |
3935 v1, | |
3936 v1, | |
3937 v1); | |
3938 a1.stru_24.Reset(); | 3944 a1.stru_24.Reset(); |
3939 a1.field_48 = v3->spellnum; | 3945 a1.field_48 = v3->spellnum; |
3940 a1.field_4C = v2; | 3946 a1.field_4C = v2; |
3941 a1.field_50 = v731; | 3947 a1.field_50 = v731; |
3942 v60 = pObjectList->ObjectIDByItemID(a1.uItemType); | 3948 v60 = pObjectList->ObjectIDByItemID(a1.uItemType); |
3947 goto LABEL_83; | 3953 goto LABEL_83; |
3948 a1.stru_24.Reset(); | 3954 a1.stru_24.Reset(); |
3949 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | 3955 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); |
3950 a1.vPosition.x = pParty->vPosition.x; | 3956 a1.vPosition.x = pParty->vPosition.x; |
3951 a1.vPosition.y = pParty->vPosition.y; | 3957 a1.vPosition.y = pParty->vPosition.y; |
3952 a1.uAttributes = v1; | 3958 a1.uAttributes = 0; |
3953 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | 3959 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
3954 a1.uSectorID = pIndoor->GetSector( | 3960 a1.uSectorID = pIndoor->GetSector( |
3955 pParty->vPosition.x, | 3961 pParty->vPosition.x, |
3956 pParty->vPosition.y, | 3962 pParty->vPosition.y, |
3957 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | 3963 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); |
3958 a1.uSpriteFrameID = v1; | 3964 a1.uSpriteFrameID = 0; |
3959 v62 = 8 * v3->uPlayerID; | 3965 v62 = 8 * v3->uPlayerID; |
3960 LOBYTE(v62) = v62 | OBJECT_Player; | 3966 LOBYTE(v62) = v62 | OBJECT_Player; |
3961 a1.field_58_pid = v62; | 3967 a1.field_58_pid = v62; |
3962 a1.field_5C = a2; | 3968 a1.field_5C = a2; |
3963 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | 3969 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); |
3988 LODWORD(v733) = 3600 * v2; | 3994 LODWORD(v733) = 3600 * v2; |
3989 goto LABEL_196; | 3995 goto LABEL_196; |
3990 } | 3996 } |
3991 if ( v65 == 1 ) | 3997 if ( v65 == 1 ) |
3992 { | 3998 { |
3993 LODWORD(v733) = v1; | 3999 LODWORD(v733) = 0; |
3994 amount = 12; | 4000 amount = 12; |
3995 } | 4001 } |
3996 LABEL_196: | 4002 LABEL_196: |
3997 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 4003 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
3998 goto LABEL_83; | 4004 goto LABEL_83; |
4001 v730c->UpdateTempBonus(pParty->uTimePlayed); | 4007 v730c->UpdateTempBonus(pParty->uTimePlayed); |
4002 if ( v730c->uItemID < 64 || v730c->uItemID > 65 ) | 4008 if ( v730c->uItemID < 64 || v730c->uItemID > 65 ) |
4003 { | 4009 { |
4004 if (!v730c->Broken()) | 4010 if (!v730c->Broken()) |
4005 { | 4011 { |
4006 if ( v730c->uSpecEnchantmentType == v1 ) | 4012 if (!v730c->uSpecEnchantmentType) |
4007 { | 4013 { |
4008 if ( v730c->uEncantmentType == v1 ) | 4014 if (!v730c->uEncantmentType) |
4009 { | 4015 { |
4010 v68 = BYTE4(v726->pConditions[3]); | 4016 v68 = BYTE4(v726->pConditions[3]); |
4011 if ( !v68 || v68 == 1 || v68 == 2 ) | 4017 if ( !v68 || v68 == 1 || v68 == 2 ) |
4012 { | 4018 { |
4013 if ( !pItemsTable->IsMaterialNonCommon(v730c) ) | 4019 if ( !pItemsTable->IsMaterialNonCommon(v730c) ) |
4065 pPlayer->PlaySound(SPEECH_49, 0); | 4071 pPlayer->PlaySound(SPEECH_49, 0); |
4066 goto LABEL_1162; | 4072 goto LABEL_1162; |
4067 } | 4073 } |
4068 } | 4074 } |
4069 v3->spellnum = 0; | 4075 v3->spellnum = 0; |
4070 v1 = 0; | 4076 //v1 = 0; |
4071 LABEL_1165: | 4077 LABEL_1165: |
4072 v2 = v723; | 4078 v2 = v723; |
4073 goto LABEL_1166; | 4079 goto LABEL_1166; |
4074 } | 4080 } |
4075 } | 4081 } |
4077 } | 4083 } |
4078 } | 4084 } |
4079 } | 4085 } |
4080 LABEL_199: | 4086 LABEL_199: |
4081 dword_50C9D0 = 113; | 4087 dword_50C9D0 = 113; |
4082 dword_50C9D4 = v1; | 4088 dword_50C9D4 = 0; |
4083 dword_50C9D8 = 1; | 4089 dword_50C9D8 = 1; |
4084 LABEL_200: | 4090 LABEL_200: |
4085 v66 = pGlobalTXT_LocalizationStrings[428]; | 4091 v66 = pGlobalTXT_LocalizationStrings[428]; |
4086 LABEL_201: | 4092 LABEL_201: |
4087 v67 = 2; | 4093 v67 = 2; |
4088 LABEL_202: | 4094 LABEL_202: |
4089 ShowStatusBarString(v66, v67); | 4095 ShowStatusBarString(v66, v67); |
4090 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1); | 4096 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
4091 goto LABEL_203; | 4097 goto LABEL_203; |
4092 case 71: | 4098 case 71: |
4093 v70 = v12 - 1; | 4099 v70 = v12 - 1; |
4094 LODWORD(v733) = 3600 * v2; | 4100 LODWORD(v733) = 3600 * v2; |
4095 if ( v70 && (v71 = v70 - 1) != 0 ) | 4101 if ( v70 && (v71 = v70 - 1) != 0 ) |
4113 goto LABEL_83; | 4119 goto LABEL_83; |
4114 v73 = v3->uPlayerID_2; | 4120 v73 = v3->uPlayerID_2; |
4115 v74 = v3->spellnum; | 4121 v74 = v3->spellnum; |
4116 v75 = pGame->GetStru6(); | 4122 v75 = pGame->GetStru6(); |
4117 pGame->GetStru6()->SetPlayerBuffAnim(v74, v73); | 4123 pGame->GetStru6()->SetPlayerBuffAnim(v74, v73); |
4118 v668 = v1; | 4124 v668 = 0; |
4119 v658 = v1; | 4125 v658 = 0; |
4120 v653 = amount; | 4126 v653 = amount; |
4121 v651 = v731; | 4127 v651 = v731; |
4122 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)v733 * 4.2666669); | 4128 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)v733 * 4.2666669); |
4123 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[12]; | 4129 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[12]; |
4124 goto LABEL_103; | 4130 goto LABEL_103; |
4163 { | 4169 { |
4164 case 3: | 4170 case 3: |
4165 LODWORD(v725) = 6; | 4171 LODWORD(v725) = 6; |
4166 break; | 4172 break; |
4167 case 14: | 4173 case 14: |
4168 LODWORD(v725) = v1; | 4174 LODWORD(v725) = 0; |
4169 break; | 4175 break; |
4170 case 25: | 4176 case 25: |
4171 LODWORD(v725) = 17; | 4177 LODWORD(v725) = 17; |
4172 break; | 4178 break; |
4173 case 36: | 4179 case 36: |
4184 } | 4190 } |
4185 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 4191 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
4186 goto LABEL_83; | 4192 goto LABEL_83; |
4187 v81 = v3->spellnum; | 4193 v81 = v3->spellnum; |
4188 v82 = pGame->GetStru6(); | 4194 v82 = pGame->GetStru6(); |
4189 pGame->GetStru6()->SetPlayerBuffAnim(v81, v1); | 4195 pGame->GetStru6()->SetPlayerBuffAnim(v81, 0); |
4190 v83 = 1; | 4196 v83 = 1; |
4191 v84 = v3->spellnum; | 4197 v84 = v3->spellnum; |
4192 v85 = pGame->GetStru6(); | 4198 v85 = pGame->GetStru6(); |
4193 pGame->GetStru6()->SetPlayerBuffAnim(v84, 1u); | 4199 pGame->GetStru6()->SetPlayerBuffAnim(v84, 1); |
4194 v86 = v3->spellnum; | 4200 v86 = v3->spellnum; |
4195 v87 = pGame->GetStru6(); | 4201 v87 = pGame->GetStru6(); |
4196 pGame->GetStru6()->SetPlayerBuffAnim(v86, 2u); | 4202 pGame->GetStru6()->SetPlayerBuffAnim(v86, 2); |
4197 v88 = v3->spellnum; | 4203 v88 = v3->spellnum; |
4198 v89 = pGame->GetStru6(); | 4204 v89 = pGame->GetStru6(); |
4199 pGame->GetStru6()->SetPlayerBuffAnim(v88, 3u); | 4205 pGame->GetStru6()->SetPlayerBuffAnim(v88, 3); |
4200 v90 = (double)(signed int)v733 * 4.2666669; | 4206 v90 = (double)(signed int)v733 * 4.2666669; |
4201 goto LABEL_304; | 4207 goto LABEL_304; |
4202 case 5: | 4208 case 5: |
4203 if ( v12 <= v1 ) | 4209 if ( v12 <= 0 ) |
4204 goto LABEL_254; | 4210 goto LABEL_254; |
4205 if ( v12 <= 2 ) | 4211 if ( v12 <= 2 ) |
4206 { | 4212 { |
4207 v91 = 60 * (v2 + 60); | 4213 v91 = 60 * (v2 + 60); |
4208 } | 4214 } |
4226 v92 = pParty->pPlayers;//[0].pConditions[1]; | 4232 v92 = pParty->pPlayers;//[0].pConditions[1]; |
4227 LODWORD(v727) = 1; | 4233 LODWORD(v727) = 1; |
4228 do | 4234 do |
4229 { | 4235 { |
4230 if ( v92->pConditions ) | 4236 if ( v92->pConditions ) |
4231 LODWORD(v727) = v1; | 4237 LODWORD(v727) = 0; |
4232 ++v92; | 4238 ++v92; |
4233 } | 4239 } |
4234 while ( v92 <= &pParty->pPlayers[3] ); | 4240 while ( v92 <= &pParty->pPlayers[3] ); |
4235 if ( LODWORD(v727) != v1 ) | 4241 if (LODWORD(v727)) |
4236 { | 4242 { |
4237 v726 = (Player *)((int)v733 << 7); | 4243 v726 = (Player *)((int)v733 << 7); |
4238 pParty->pPartyBuffs[8].Apply( | 4244 pParty->pPartyBuffs[8].Apply( |
4239 pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), | 4245 pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), |
4240 v731, | 4246 v731, 0, 0, 0); |
4241 v1, | |
4242 v1, | |
4243 v1); | |
4244 v93 = v3->spellnum; | 4247 v93 = v3->spellnum; |
4245 v94 = pGame->GetStru6(); | 4248 v94 = pGame->GetStru6(); |
4246 pGame->GetStru6()->SetPlayerBuffAnim(v93, v1); | 4249 pGame->GetStru6()->SetPlayerBuffAnim(v93, 0); |
4247 v95 = v3->spellnum; | 4250 v95 = v3->spellnum; |
4248 v96 = pGame->GetStru6(); | 4251 v96 = pGame->GetStru6(); |
4249 pGame->GetStru6()->SetPlayerBuffAnim(v95, 1u); | 4252 pGame->GetStru6()->SetPlayerBuffAnim(v95, 1); |
4250 v97 = v3->spellnum; | 4253 v97 = v3->spellnum; |
4251 v98 = pGame->GetStru6(); | 4254 v98 = pGame->GetStru6(); |
4252 pGame->GetStru6()->SetPlayerBuffAnim(v97, 2u); | 4255 pGame->GetStru6()->SetPlayerBuffAnim(v97, 2); |
4253 v99 = v3->spellnum; | 4256 v99 = v3->spellnum; |
4254 v100 = pGame->GetStru6(); | 4257 v100 = pGame->GetStru6(); |
4255 pGame->GetStru6()->SetPlayerBuffAnim(v99, 3u); | 4258 pGame->GetStru6()->SetPlayerBuffAnim(v99, 3); |
4256 } | 4259 } |
4257 } | 4260 } |
4258 goto LABEL_83; | 4261 goto LABEL_83; |
4259 case 46: | 4262 case 46: |
4260 v101 = v12 - 1; | 4263 v101 = v12 - 1; |
4285 { | 4288 { |
4286 v108 = v3->uPlayerID_2; | 4289 v108 = v3->uPlayerID_2; |
4287 v109 = v3->spellnum; | 4290 v109 = v3->spellnum; |
4288 v110 = pGame->GetStru6(); | 4291 v110 = pGame->GetStru6(); |
4289 pGame->GetStru6()->SetPlayerBuffAnim(v109, v108); | 4292 pGame->GetStru6()->SetPlayerBuffAnim(v109, v108); |
4290 v111 = pOtherOverlayList->_4418B1(10000, v3->uPlayerID_2 + 310, v1, 65536); | 4293 v111 = pOtherOverlayList->_4418B1(10000, v3->uPlayerID_2 + 310, 0, 65536); |
4291 v668 = v1; | 4294 v668 = 0; |
4292 v716 = v111; | 4295 v716 = v111; |
4293 v658 = v111; | 4296 v658 = v111; |
4294 v653 = amount; | 4297 v653 = amount; |
4295 v726 = (Player *)((int)v733 << 7); | 4298 v726 = (Player *)((int)v733 << 7); |
4296 v651 = 1; | 4299 v651 = 1; |
4305 do | 4308 do |
4306 { | 4309 { |
4307 v106 = v3->spellnum; | 4310 v106 = v3->spellnum; |
4308 v107 = pGame->GetStru6(); | 4311 v107 = pGame->GetStru6(); |
4309 pGame->GetStru6()->SetPlayerBuffAnim(v106, v105); | 4312 pGame->GetStru6()->SetPlayerBuffAnim(v106, v105); |
4310 v716 = pOtherOverlayList->_4418B1(10000, v105 + 310, v1, 65536); | 4313 v716 = pOtherOverlayList->_4418B1(10000, v105 + 310, 0, 65536); |
4311 v730b->pPlayerBuffs[1].Apply(pParty->uTimePlayed + v717, v731, amount, v716, v1); | 4314 v730b->pPlayerBuffs[1].Apply(pParty->uTimePlayed + v717, v731, amount, v716, 0); |
4312 ++v730b; | 4315 ++v730b; |
4313 ++v105; | 4316 ++v105; |
4314 } | 4317 } |
4315 while ( v730b <= &pParty->pPlayers[3] ); | 4318 while ( v730b <= &pParty->pPlayers[3] ); |
4316 goto LABEL_1056; | 4319 goto LABEL_1056; |
4317 case 52: | 4320 case 52: |
4318 if ( pPlayer->CanCastSpell(uRequiredMana) && a2 != v1 && (a2 & 7) == OBJECT_Actor) | 4321 if ( pPlayer->CanCastSpell(uRequiredMana) && a2 && (a2 & 7) == OBJECT_Actor) |
4319 { | 4322 { |
4320 v730 = a2 >> 3; | 4323 v730 = a2 >> 3; |
4321 v112 = &pActors[a2 >> 3]; | 4324 v112 = &pActors[a2 >> 3]; |
4322 v726 = (Player *)abs(v112->vPosition.z - pParty->vPosition.z); | 4325 v726 = (Player *)abs(v112->vPosition.z - pParty->vPosition.z); |
4323 v721 = abs(v112->vPosition.y - pParty->vPosition.y); | 4326 v721 = abs(v112->vPosition.y - pParty->vPosition.y); |
4409 LODWORD(v733) = v126; | 4412 LODWORD(v733) = v126; |
4410 LABEL_296: | 4413 LABEL_296: |
4411 v127 = v3->spellnum; | 4414 v127 = v3->spellnum; |
4412 if ( v127 == 17 ) | 4415 if ( v127 == 17 ) |
4413 { | 4416 { |
4414 amount = v1; | 4417 amount = 0; |
4415 LODWORD(v725) = 14; | 4418 LODWORD(v725) = 14; |
4416 } | 4419 } |
4417 else | 4420 else |
4418 { | 4421 { |
4419 if ( v127 == 38 ) | 4422 if ( v127 == 38 ) |
4431 } | 4434 } |
4432 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 4435 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
4433 goto LABEL_83; | 4436 goto LABEL_83; |
4434 v128 = v3->spellnum; | 4437 v128 = v3->spellnum; |
4435 v129 = pGame->GetStru6(); | 4438 v129 = pGame->GetStru6(); |
4436 pGame->GetStru6()->SetPlayerBuffAnim(v128, v1); | 4439 pGame->GetStru6()->SetPlayerBuffAnim(v128, 0); |
4437 v83 = 1; | 4440 v83 = 1; |
4438 v130 = v3->spellnum; | 4441 v130 = v3->spellnum; |
4439 v131 = pGame->GetStru6(); | 4442 v131 = pGame->GetStru6(); |
4440 pGame->GetStru6()->SetPlayerBuffAnim(v130, 1u); | 4443 pGame->GetStru6()->SetPlayerBuffAnim(v130, 1); |
4441 v132 = v3->spellnum; | 4444 v132 = v3->spellnum; |
4442 v133 = pGame->GetStru6(); | 4445 v133 = pGame->GetStru6(); |
4443 pGame->GetStru6()->SetPlayerBuffAnim(v132, 2u); | 4446 pGame->GetStru6()->SetPlayerBuffAnim(v132, 2); |
4444 v134 = v3->spellnum; | 4447 v134 = v3->spellnum; |
4445 v135 = pGame->GetStru6(); | 4448 v135 = pGame->GetStru6(); |
4446 pGame->GetStru6()->SetPlayerBuffAnim(v134, 3u); | 4449 pGame->GetStru6()->SetPlayerBuffAnim(v134, 3); |
4447 v726 = (Player *)((int)v733 << 7); | 4450 v726 = (Player *)((int)v733 << 7); |
4448 v90 = (double)(signed int)((int)v733 << 7) * 0.033333335; | 4451 v90 = (double)(signed int)((int)v733 << 7) * 0.033333335; |
4449 LABEL_304: | 4452 LABEL_304: |
4450 v673 = v1; | 4453 v673 = 0; |
4451 v662 = v1; | 4454 v662 = 0; |
4452 v655 = amount; | 4455 v655 = amount; |
4453 v652 = v731; | 4456 v652 = v731; |
4454 v136 = pParty->uTimePlayed + (signed int)(signed __int64)v90; | 4457 v136 = pParty->uTimePlayed + (signed int)(signed __int64)v90; |
4455 v137 = (char *)&pParty->pPartyBuffs[LODWORD(v725)]; | 4458 v137 = (char *)&pParty->pPartyBuffs[LODWORD(v725)]; |
4456 goto LABEL_977; | 4459 goto LABEL_977; |
4463 LODWORD(v733) = v140; | 4466 LODWORD(v733) = v140; |
4464 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 4467 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
4465 goto LABEL_83; | 4468 goto LABEL_83; |
4466 v141 = v3->spellnum; | 4469 v141 = v3->spellnum; |
4467 v142 = pGame->GetStru6(); | 4470 v142 = pGame->GetStru6(); |
4468 pGame->GetStru6()->SetPlayerBuffAnim(v141, v1); | 4471 pGame->GetStru6()->SetPlayerBuffAnim(v141, 0); |
4469 v143 = v3->spellnum; | 4472 v143 = v3->spellnum; |
4470 v144 = pGame->GetStru6(); | 4473 v144 = pGame->GetStru6(); |
4471 pGame->GetStru6()->SetPlayerBuffAnim(v143, 1u); | 4474 pGame->GetStru6()->SetPlayerBuffAnim(v143, 1); |
4472 v145 = v3->spellnum; | 4475 v145 = v3->spellnum; |
4473 v146 = pGame->GetStru6(); | 4476 v146 = pGame->GetStru6(); |
4474 pGame->GetStru6()->SetPlayerBuffAnim(v145, 2u); | 4477 pGame->GetStru6()->SetPlayerBuffAnim(v145, 2); |
4475 v147 = v3->spellnum; | 4478 v147 = v3->spellnum; |
4476 v148 = pGame->GetStru6(); | 4479 v148 = pGame->GetStru6(); |
4477 pGame->GetStru6()->SetPlayerBuffAnim(v147, 3u); | 4480 pGame->GetStru6()->SetPlayerBuffAnim(v147, 3); |
4478 v668 = v1; | 4481 v668 = 0; |
4479 v726 = (Player *)((int)v733 << 7); | 4482 v726 = (Player *)((int)v733 << 7); |
4480 v658 = v1; | 4483 v658 = 0; |
4481 v653 = v2; | 4484 v653 = v2; |
4482 v651 = v731; | 4485 v651 = v731; |
4483 v26 = (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | 4486 v26 = (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); |
4484 v27 = (char *)&pParty->pPartyBuffs[10]; | 4487 v27 = (char *)&pParty->pPartyBuffs[10]; |
4485 goto LABEL_102; | 4488 goto LABEL_102; |
4518 LODWORD(v727) = pParty->vPosition.y + sub_42EBBE(2048, v156); | 4521 LODWORD(v727) = pParty->vPosition.y + sub_42EBBE(2048, v156); |
4519 v154 = pParty->vPosition.z; | 4522 v154 = pParty->vPosition.z; |
4520 } | 4523 } |
4521 HIDWORD(v733) = v154; | 4524 HIDWORD(v733) = v154; |
4522 v713 = v154 + 2500; | 4525 v713 = v154 + 2500; |
4523 v721 = v1; | 4526 v721 = 0; |
4524 LODWORD(v718) = v1; | 4527 LODWORD(v718) = 0; |
4525 if ( (signed int)this > v1 ) | 4528 if ( (signed int)this > 0 ) |
4526 { | 4529 { |
4527 *(float *)&y = (double)SHIDWORD(v733); | 4530 *(float *)&y = (double)SHIDWORD(v733); |
4528 *(float *)&v732 = (double)v713; | 4531 *(float *)&v732 = (double)v713; |
4529 v730 = LODWORD(v725) == 3 ? a2 : 0; | 4532 v730 = LODWORD(v725) == 3 ? a2 : 0; |
4530 v726 = (Player *)this; | 4533 v726 = (Player *)this; |
4539 *((float *)&v733 + 1) = (double)(v157 % 1000) + *(float *)&y - *(float *)&v732; | 4542 *((float *)&v733 + 1) = (double)(v157 % 1000) + *(float *)&y - *(float *)&v732; |
4540 v725 = v159 * v159; | 4543 v725 = v159 * v159; |
4541 *(float *)&_this = v158 * v158; | 4544 *(float *)&_this = v158 * v158; |
4542 if ( sqrt(*((float *)&v733 + 1) * *((float *)&v733 + 1) + *(float *)&_this + v725) <= 1.0 ) | 4545 if ( sqrt(*((float *)&v733 + 1) * *((float *)&v733 + 1) + *(float *)&_this + v725) <= 1.0 ) |
4543 { | 4546 { |
4544 LODWORD(v687) = v1; | 4547 LODWORD(v687) = 0; |
4545 HIDWORD(v687) = v1; | 4548 HIDWORD(v687) = 0; |
4546 } | 4549 } |
4547 else | 4550 else |
4548 { | 4551 { |
4549 x = (signed __int64)sqrt(*(float *)&_this + v725); | 4552 x = (signed __int64)sqrt(*(float *)&_this + v725); |
4550 v687 = __PAIR__( | 4553 v687 = __PAIR__( |
4554 a1.stru_24.Reset(); | 4557 a1.stru_24.Reset(); |
4555 a1.field_48 = v3->spellnum; | 4558 a1.field_48 = v3->spellnum; |
4556 a1.field_4C = v2; | 4559 a1.field_4C = v2; |
4557 a1.field_50 = v731; | 4560 a1.field_50 = v731; |
4558 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | 4561 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); |
4559 a1.uAttributes = v1; | 4562 a1.uAttributes = 0; |
4560 a1.vPosition.x = uRequiredMana; | 4563 a1.vPosition.x = uRequiredMana; |
4561 a1.vPosition.y = LODWORD(v727); | 4564 a1.vPosition.y = LODWORD(v727); |
4562 a1.uSectorID = v1; | 4565 a1.uSectorID = 0; |
4563 a1.vPosition.z = a2 + v713; | 4566 a1.vPosition.z = a2 + v713; |
4564 a1.uSpriteFrameID = v1; | 4567 a1.uSpriteFrameID = 0; |
4565 a1.field_58_pid = 8 * v3->uPlayerID | OBJECT_Player; | 4568 a1.field_58_pid = 8 * v3->uPlayerID | OBJECT_Player; |
4566 a1.field_5C = v730; | 4569 a1.field_5C = v730; |
4567 a1.field_60_distance_related_prolly_lod = stru_50C198._427546(a2 + 2500); | 4570 a1.field_60_distance_related_prolly_lod = stru_50C198._427546(a2 + 2500); |
4568 a1.uFacing = v687; | 4571 a1.uFacing = v687; |
4569 a1.uSoundID = LOWORD(v3->field_10); | 4572 a1.uSoundID = LOWORD(v3->field_10); |
4571 a1.uAttributes = 4; | 4574 a1.uAttributes = 4; |
4572 if ( a1.Create( | 4575 if ( a1.Create( |
4573 v687, | 4576 v687, |
4574 SHIDWORD(v687), | 4577 SHIDWORD(v687), |
4575 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | 4578 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, |
4576 v1) != -1 | 4579 0) != -1 |
4577 && pParty->bTurnBasedModeOn == 1 ) | 4580 && pParty->bTurnBasedModeOn == 1 ) |
4578 ++pTurnEngine->field_1C; | 4581 ++pTurnEngine->field_1C; |
4579 LODWORD(v718) = rand() % 1024 - 512; | 4582 LODWORD(v718) = rand() % 1024 - 512; |
4580 v160 = rand(); | 4583 v160 = rand(); |
4581 v14 = v726 == (Player *)1; | 4584 v14 = v726 == (Player *)1; |
4593 goto LABEL_202; | 4596 goto LABEL_202; |
4594 } | 4597 } |
4595 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 4598 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
4596 goto LABEL_83; | 4599 goto LABEL_83; |
4597 v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096); | 4600 v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096); |
4598 v700.z = v1; | 4601 v700.z = 0; |
4599 v700.y = v1; | 4602 v700.y = 0; |
4600 v700.x = v1; | 4603 v700.x = 0; |
4601 a1.stru_24.Reset(); | 4604 a1.stru_24.Reset(); |
4602 a1.field_48 = v3->spellnum; | 4605 a1.field_48 = v3->spellnum; |
4603 a1.field_4C = v2; | 4606 a1.field_4C = v2; |
4604 a1.field_50 = v731; | 4607 a1.field_50 = v731; |
4605 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | 4608 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); |
4606 a1.uAttributes = v1; | 4609 a1.uAttributes = 0; |
4607 a1.uSectorID = v1; | 4610 a1.uSectorID = 0; |
4608 a1.uSpriteFrameID = v1; | 4611 a1.uSpriteFrameID = 0; |
4609 v161 = v3->uPlayerID; | 4612 v161 = v3->uPlayerID; |
4610 a1.field_60_distance_related_prolly_lod = 0; | 4613 a1.field_60_distance_related_prolly_lod = 0; |
4611 a1.uFacing = v1; | 4614 a1.uFacing = 0; |
4612 v161 *= 8; | 4615 v161 *= 8; |
4613 LOBYTE(v161) = v161 | OBJECT_Player; | 4616 LOBYTE(v161) = v161 | OBJECT_Player; |
4614 a1.field_58_pid = v161; | 4617 a1.field_58_pid = v161; |
4615 a1.uSoundID = LOWORD(v3->field_10); | 4618 a1.uSoundID = LOWORD(v3->field_10); |
4616 a2 = v1; | 4619 a2 = 0; |
4617 if ( (signed int)v726 > v1 ) | 4620 if ( (signed int)v726 > 0 ) |
4618 { | 4621 { |
4619 do | 4622 do |
4620 { | 4623 { |
4621 v162 = dword_50BF30[a2]; | 4624 v162 = dword_50BF30[a2]; |
4622 a1.vPosition.x = pActors[v162].vPosition.x; | 4625 a1.vPosition.x = pActors[v162].vPosition.x; |
4623 a1.vPosition.y = pActors[v162].vPosition.y; | 4626 a1.vPosition.y = pActors[v162].vPosition.y; |
4624 v732 = pActors[v162].uActorHeight; | 4627 v732 = pActors[v162].uActorHeight; |
4625 a1.vPosition.z = pActors[v162].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | 4628 a1.vPosition.z = pActors[v162].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); |
4626 v163 = 8 * dword_50BF30[a2]; | 4629 v163 = 8 * dword_50BF30[a2]; |
4627 LOBYTE(v163) = v163 | 3; | 4630 LOBYTE(v163) = v163 | OBJECT_Actor; |
4628 a1.field_5C = v163; | 4631 a1.field_5C = v163; |
4629 v164 = a1.Create(0, v1, v1, v1); | 4632 v164 = a1.Create(0, 0, 0, 0); |
4630 v165 = a2; | 4633 v165 = a2; |
4631 DamageMonsterFromParty(8 * v164 | AI_OBJECT_LAYING_ITEM, dword_50BF30[a2], &v700); | 4634 DamageMonsterFromParty(8 * v164 | AI_OBJECT_LAYING_ITEM, dword_50BF30[a2], &v700); |
4632 v166 = pGame->GetStru6(); | 4635 v166 = pGame->GetStru6(); |
4633 v166->_4A81CA(&a1); | 4636 v166->_4A81CA(&a1); |
4634 v167 = pGame->GetStru6(); | 4637 v167 = pGame->GetStru6(); |
4643 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 4646 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
4644 goto LABEL_83; | 4647 goto LABEL_83; |
4645 v168 = 0; | 4648 v168 = 0; |
4646 do | 4649 do |
4647 { | 4650 { |
4648 v169 = pOtherOverlayList->_4418B1(2000, v168++ + 100, v1, 65536); | 4651 v169 = pOtherOverlayList->_4418B1(2000, v168++ + 100, 0, 65536); |
4649 v716 = v169; | 4652 v716 = v169; |
4650 } | 4653 } |
4651 while ( v168 < 4 ); | 4654 while ( v168 < 4 ); |
4652 v668 = v1; | 4655 v668 = 0; |
4653 v732 = (int)v733 << 7; | 4656 v732 = (int)v733 << 7; |
4654 v658 = v1; | 4657 v658 = 0; |
4655 v653 = v1; | 4658 v653 = 0; |
4656 v651 = v731; | 4659 v651 = v731; |
4657 v28 = pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | 4660 v28 = pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); |
4658 goto LABEL_992; | 4661 goto LABEL_992; |
4659 case 13: | 4662 case 13: |
4660 v170 = v12 - 1; | 4663 v170 = v12 - 1; |
4678 } | 4681 } |
4679 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 4682 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
4680 goto LABEL_83; | 4683 goto LABEL_83; |
4681 v174 = 0; | 4684 v174 = 0; |
4682 do | 4685 do |
4683 pOtherOverlayList->_4418B1(2010, v174++ + 100, v1, 65536); | 4686 pOtherOverlayList->_4418B1(2010, v174++ + 100, 0, 65536); |
4684 while ( v174 < 4 ); | 4687 while ( v174 < 4 ); |
4685 v175 = v3->spellnum; | 4688 v175 = v3->spellnum; |
4686 v176 = pGame->GetStru6(); | 4689 v176 = pGame->GetStru6(); |
4687 pGame->GetStru6()->SetPlayerBuffAnim(v175, v1); | 4690 pGame->GetStru6()->SetPlayerBuffAnim(v175, 0); |
4688 v83 = 1; | 4691 v83 = 1; |
4689 v177 = v3->spellnum; | 4692 v177 = v3->spellnum; |
4690 v178 = pGame->GetStru6(); | 4693 v178 = pGame->GetStru6(); |
4691 pGame->GetStru6()->SetPlayerBuffAnim(v177, 1u); | 4694 pGame->GetStru6()->SetPlayerBuffAnim(v177, 1); |
4692 v179 = v3->spellnum; | 4695 v179 = v3->spellnum; |
4693 v180 = pGame->GetStru6(); | 4696 v180 = pGame->GetStru6(); |
4694 pGame->GetStru6()->SetPlayerBuffAnim(v179, 2u); | 4697 pGame->GetStru6()->SetPlayerBuffAnim(v179, 2); |
4695 v181 = v3->spellnum; | 4698 v181 = v3->spellnum; |
4696 v182 = pGame->GetStru6(); | 4699 v182 = pGame->GetStru6(); |
4697 pGame->GetStru6()->SetPlayerBuffAnim(v181, 3u); | 4700 pGame->GetStru6()->SetPlayerBuffAnim(v181, 3); |
4698 v673 = v1; | 4701 v673 = 0; |
4699 v732 = (int)v733 << 7; | 4702 v732 = (int)v733 << 7; |
4700 v662 = v1; | 4703 v662 = 0; |
4701 v655 = v1; | 4704 v655 = 0; |
4702 v652 = v731; | 4705 v652 = v731; |
4703 v183 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | 4706 v183 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); |
4704 v137 = (char *)&pParty->pPartyBuffs[5]; | 4707 v137 = (char *)&pParty->pPartyBuffs[5]; |
4705 goto LABEL_976; | 4708 goto LABEL_976; |
4706 case 15: | 4709 case 15: |
4739 a1.field_4C = v2; | 4742 a1.field_4C = v2; |
4740 a1.field_50 = v731; | 4743 a1.field_50 = v731; |
4741 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | 4744 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); |
4742 a1.vPosition.y = pParty->vPosition.y; | 4745 a1.vPosition.y = pParty->vPosition.y; |
4743 a1.vPosition.x = pParty->vPosition.x; | 4746 a1.vPosition.x = pParty->vPosition.x; |
4744 a1.uAttributes = v1; | 4747 a1.uAttributes = 0; |
4745 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | 4748 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
4746 a1.uSectorID = pIndoor->GetSector( | 4749 a1.uSectorID = pIndoor->GetSector( |
4747 pParty->vPosition.x, | 4750 pParty->vPosition.x, |
4748 pParty->vPosition.y, | 4751 pParty->vPosition.y, |
4749 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | 4752 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); |
4750 a1.uSpriteFrameID = v1; | 4753 a1.uSpriteFrameID = 0; |
4751 v187 = 8 * v3->uPlayerID; | 4754 v187 = 8 * v3->uPlayerID; |
4752 LOBYTE(v187) = v187 | OBJECT_Player; | 4755 LOBYTE(v187) = v187 | OBJECT_Player; |
4753 a1.field_58_pid = v187; | 4756 a1.field_58_pid = v187; |
4754 a1.field_5C = a2; | 4757 a1.field_5C = a2; |
4755 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | 4758 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); |
4779 } | 4782 } |
4780 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 4783 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
4781 goto LABEL_83; | 4784 goto LABEL_83; |
4782 v191 = 0; | 4785 v191 = 0; |
4783 do | 4786 do |
4784 pOtherOverlayList->_4418B1(2040, v191++ + 100, v1, 65536); | 4787 pOtherOverlayList->_4418B1(2040, v191++ + 100, 0, 65536); |
4785 while ( v191 < 4 ); | 4788 while ( v191 < 4 ); |
4786 BYTE1(pParty->uFlags) |= 1u; | 4789 BYTE1(pParty->uFlags) |= 1u; |
4787 pParty->uFallSpeed = 1000; | 4790 pParty->uFallSpeed = 1000; |
4788 goto LABEL_1056; | 4791 goto LABEL_1056; |
4789 case 19: | 4792 case 19: |
4823 } | 4826 } |
4824 if ( pPlayer->CanCastSpell(uRequiredMana) ) | 4827 if ( pPlayer->CanCastSpell(uRequiredMana) ) |
4825 { | 4828 { |
4826 v197 = v3->spellnum; | 4829 v197 = v3->spellnum; |
4827 v198 = pGame->GetStru6(); | 4830 v198 = pGame->GetStru6(); |
4828 pGame->GetStru6()->SetPlayerBuffAnim(v197, v1); | 4831 pGame->GetStru6()->SetPlayerBuffAnim(v197, 0); |
4829 v83 = 1; | 4832 v83 = 1; |
4830 v199 = v3->spellnum; | 4833 v199 = v3->spellnum; |
4831 v200 = pGame->GetStru6(); | 4834 v200 = pGame->GetStru6(); |
4832 pGame->GetStru6()->SetPlayerBuffAnim(v199, 1u); | 4835 pGame->GetStru6()->SetPlayerBuffAnim(v199, 1); |
4833 v201 = v3->spellnum; | 4836 v201 = v3->spellnum; |
4834 v202 = pGame->GetStru6(); | 4837 v202 = pGame->GetStru6(); |
4835 pGame->GetStru6()->SetPlayerBuffAnim(v201, 2u); | 4838 pGame->GetStru6()->SetPlayerBuffAnim(v201, 2); |
4836 v203 = v3->spellnum; | 4839 v203 = v3->spellnum; |
4837 v204 = pGame->GetStru6(); | 4840 v204 = pGame->GetStru6(); |
4838 pGame->GetStru6()->SetPlayerBuffAnim(v203, 3u); | 4841 pGame->GetStru6()->SetPlayerBuffAnim(v203, 3); |
4839 v673 = v1; | 4842 v673 = 0; |
4840 v732 = (int)v733 << 7; | 4843 v732 = (int)v733 << 7; |
4841 v662 = v1; | 4844 v662 = 0; |
4842 v655 = amount; | 4845 v655 = amount; |
4843 v652 = v731; | 4846 v652 = v731; |
4844 v183 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | 4847 v183 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); |
4845 v137 = (char *)&pParty->pPartyBuffs[11]; | 4848 v137 = (char *)&pParty->pPartyBuffs[11]; |
4846 LABEL_976: | 4849 LABEL_976: |
4855 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | 4858 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) |
4856 { | 4859 { |
4857 v190 = pGlobalTXT_LocalizationStrings[494]; | 4860 v190 = pGlobalTXT_LocalizationStrings[494]; |
4858 LABEL_462: | 4861 LABEL_462: |
4859 ShowStatusBarString(v190, 2u); | 4862 ShowStatusBarString(v190, 2u); |
4860 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1); | 4863 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
4861 goto LABEL_83; | 4864 goto LABEL_83; |
4862 } | 4865 } |
4863 if ( !pPlayers[v3->uPlayerID + 1]->GetMaxMana() ) | 4866 if ( !pPlayers[v3->uPlayerID + 1]->GetMaxMana() ) |
4864 { | 4867 { |
4865 LABEL_461: | 4868 LABEL_461: |
4866 v190 = pGlobalTXT_LocalizationStrings[428]; | 4869 v190 = pGlobalTXT_LocalizationStrings[428]; |
4867 goto LABEL_462; | 4870 goto LABEL_462; |
4868 } | 4871 } |
4869 LODWORD(v733) = 3600 * v2; | 4872 LODWORD(v733) = 3600 * v2; |
4870 if ( v731 == 2 || v731 == 3 || (amount = v1, v731 != 4) ) | 4873 if ( v731 == 2 || v731 == 3 || (amount = 0, v731 != 4) ) |
4871 amount = 1; | 4874 amount = 1; |
4872 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 4875 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
4873 goto LABEL_83; | 4876 goto LABEL_83; |
4874 v205 = 0; | 4877 v205 = 0; |
4875 do | 4878 do |
4876 pOtherOverlayList->_4418B1(2090, v205++ + 100, v1, 65536); | 4879 pOtherOverlayList->_4418B1(2090, v205++ + 100, 0, 65536); |
4877 while ( v205 < 4 ); | 4880 while ( v205 < 4 ); |
4878 v206 = pOtherOverlayList->_4418B1(10008, 203, v1, 65536); | 4881 v206 = pOtherOverlayList->_4418B1(10008, 203, 0, 65536); |
4879 v207 = v3->uPlayerID + 1; | 4882 v207 = v3->uPlayerID + 1; |
4880 v716 = v206; | 4883 v716 = v206; |
4881 v668 = v207; | 4884 v668 = v207; |
4882 v658 = v206; | 4885 v658 = v206; |
4883 v653 = amount; | 4886 v653 = amount; |
4923 v211 = pParty->vPosition.z; | 4926 v211 = pParty->vPosition.z; |
4924 v713 = pParty->vPosition.y + v214; | 4927 v713 = pParty->vPosition.y + v214; |
4925 v208 = LODWORD(v725); | 4928 v208 = LODWORD(v725); |
4926 } | 4929 } |
4927 v726 = (Player *)v211; | 4930 v726 = (Player *)v211; |
4928 HIDWORD(v733) = v1; | 4931 HIDWORD(v733) = 0; |
4929 *(float *)&v732 = (double)v211; | 4932 *(float *)&v732 = (double)v211; |
4930 LODWORD(v725) = v211 + 2500; | 4933 LODWORD(v725) = v211 + 2500; |
4931 v721 = v1; | 4934 v721 = 0; |
4932 *(float *)&y = (double)(v211 + 2500); | 4935 *(float *)&y = (double)(v211 + 2500); |
4933 v730 = v208 == 3 ? a2 : 0; | 4936 v730 = v208 == 3 ? a2 : 0; |
4934 a2 = 20; | 4937 a2 = 20; |
4935 do | 4938 do |
4936 { | 4939 { |
4943 *((float *)&v733 + 1) = (double)(v215 % 1000) + *(float *)&v732 - *(float *)&y; | 4946 *((float *)&v733 + 1) = (double)(v215 % 1000) + *(float *)&v732 - *(float *)&y; |
4944 *(float *)&v721 = v217 * v217; | 4947 *(float *)&v721 = v217 * v217; |
4945 *(float *)&v726 = v216 * v216; | 4948 *(float *)&v726 = v216 * v216; |
4946 if ( sqrt(*((float *)&v733 + 1) * *((float *)&v733 + 1) + *(float *)&v726 + *(float *)&v721) <= 1.0 ) | 4949 if ( sqrt(*((float *)&v733 + 1) * *((float *)&v733 + 1) + *(float *)&v726 + *(float *)&v721) <= 1.0 ) |
4947 { | 4950 { |
4948 LODWORD(v685) = v1; | 4951 LODWORD(v685) = 0; |
4949 HIDWORD(v685) = v1; | 4952 HIDWORD(v685) = 0; |
4950 } | 4953 } |
4951 else | 4954 else |
4952 { | 4955 { |
4953 v684 = (signed __int64)sqrt(*(float *)&v726 + *(float *)&v721); | 4956 v684 = (signed __int64)sqrt(*(float *)&v726 + *(float *)&v721); |
4954 v685 = __PAIR__( | 4957 v685 = __PAIR__( |
4958 a1.stru_24.Reset(); | 4961 a1.stru_24.Reset(); |
4959 a1.field_48 = v3->spellnum; | 4962 a1.field_48 = v3->spellnum; |
4960 a1.field_4C = v2; | 4963 a1.field_4C = v2; |
4961 a1.field_50 = v731; | 4964 a1.field_50 = v731; |
4962 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | 4965 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); |
4963 a1.uAttributes = v1; | 4966 a1.uAttributes = 0; |
4964 a1.vPosition.x = LODWORD(v718); | 4967 a1.vPosition.x = LODWORD(v718); |
4965 a1.vPosition.y = v713; | 4968 a1.vPosition.y = v713; |
4966 a1.uSectorID = v1; | 4969 a1.uSectorID = 0; |
4967 a1.vPosition.z = (int)((char *)_this + LODWORD(v725)); | 4970 a1.vPosition.z = (int)((char *)_this + LODWORD(v725)); |
4968 a1.uSpriteFrameID = v1; | 4971 a1.uSpriteFrameID = 0; |
4969 a1.field_58_pid = 8 * v3->uPlayerID | OBJECT_Player; | 4972 a1.field_58_pid = 8 * v3->uPlayerID | OBJECT_Player; |
4970 a1.field_5C = v730; | 4973 a1.field_5C = v730; |
4971 a1.field_60_distance_related_prolly_lod = stru_50C198._427546((int)&_this[69].uNumCharges); | 4974 a1.field_60_distance_related_prolly_lod = stru_50C198._427546((int)&_this[69].uNumCharges); |
4972 a1.uFacing = v685; | 4975 a1.uFacing = v685; |
4973 a1.uSoundID = LOWORD(v3->field_10); | 4976 a1.uSoundID = LOWORD(v3->field_10); |
4975 a1.uAttributes = 4; | 4978 a1.uAttributes = 4; |
4976 if ( a1.Create( | 4979 if ( a1.Create( |
4977 v685, | 4980 v685, |
4978 SHIDWORD(v685), | 4981 SHIDWORD(v685), |
4979 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | 4982 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, |
4980 v1) != -1 | 4983 0) != -1 |
4981 && pParty->bTurnBasedModeOn == 1 ) | 4984 && pParty->bTurnBasedModeOn == 1 ) |
4982 ++pTurnEngine->field_1C; | 4985 ++pTurnEngine->field_1C; |
4983 v721 = rand() % 1024 - 512; | 4986 v721 = rand() % 1024 - 512; |
4984 v218 = rand(); | 4987 v218 = rand(); |
4985 v14 = a2-- == 1; | 4988 v14 = a2-- == 1; |
4994 v220 = v219 - 1; | 4997 v220 = v219 - 1; |
4995 if ( v220 ) | 4998 if ( v220 ) |
4996 { | 4999 { |
4997 if ( v220 == 1 ) | 5000 if ( v220 == 1 ) |
4998 { | 5001 { |
4999 amount = v1; | 5002 amount = 0; |
5000 goto LABEL_433; | 5003 goto LABEL_433; |
5001 } | 5004 } |
5002 v221 = 180 * v2; | 5005 v221 = 180 * v2; |
5003 } | 5006 } |
5004 else | 5007 else |
5052 a1.vPosition.y = pParty->vPosition.y; | 5055 a1.vPosition.y = pParty->vPosition.y; |
5053 v51 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | 5056 v51 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
5054 v671 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | 5057 v671 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
5055 v660 = pParty->vPosition.y; | 5058 v660 = pParty->vPosition.y; |
5056 LABEL_153: | 5059 LABEL_153: |
5057 a1.uAttributes = v1; | 5060 a1.uAttributes = 0; |
5058 a1.vPosition.x = pParty->vPosition.x; | 5061 a1.vPosition.x = pParty->vPosition.x; |
5059 a1.vPosition.z = v51; | 5062 a1.vPosition.z = v51; |
5060 v52 = pIndoor->GetSector(pParty->vPosition.x, v660, v671); | 5063 v52 = pIndoor->GetSector(pParty->vPosition.x, v660, v671); |
5061 a1.uSpriteFrameID = v1; | 5064 a1.uSpriteFrameID = 0; |
5062 a1.uSectorID = v52; | 5065 a1.uSectorID = v52; |
5063 v53 = 8 * v3->uPlayerID; | 5066 v53 = 8 * v3->uPlayerID; |
5064 LOBYTE(v53) = v53 | OBJECT_Player; | 5067 LOBYTE(v53) = v53 | OBJECT_Player; |
5065 a1.field_58_pid = v53; | 5068 a1.field_58_pid = v53; |
5066 a1.field_5C = a2; | 5069 a1.field_5C = a2; |
5087 a1.field_4C = v2; | 5090 a1.field_4C = v2; |
5088 a1.field_50 = v731; | 5091 a1.field_50 = v731; |
5089 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | 5092 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); |
5090 a1.vPosition.y = pParty->vPosition.y; | 5093 a1.vPosition.y = pParty->vPosition.y; |
5091 a1.vPosition.x = pParty->vPosition.x; | 5094 a1.vPosition.x = pParty->vPosition.x; |
5092 a1.uAttributes = v1; | 5095 a1.uAttributes = 0; |
5093 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | 5096 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
5094 a1.uSectorID = pIndoor->GetSector( | 5097 a1.uSectorID = pIndoor->GetSector( |
5095 pParty->vPosition.x, | 5098 pParty->vPosition.x, |
5096 pParty->vPosition.y, | 5099 pParty->vPosition.y, |
5097 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | 5100 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); |
5098 a1.uSpriteFrameID = v1; | 5101 a1.uSpriteFrameID = 0; |
5099 v226 = 8 * v3->uPlayerID; | 5102 v226 = 8 * v3->uPlayerID; |
5100 LOBYTE(v226) = v226 | OBJECT_Player; | 5103 LOBYTE(v226) = v226 | OBJECT_Player; |
5101 a1.field_58_pid = v226; | 5104 a1.field_58_pid = v226; |
5102 a1.field_5C = a2; | 5105 a1.field_5C = a2; |
5103 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | 5106 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); |
5133 else | 5136 else |
5134 v229 = 3600 * v2; | 5137 v229 = 3600 * v2; |
5135 LODWORD(v733) = v229; | 5138 LODWORD(v733) = v229; |
5136 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 5139 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
5137 goto LABEL_83; | 5140 goto LABEL_83; |
5138 v716 = pOtherOverlayList->_4418B1(10005, 201, v1, 65536); | 5141 v716 = pOtherOverlayList->_4418B1(10005, 201, 0, 65536); |
5139 v230 = v3->spellnum; | 5142 v230 = v3->spellnum; |
5140 v231 = pGame->GetStru6(); | 5143 v231 = pGame->GetStru6(); |
5141 pGame->GetStru6()->SetPlayerBuffAnim(v230, v1); | 5144 pGame->GetStru6()->SetPlayerBuffAnim(v230, 0); |
5142 v232 = 1; | 5145 v232 = 1; |
5143 v233 = v3->spellnum; | 5146 v233 = v3->spellnum; |
5144 v234 = pGame->GetStru6(); | 5147 v234 = pGame->GetStru6(); |
5145 pGame->GetStru6()->SetPlayerBuffAnim(v233, 1u); | 5148 pGame->GetStru6()->SetPlayerBuffAnim(v233, 1); |
5146 v235 = v3->spellnum; | 5149 v235 = v3->spellnum; |
5147 v236 = pGame->GetStru6(); | 5150 v236 = pGame->GetStru6(); |
5148 pGame->GetStru6()->SetPlayerBuffAnim(v235, 2u); | 5151 pGame->GetStru6()->SetPlayerBuffAnim(v235, 2); |
5149 v237 = v3->spellnum; | 5152 v237 = v3->spellnum; |
5150 v238 = pGame->GetStru6(); | 5153 v238 = pGame->GetStru6(); |
5151 pGame->GetStru6()->SetPlayerBuffAnim(v237, 3u); | 5154 pGame->GetStru6()->SetPlayerBuffAnim(v237, 3); |
5152 v239 = v3->uPlayerID + 1; | 5155 v239 = v3->uPlayerID + 1; |
5153 v732 = v229 << 7; | 5156 v732 = v229 << 7; |
5154 pParty->pPartyBuffs[18].Apply( | 5157 pParty->pPartyBuffs[18].Apply( |
5155 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v229 << 7) * 0.033333335), | 5158 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v229 << 7) * 0.033333335), |
5156 v731, | 5159 v731, |
5194 v732 = (unsigned __int8)v240[25]; | 5197 v732 = (unsigned __int8)v240[25]; |
5195 v242 = (signed __int64)((double)v732 * v241); | 5198 v242 = (signed __int64)((double)v732 * v241); |
5196 v243 = y; | 5199 v243 = y; |
5197 y[25] = v242; | 5200 y[25] = v242; |
5198 *((int *)v243 + 4) = (unsigned __int8)v242; | 5201 *((int *)v243 + 4) = (unsigned __int8)v242; |
5199 if ( (unsigned __int8)v242 <= v1 ) | 5202 if ( (unsigned __int8)v242 <= 0 ) |
5200 { | 5203 { |
5201 *(int *)v243 = v1; | 5204 *(int *)v243 = 0; |
5202 dword_50C9D0 = 113; | 5205 dword_50C9D0 = 113; |
5203 dword_50C9D4 = v1; | 5206 dword_50C9D4 = 0; |
5204 dword_50C9D8 = 1; | 5207 dword_50C9D8 = 1; |
5205 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); | 5208 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); |
5206 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1); | 5209 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
5207 v3->spellnum = v1; | 5210 v3->spellnum = 0; |
5208 goto LABEL_1165; | 5211 goto LABEL_1165; |
5209 } | 5212 } |
5210 *((int *)v243 + 5) |= 0x40u; | 5213 *((int *)v243 + 5) |= 0x40u; |
5211 goto LABEL_1055; | 5214 goto LABEL_1055; |
5212 case 30: | 5215 case 30: |
5213 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 5216 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
5214 goto LABEL_83; | 5217 goto LABEL_83; |
5215 uRequiredMana = v1; | 5218 uRequiredMana = 0; |
5216 HIDWORD(v733) = 10 * v2; | 5219 HIDWORD(v733) = 10 * v2; |
5217 v730 = 1; | 5220 v730 = 1; |
5218 v244 = (char *)&pParty->pPlayers[v3->uPlayerID_2]; | 5221 v244 = (char *)&pParty->pPlayers[v3->uPlayerID_2]; |
5219 v726 = &pParty->pPlayers[v3->uPlayerID_2]; | 5222 v726 = &pParty->pPlayers[v3->uPlayerID_2]; |
5220 if ( v731 == 1 ) | 5223 if ( v731 == 1 ) |
5225 v14 = *(int *)v245 == 134; | 5228 v14 = *(int *)v245 == 134; |
5226 v310 = *(int *)v245 - 134 < 0; | 5229 v310 = *(int *)v245 - 134 < 0; |
5227 LODWORD(v725) = (int)(char *)&pItemsTable + 48 * *(int *)v245 + 4; | 5230 LODWORD(v725) = (int)(char *)&pItemsTable + 48 * *(int *)v245 + 4; |
5228 if ( (unsigned __int8)(v310 ^ v311) | v14 ) | 5231 if ( (unsigned __int8)(v310 ^ v311) | v14 ) |
5229 { | 5232 { |
5230 if ( *(int *)&v244[36 * a2 + 544] == v1 ) | 5233 if ( *(int *)&v244[36 * a2 + 544] == 0 ) |
5231 { | 5234 { |
5232 if ( *(int *)&v244[36 * a2 + 536] == v1 ) | 5235 if ( *(int *)&v244[36 * a2 + 536] == 0 ) |
5233 { | 5236 { |
5234 if ( *(int *)&v244[36 * a2 + 540] == v1 ) | 5237 if ( *(int *)&v244[36 * a2 + 540] == 0 ) |
5235 { | 5238 { |
5236 v312 = v309[28]; | 5239 v312 = v309[28]; |
5237 if ( v312 ) | 5240 if ( v312 ) |
5238 { | 5241 { |
5239 if ( v312 != 1 ) | 5242 if ( v312 != 1 ) |
5244 if ( !(v244[36 * a2 + 552] & 2) ) | 5247 if ( !(v244[36 * a2 + 552] & 2) ) |
5245 { | 5248 { |
5246 if ( ((ItemGen *)v245)->GetValue() < 0x1C2 ) | 5249 if ( ((ItemGen *)v245)->GetValue() < 0x1C2 ) |
5247 { | 5250 { |
5248 uRequiredMana = 1; | 5251 uRequiredMana = 1; |
5249 v730 = v1; | 5252 v730 = 0; |
5250 } | 5253 } |
5251 if ( rand() % 100 >= SHIDWORD(v733) ) | 5254 if ( rand() % 100 >= SHIDWORD(v733) ) |
5252 uRequiredMana = 1; | 5255 uRequiredMana = 1; |
5253 if ( uRequiredMana == v1 ) | 5256 if (!uRequiredMana) |
5254 { | 5257 { |
5255 v313 = *(char *)(LODWORD(v725) + 28); | 5258 v313 = *(char *)(LODWORD(v725) + 28); |
5256 if ( v313 == 3 | v313 == 4 | v313 == 5 | v313 == 6 | v313 == 7 | v313 == 8 | v313 == 9 | v313 == 10 | v313 == 11 ) | 5259 if ( v313 == 3 | v313 == 4 | v313 == 5 | v313 == 6 | v313 == 7 | v313 == 8 | v313 == 9 | v313 == 10 | v313 == 11 ) |
5257 { | 5260 { |
5258 v314 = rand() % 10;//pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType]; | 5261 v314 = rand() % 10;//pItemsTable->field_116D8[pItemsTable->pItems[*(int *)v245].uEquipType]; |
5292 } | 5295 } |
5293 } | 5296 } |
5294 } | 5297 } |
5295 } | 5298 } |
5296 LABEL_616: | 5299 LABEL_616: |
5297 if ( LODWORD(v727) == v1 ) | 5300 if ( LODWORD(v727) == 0 ) |
5298 { | 5301 { |
5299 v317 = pGlobalTXT_LocalizationStrings[428]; | 5302 v317 = pGlobalTXT_LocalizationStrings[428]; |
5300 if ( v730 == v1 ) | 5303 if ( v730 == 0 ) |
5301 v317 = pGlobalTXT_LocalizationStrings[585]; | 5304 v317 = pGlobalTXT_LocalizationStrings[585]; |
5302 ShowStatusBarString(v317, 2u); | 5305 ShowStatusBarString(v317, 2u); |
5303 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1); | 5306 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
5304 v318 = v726; | 5307 v318 = v726; |
5305 v3->spellnum = v1; | 5308 v3->spellnum = 0; |
5306 v318->PlaySound(SPEECH_43, v1); | 5309 v318->PlaySound(SPEECH_43, 0); |
5307 } | 5310 } |
5308 goto LABEL_83; | 5311 goto LABEL_83; |
5309 } | 5312 } |
5310 if ( v731 != 2 ) | 5313 if ( v731 != 2 ) |
5311 { | 5314 { |
5312 if ( v731 == 3 ) | 5315 if ( v731 == 3 ) |
5313 { | 5316 { |
5314 v245 = (int)&v244[36 * a2 + 532]; | 5317 v245 = (int)&v244[36 * a2 + 532]; |
5315 v269 = *(int *)v245; | 5318 v269 = *(int *)v245; |
5316 if ( *(int *)v245 > 134 | 5319 if ( *(int *)v245 > 134 |
5317 || *(int *)(v245 + 12) != v1 | 5320 || *(int *)(v245 + 12) != 0 |
5318 || *(int *)(v245 + 4) != v1 | 5321 || *(int *)(v245 + 4) != 0 |
5319 || *(int *)(v245 + 8) != v1 | 5322 || *(int *)(v245 + 8) != 0 |
5320 || (_this = (ItemGen *)(v245 + 20), *(char *)(v245 + 20) & 2) ) | 5323 || (_this = (ItemGen *)(v245 + 20), *(char *)(v245 + 20) & 2) ) |
5321 goto LABEL_616; | 5324 goto LABEL_616; |
5322 v270 = (char *)&pItemsTable->pItems[v269].pIconName; | 5325 v270 = (char *)&pItemsTable->pItems[v269].pIconName; |
5323 LODWORD(v725) = (int)v270; | 5326 LODWORD(v725) = (int)v270; |
5324 v271 = v270[28]; | 5327 v271 = v270[28]; |
5327 else | 5330 else |
5328 v272 = ((ItemGen *)v245)->GetValue() < 0xFA; | 5331 v272 = ((ItemGen *)v245)->GetValue() < 0xFA; |
5329 if ( v272 ) | 5332 if ( v272 ) |
5330 { | 5333 { |
5331 uRequiredMana = 1; | 5334 uRequiredMana = 1; |
5332 v730 = v1; | 5335 v730 = 0; |
5333 } | 5336 } |
5334 if ( rand() % 100 >= SHIDWORD(v733) ) | 5337 if ( rand() % 100 >= SHIDWORD(v733) ) |
5335 uRequiredMana = 1; | 5338 uRequiredMana = 1; |
5336 if ( uRequiredMana != v1 ) | 5339 if (uRequiredMana) |
5337 goto LABEL_613; | 5340 goto LABEL_613; |
5338 v273 = v725; | 5341 v273 = v725; |
5339 v274 = *(char *)(LODWORD(v725) + 28); | 5342 v274 = *(char *)(LODWORD(v725) + 28); |
5340 if ( v274 == 0 | v274 == 1 | v274 == 2 | v274 == 3 | v274 == 4 | v274 == 5 | v274 == 6 | v274 == 7 | v274 == 8 | v274 == 9 | v274 == 10 | v274 == 11 ) | 5343 if ( v274 == 0 | v274 == 1 | v274 == 2 | v274 == 3 | v274 == 4 | v274 == 5 | v274 == 6 | v274 == 7 | v274 == 8 | v274 == 9 | v274 == 10 | v274 == 11 ) |
5341 { | 5344 { |
5410 } | 5413 } |
5411 else | 5414 else |
5412 { | 5415 { |
5413 if ( v731 != 4 | 5416 if ( v731 != 4 |
5414 || (v245 = (int)&v726->pInventoryItems[a2], v246 = *(int *)v245, *(int *)v245 > 134) | 5417 || (v245 = (int)&v726->pInventoryItems[a2], v246 = *(int *)v245, *(int *)v245 > 134) |
5415 || v726->pInventoryItems[a2].uSpecEnchantmentType != v1 | 5418 || v726->pInventoryItems[a2].uSpecEnchantmentType != 0 |
5416 || v726->pInventoryItems[a2].uEncantmentType != v1 | 5419 || v726->pInventoryItems[a2].uEncantmentType != 0 |
5417 || v726->pInventoryItems[a2]._bonus_strength != v1 | 5420 || v726->pInventoryItems[a2]._bonus_strength != 0 |
5418 || (_this = (ItemGen *)((char *)&v726->pInventoryItems[a2] + 20), v726->pInventoryItems[a2].Broken()) ) | 5421 || (_this = (ItemGen *)((char *)&v726->pInventoryItems[a2] + 20), v726->pInventoryItems[a2].Broken()) ) |
5419 goto LABEL_616; | 5422 goto LABEL_616; |
5420 v247 = (char *)&pItemsTable->pItems[v246].pIconName; | 5423 v247 = (char *)&pItemsTable->pItems[v246].pIconName; |
5421 LODWORD(v725) = (int)v247; | 5424 LODWORD(v725) = (int)v247; |
5422 v248 = v247[28]; | 5425 v248 = v247[28]; |
5425 else | 5428 else |
5426 v249 = v726->pInventoryItems[a2].GetValue() < 0xFA; | 5429 v249 = v726->pInventoryItems[a2].GetValue() < 0xFA; |
5427 if ( v249 ) | 5430 if ( v249 ) |
5428 { | 5431 { |
5429 uRequiredMana = 1; | 5432 uRequiredMana = 1; |
5430 v730 = v1; | 5433 v730 = 0; |
5431 } | 5434 } |
5432 if ( rand() % 100 >= SHIDWORD(v733) ) | 5435 if ( rand() % 100 >= SHIDWORD(v733) ) |
5433 uRequiredMana = 1; | 5436 uRequiredMana = 1; |
5434 if ( uRequiredMana != v1 ) | 5437 if (uRequiredMana) |
5435 goto LABEL_613; | 5438 goto LABEL_613; |
5436 v250 = v725; | 5439 v250 = v725; |
5437 v251 = *(char *)(LODWORD(v725) + 28); | 5440 v251 = *(char *)(LODWORD(v725) + 28); |
5438 if ( v251 == 0 | v251 == 1 | v251 == 2 | v251 == 3 | v251 == 4 | v251 == 5 | v251 == 6 | v251 == 7 | v251 == 8 | v251 == 9 | v251 == 10 | v251 == 11 ) | 5441 if ( v251 == 0 | v251 == 1 | v251 == 2 | v251 == 3 | v251 == 4 | v251 == 5 | v251 == 6 | v251 == 7 | v251 == 8 | v251 == 9 | v251 == 10 | v251 == 11 ) |
5439 { | 5442 { |
5507 ++*(int *)(v245 + 12); | 5510 ++*(int *)(v245 + 12); |
5508 goto LABEL_612; | 5511 goto LABEL_612; |
5509 } | 5512 } |
5510 } | 5513 } |
5511 LABEL_615: | 5514 LABEL_615: |
5512 v1 = 0; | 5515 //v1 = 0; |
5513 goto LABEL_616; | 5516 goto LABEL_616; |
5514 } | 5517 } |
5515 v289 = (ItemGen *)&v244[36 * a2 + 532]; | 5518 v289 = (ItemGen *)&v244[36 * a2 + 532]; |
5516 _this = v289; | 5519 _this = v289; |
5517 v290 = v289->uItemID; | 5520 v290 = v289->uItemID; |
5518 LODWORD(v725) = (int)(char *)&pItemsTable + 48 * v290 + 4; | 5521 LODWORD(v725) = (int)(char *)&pItemsTable + 48 * v290 + 4; |
5519 if ( v290 > 134 | 5522 if ( v290 > 134 |
5520 || _this->uSpecEnchantmentType != v1 | 5523 || _this->uSpecEnchantmentType != 0 |
5521 || _this->uEncantmentType != v1 | 5524 || _this->uEncantmentType != 0 |
5522 || _this->_bonus_strength != v1 | 5525 || _this->_bonus_strength != 0 |
5523 || (v291 = pItemsTable->pItems[v290].uEquipType) == 0 | 5526 || (v291 = pItemsTable->pItems[v290].uEquipType) == 0 |
5524 || v291 == 1 | 5527 || v291 == 1 |
5525 || v291 == 2 | 5528 || v291 == 2 |
5526 || _this->Broken()) | 5529 || _this->Broken()) |
5527 goto LABEL_616; | 5530 goto LABEL_616; |
5528 if ( _this->GetValue() < 0x1C2 ) | 5531 if ( _this->GetValue() < 0x1C2 ) |
5529 uRequiredMana = 1; | 5532 uRequiredMana = 1; |
5530 if ( rand() % 100 >= SHIDWORD(v733) ) | 5533 if ( rand() % 100 >= SHIDWORD(v733) ) |
5531 uRequiredMana = 1; | 5534 uRequiredMana = 1; |
5532 if ( uRequiredMana != v1 ) | 5535 if ( uRequiredMana != 0 ) |
5533 goto LABEL_199; | 5536 goto LABEL_199; |
5534 v292 = *(char *)(LODWORD(v725) + 28); | 5537 v292 = *(char *)(LODWORD(v725) + 28); |
5535 if ( !(v292 == 3 | v292 == 4 | v292 == 5 | v292 == 6 | v292 == 7 | v292 == 8 | v292 == 9 | v292 == 10 | v292 == 11) ) | 5538 if ( !(v292 == 3 | v292 == 4 | v292 == 5 | v292 == 6 | v292 == 7 | v292 == 8 | v292 == 9 | v292 == 10 | v292 == 11) ) |
5536 { | 5539 { |
5537 v2 = v723; | 5540 v2 = v723; |
5538 v1 = 0; | 5541 //v1 = 0; |
5539 goto LABEL_199; | 5542 goto LABEL_199; |
5540 } | 5543 } |
5541 if ( rand() % 100 >= 80 ) | 5544 if ( rand() % 100 >= 80 ) |
5542 { | 5545 { |
5543 v297 = pItemsTable->pSpecialEnchantments_count; | 5546 v297 = pItemsTable->pSpecialEnchantments_count; |
5613 if ( pPlayer->sMana < (signed int)uRequiredMana ) | 5616 if ( pPlayer->sMana < (signed int)uRequiredMana ) |
5614 goto LABEL_83; | 5617 goto LABEL_83; |
5615 if ( pParty->uFlags & 0x30 && v12 != 4 || rand() % 100 >= amount && v731 != 4 ) | 5618 if ( pParty->uFlags & 0x30 && v12 != 4 || rand() % 100 >= amount && v731 != 4 ) |
5616 goto LABEL_200; | 5619 goto LABEL_200; |
5617 byte_50C0C0 = LOBYTE(v3->uPlayerID); | 5620 byte_50C0C0 = LOBYTE(v3->uPlayerID); |
5618 pMessageQueue_50CBD0->AddMessage(UIMSG_C3, v1, v1); | 5621 pMessageQueue_50CBD0->AddMessage(UIMSG_C3, 0, 0); |
5619 goto LABEL_1056; | 5622 goto LABEL_1056; |
5620 case 33: | 5623 case 33: |
5621 LODWORD(v733) = 604800 * v2; | 5624 LODWORD(v733) = 604800 * v2; |
5622 if ( !_strcmpi(pCurrentMapName, "d05.blv") ) | 5625 if ( !_strcmpi(pCurrentMapName, "d05.blv") ) |
5623 goto LABEL_200; | 5626 goto LABEL_200; |
5624 v319 = uRequiredMana; | 5627 v319 = uRequiredMana; |
5625 if ( pPlayer->sMana >= (signed int)uRequiredMana ) | 5628 if ( pPlayer->sMana >= (signed int)uRequiredMana ) |
5626 { | 5629 { |
5627 pEventTimer->Pause(); | 5630 pEventTimer->Pause(); |
5628 pMessageQueue_50CBD0->AddMessage(UIMSG_B1, v1, v1); | 5631 pMessageQueue_50CBD0->AddMessage(UIMSG_B1, 0, 0); |
5629 qword_506350 = (signed int)v733; | 5632 qword_506350 = (signed int)v733; |
5630 _506348_current_lloyd_playerid = v3->uPlayerID; | 5633 _506348_current_lloyd_playerid = v3->uPlayerID; |
5631 ::uRequiredMana = v319; | 5634 ::uRequiredMana = v319; |
5632 ::sRecoveryTime = sRecoveryTime; | 5635 ::sRecoveryTime = sRecoveryTime; |
5633 dword_50633C = v3->field_10; | 5636 dword_50633C = v3->field_10; |
5673 a1.field_4C = v2; | 5676 a1.field_4C = v2; |
5674 a1.field_50 = v731; | 5677 a1.field_50 = v731; |
5675 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | 5678 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); |
5676 a1.vPosition.y = pParty->vPosition.y; | 5679 a1.vPosition.y = pParty->vPosition.y; |
5677 a1.vPosition.x = pParty->vPosition.x; | 5680 a1.vPosition.x = pParty->vPosition.x; |
5678 a1.uAttributes = v1; | 5681 a1.uAttributes = 0; |
5679 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | 5682 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
5680 a1.uSectorID = pIndoor->GetSector( | 5683 a1.uSectorID = pIndoor->GetSector( |
5681 pParty->vPosition.x, | 5684 pParty->vPosition.x, |
5682 pParty->vPosition.y, | 5685 pParty->vPosition.y, |
5683 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | 5686 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); |
5684 a1.uSpriteFrameID = v1; | 5687 a1.uSpriteFrameID = 0; |
5685 v326 = 8 * v3->uPlayerID; | 5688 v326 = 8 * v3->uPlayerID; |
5686 LOBYTE(v326) = v326 | OBJECT_Player; | 5689 LOBYTE(v326) = v326 | OBJECT_Player; |
5687 a1.field_58_pid = v326; | 5690 a1.field_58_pid = v326; |
5688 a1.field_5C = a2; | 5691 a1.field_5C = a2; |
5689 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | 5692 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); |
5706 a1.field_4C = v2; | 5709 a1.field_4C = v2; |
5707 a1.field_50 = v731; | 5710 a1.field_50 = v731; |
5708 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | 5711 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); |
5709 a1.vPosition.x = pParty->vPosition.x; | 5712 a1.vPosition.x = pParty->vPosition.x; |
5710 a1.vPosition.y = pParty->vPosition.y; | 5713 a1.vPosition.y = pParty->vPosition.y; |
5711 a1.uAttributes = v1; | 5714 a1.uAttributes = 0; |
5712 a1.uSectorID = v1; | 5715 a1.uSectorID = 0; |
5713 a1.uSpriteFrameID = v1; | 5716 a1.uSpriteFrameID = 0; |
5714 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; | 5717 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; |
5715 v327 = 8 * v3->uPlayerID; | 5718 v327 = 8 * v3->uPlayerID; |
5716 LOBYTE(v327) = v327 | OBJECT_Player; | 5719 LOBYTE(v327) = v327 | OBJECT_Player; |
5717 a1.field_60_distance_related_prolly_lod = 0; | 5720 a1.field_60_distance_related_prolly_lod = 0; |
5718 a1.field_58_pid = v327; | 5721 a1.field_58_pid = v327; |
5719 a1.field_5C = a2; | 5722 a1.field_5C = a2; |
5720 a1.uFacing = LOWORD(pParty->sRotationY); | 5723 a1.uFacing = LOWORD(pParty->sRotationY); |
5721 a1.uSoundID = LOWORD(v3->field_10); | 5724 a1.uSoundID = LOWORD(v3->field_10); |
5722 if ( pParty->bTurnBasedModeOn == 1 ) | 5725 if ( pParty->bTurnBasedModeOn == 1 ) |
5723 a1.uAttributes = 4; | 5726 a1.uAttributes = 4; |
5724 v669 = v1; | 5727 v669 = 0; |
5725 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | 5728 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; |
5726 v35 = (signed int)stru_5C6E00->uIntegerHalfPi / 2; | 5729 v35 = (signed int)stru_5C6E00->uIntegerHalfPi / 2; |
5727 LABEL_124: | 5730 LABEL_124: |
5728 v654 = v35; | 5731 v654 = v35; |
5729 LABEL_125: | 5732 LABEL_125: |
5746 LODWORD(v733) = v330; | 5749 LODWORD(v733) = v330; |
5747 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 5750 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
5748 goto LABEL_83; | 5751 goto LABEL_83; |
5749 v331 = v3->spellnum; | 5752 v331 = v3->spellnum; |
5750 v332 = pGame->GetStru6(); | 5753 v332 = pGame->GetStru6(); |
5751 pGame->GetStru6()->SetPlayerBuffAnim(v331, v1); | 5754 pGame->GetStru6()->SetPlayerBuffAnim(v331, 0); |
5752 v83 = 1; | 5755 v83 = 1; |
5753 v333 = v3->spellnum; | 5756 v333 = v3->spellnum; |
5754 v334 = pGame->GetStru6(); | 5757 v334 = pGame->GetStru6(); |
5755 pGame->GetStru6()->SetPlayerBuffAnim(v333, 1u); | 5758 pGame->GetStru6()->SetPlayerBuffAnim(v333, 1); |
5756 v335 = v3->spellnum; | 5759 v335 = v3->spellnum; |
5757 v336 = pGame->GetStru6(); | 5760 v336 = pGame->GetStru6(); |
5758 pGame->GetStru6()->SetPlayerBuffAnim(v335, 2u); | 5761 pGame->GetStru6()->SetPlayerBuffAnim(v335, 2); |
5759 v337 = v3->spellnum; | 5762 v337 = v3->spellnum; |
5760 v338 = pGame->GetStru6(); | 5763 v338 = pGame->GetStru6(); |
5761 pGame->GetStru6()->SetPlayerBuffAnim(v337, 3u); | 5764 pGame->GetStru6()->SetPlayerBuffAnim(v337, 3); |
5762 v673 = v1; | 5765 v673 = 0; |
5763 v732 = (int)v733 << 7; | 5766 v732 = (int)v733 << 7; |
5764 v662 = v1; | 5767 v662 = 0; |
5765 v655 = v1; | 5768 v655 = 0; |
5766 v652 = v731; | 5769 v652 = v731; |
5767 v183 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | 5770 v183 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); |
5768 v137 = (char *)&pParty->pPartyBuffs[3]; | 5771 v137 = (char *)&pParty->pPartyBuffs[3]; |
5769 goto LABEL_976; | 5772 goto LABEL_976; |
5770 case 47: | 5773 case 47: |
5794 amount = v341; | 5797 amount = v341; |
5795 LABEL_667: | 5798 LABEL_667: |
5796 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 5799 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
5797 goto LABEL_83; | 5800 goto LABEL_83; |
5798 v342 = *(int *)&v3->field_C; | 5801 v342 = *(int *)&v3->field_C; |
5799 if ( v342 == v1 ) | 5802 if ( v342 == 0 ) |
5800 { | 5803 { |
5801 v345 = v3->uPlayerID_2; | 5804 v345 = v3->uPlayerID_2; |
5802 v346 = v3->spellnum; | 5805 v346 = v3->spellnum; |
5803 v347 = pGame->GetStru6(); | 5806 v347 = pGame->GetStru6(); |
5804 pGame->GetStru6()->SetPlayerBuffAnim(v346, v345); | 5807 pGame->GetStru6()->SetPlayerBuffAnim(v346, v345); |
5805 v668 = v1; | 5808 v668 = 0; |
5806 v658 = v1; | 5809 v658 = 0; |
5807 v653 = amount; | 5810 v653 = amount; |
5808 LODWORD(v28) = LODWORD(pParty->uTimePlayed) + 1280; | 5811 LODWORD(v28) = LODWORD(pParty->uTimePlayed) + 1280; |
5809 v651 = v731; | 5812 v651 = v731; |
5810 HIDWORD(v650) = v1 + ((pParty->uTimePlayed + 1280) >> 32); | 5813 HIDWORD(v650) = 0 + ((pParty->uTimePlayed + 1280) >> 32); |
5811 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[4]; | 5814 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[4]; |
5812 goto LABEL_104; | 5815 goto LABEL_104; |
5813 } | 5816 } |
5814 if ( (v342 & 7) == OBJECT_Actor) | 5817 if ( (v342 & 7) == OBJECT_Actor) |
5815 { | 5818 { |
5816 v343 = v342 >> 3; | 5819 v343 = v342 >> 3; |
5817 HIDWORD(v344) = v1 + ((pParty->uTimePlayed + 1280) >> 32); | 5820 HIDWORD(v344) = 0 + ((pParty->uTimePlayed + 1280) >> 32); |
5818 LODWORD(v344) = LODWORD(pParty->uTimePlayed) + 1280; | 5821 LODWORD(v344) = LODWORD(pParty->uTimePlayed) + 1280; |
5819 pActors[v343].pActorBuffs[11].Apply(v344, v731, amount, v1, v1); | 5822 pActors[v343].pActorBuffs[11].Apply(v344, v731, amount, 0, 0); |
5820 BYTE2(pActors[v343].uAttributes) |= 8u; | 5823 BYTE2(pActors[v343].uAttributes) |= 8u; |
5821 v672 = v1; | 5824 v672 = 0; |
5822 v661 = &pActors[v343]; | 5825 v661 = &pActors[v343]; |
5823 LABEL_165: | 5826 LABEL_165: |
5824 v56 = pGame->GetStru6(); | 5827 v56 = pGame->GetStru6(); |
5825 pGame->GetStru6()->_4A7E89_sparkles_on_actor_after_it_casts_buff(v661, v672); | 5828 pGame->GetStru6()->_4A7E89_sparkles_on_actor_after_it_casts_buff(v661, v672); |
5826 } | 5829 } |
5832 v349 = v348 - 1; | 5835 v349 = v348 - 1; |
5833 if ( v349 ) | 5836 if ( v349 ) |
5834 { | 5837 { |
5835 if ( v349 == 1 ) | 5838 if ( v349 == 1 ) |
5836 { | 5839 { |
5837 amount = v1; | 5840 amount = 0; |
5838 goto LABEL_679; | 5841 goto LABEL_679; |
5839 } | 5842 } |
5840 LABEL_677: | 5843 LABEL_677: |
5841 v350 = 3600 * v2; | 5844 v350 = 3600 * v2; |
5842 } | 5845 } |
5851 v351 = &pParty->pPlayers[v3->uPlayerID_2]; | 5854 v351 = &pParty->pPlayers[v3->uPlayerID_2]; |
5852 if ( !v351->pConditions[0] ) | 5855 if ( !v351->pConditions[0] ) |
5853 goto LABEL_1056; | 5856 goto LABEL_1056; |
5854 if ( v731 == 4 ) | 5857 if ( v731 == 4 ) |
5855 { | 5858 { |
5856 LODWORD(v351->pConditions[0]) = v1; | 5859 LODWORD(v351->pConditions[0]) = 0; |
5857 HIDWORD(v351->pConditions[0]) = v1; | 5860 HIDWORD(v351->pConditions[0]) = 0; |
5858 goto LABEL_904; | 5861 goto LABEL_904; |
5859 } | 5862 } |
5860 v732 = amount << 7; | 5863 v732 = amount << 7; |
5861 v351->DiscardConditionIfLastsLongerThan( | 5864 v351->DiscardConditionIfLastsLongerThan( |
5862 v1, | 5865 0, |
5863 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335)); | 5866 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335)); |
5864 if ( HIDWORD(pParty->pPlayers[v3->uPlayerID_2].pConditions[0]) | LODWORD(pParty->pPlayers[v3->uPlayerID_2].pConditions[0]) ) | 5867 if ( HIDWORD(pParty->pPlayers[v3->uPlayerID_2].pConditions[0]) | LODWORD(pParty->pPlayers[v3->uPlayerID_2].pConditions[0]) ) |
5865 goto LABEL_1056; | 5868 goto LABEL_1056; |
5866 v674 = v3->uPlayerID_2; | 5869 v674 = v3->uPlayerID_2; |
5867 goto LABEL_685; | 5870 goto LABEL_685; |
5878 { | 5881 { |
5879 v361 = v3->uPlayerID_2; | 5882 v361 = v3->uPlayerID_2; |
5880 v362 = v3->spellnum; | 5883 v362 = v3->spellnum; |
5881 v363 = pGame->GetStru6(); | 5884 v363 = pGame->GetStru6(); |
5882 pGame->GetStru6()->SetPlayerBuffAnim(v362, v361); | 5885 pGame->GetStru6()->SetPlayerBuffAnim(v362, v361); |
5883 v668 = v1; | 5886 v668 = 0; |
5884 v732 = (int)v733 << 7; | 5887 v732 = (int)v733 << 7; |
5885 v658 = v1; | 5888 v658 = 0; |
5886 v653 = v1; | 5889 v653 = 0; |
5887 v651 = v731; | 5890 v651 = v731; |
5888 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | 5891 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); |
5889 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[11]; | 5892 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[11]; |
5890 goto LABEL_103; | 5893 goto LABEL_103; |
5891 } | 5894 } |
5892 a2 = v1; | 5895 a2 = 0; |
5893 v732 = (int)v733 << 7; | 5896 v732 = (int)v733 << 7; |
5894 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | 5897 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); |
5895 v357 = pParty->pPlayers;//[0].pPlayerBuffs[11]; | 5898 v357 = pParty->pPlayers;//[0].pPlayerBuffs[11]; |
5896 do | 5899 do |
5897 { | 5900 { |
5898 v358 = a2; | 5901 v358 = a2; |
5899 v359 = v3->spellnum; | 5902 v359 = v3->spellnum; |
5900 v360 = pGame->GetStru6(); | 5903 v360 = pGame->GetStru6(); |
5901 pGame->GetStru6()->SetPlayerBuffAnim(v359, v358); | 5904 pGame->GetStru6()->SetPlayerBuffAnim(v359, v358); |
5902 v357->pPlayerBuffs[11].Apply(pParty->uTimePlayed + v717, v731, v1, v1, v1); | 5905 v357->pPlayerBuffs[11].Apply(pParty->uTimePlayed + v717, v731, 0, 0, 0); |
5903 ++a2; | 5906 ++a2; |
5904 ++v357;// = (SpellBuff *)((char *)v357 + 6972); | 5907 ++v357;// = (SpellBuff *)((char *)v357 + 6972); |
5905 } | 5908 } |
5906 while ( v357 <= &pParty->pPlayers[3] ); | 5909 while ( v357 <= &pParty->pPlayers[3] ); |
5907 goto LABEL_1056; | 5910 goto LABEL_1056; |
5921 a1.stru_24.Reset(); | 5924 a1.stru_24.Reset(); |
5922 a1.field_48 = v3->spellnum; | 5925 a1.field_48 = v3->spellnum; |
5923 a1.field_4C = v2; | 5926 a1.field_4C = v2; |
5924 a1.field_50 = v731; | 5927 a1.field_50 = v731; |
5925 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | 5928 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); |
5926 a1.uAttributes = v1; | 5929 a1.uAttributes = 0; |
5927 a1.uSectorID = v1; | 5930 a1.uSectorID = 0; |
5928 a1.uSpriteFrameID = v1; | 5931 a1.uSpriteFrameID = 0; |
5929 v368 = v3->uPlayerID; | 5932 v368 = v3->uPlayerID; |
5930 a1.field_60_distance_related_prolly_lod = 0; | 5933 a1.field_60_distance_related_prolly_lod = 0; |
5931 a1.uFacing = v1; | 5934 a1.uFacing = 0; |
5932 v368 *= 8; | 5935 v368 *= 8; |
5933 LOBYTE(v368) = v368 | OBJECT_Player; | 5936 LOBYTE(v368) = v368 | OBJECT_Player; |
5934 a1.field_58_pid = v368; | 5937 a1.field_58_pid = v368; |
5935 a1.uSoundID = LOWORD(v3->field_10); | 5938 a1.uSoundID = LOWORD(v3->field_10); |
5936 for ( a2 = v1; a2 < (signed int)v726; ++a2 ) | 5939 for ( a2 = 0; a2 < (signed int)v726; ++a2 ) |
5937 { | 5940 { |
5938 v369 = &pActors[dword_50BF30[a2]]; | 5941 v369 = &pActors[dword_50BF30[a2]]; |
5939 if ( MonsterStats::BelongsToSupertype(v369->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | 5942 if ( MonsterStats::BelongsToSupertype(v369->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) |
5940 { | 5943 { |
5941 a1.vPosition.x = v369->vPosition.x; | 5944 a1.vPosition.x = v369->vPosition.x; |
5942 a1.vPosition.y = v369->vPosition.y; | 5945 a1.vPosition.y = v369->vPosition.y; |
5943 v732 = v369->uActorHeight; | 5946 v732 = v369->uActorHeight; |
5944 a1.vPosition.z = v369->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | 5947 a1.vPosition.z = v369->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); |
5945 v370 = 8 * dword_50BF30[a2]; | 5948 v370 = 8 * dword_50BF30[a2]; |
5946 LOBYTE(v370) = v370 | 3; | 5949 LOBYTE(v370) = v370 | OBJECT_Actor; |
5947 a1.field_5C = v370; | 5950 a1.field_5C = v370; |
5948 a1.Create(0, v1, v1, v1); | 5951 a1.Create(0, 0, 0, 0); |
5949 v732 = (int)v733 << 7; | 5952 v732 = (int)v733 << 7; |
5950 v369->pActorBuffs[4].Apply( | 5953 v369->pActorBuffs[4].Apply( |
5951 pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), | 5954 pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), |
5952 v731, | 5955 v731, 0, 0, 0); |
5953 v1, | |
5954 v1, | |
5955 v1); | |
5956 } | 5956 } |
5957 } | 5957 } |
5958 goto LABEL_1056; | 5958 goto LABEL_1056; |
5959 case 53: | 5959 case 53: |
5960 v371 = v12 - 2; | 5960 v371 = v12 - 2; |
5961 if ( v371 && (v372 = v371 - 1) != 0 && v372 == 1 ) | 5961 if ( v371 && (v372 = v371 - 1) != 0 && v372 == 1 ) |
5962 amount = v1; | 5962 amount = 0; |
5963 else | 5963 else |
5964 amount = 86400 * v2; | 5964 amount = 86400 * v2; |
5965 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 5965 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
5966 goto LABEL_83; | 5966 goto LABEL_83; |
5967 pOtherOverlayList->_4418B1(5080, v3->uPlayerID_2 + 100, v1, 65536); | 5967 pOtherOverlayList->_4418B1(5080, v3->uPlayerID_2 + 100, 0, 65536); |
5968 v373 = v3->uPlayerID_2; | 5968 v373 = v3->uPlayerID_2; |
5969 if ( !(HIDWORD(pParty->pPlayers[v373].pConditions[14]) | LODWORD(pParty->pPlayers[v373].pConditions[14])) ) | 5969 if ( !(HIDWORD(pParty->pPlayers[v373].pConditions[14]) | LODWORD(pParty->pPlayers[v373].pConditions[14])) ) |
5970 goto LABEL_1056; | 5970 goto LABEL_1056; |
5971 v14 = v731 == 4; | 5971 v14 = v731 == 4; |
5972 pParty->pPlayers[v373].sHealth = 1; | 5972 pParty->pPlayers[v373].sHealth = 1; |
5973 if ( v14 ) | 5973 if ( v14 ) |
5974 { | 5974 { |
5975 v374 = v3->uPlayerID_2; | 5975 v374 = v3->uPlayerID_2; |
5976 LODWORD(pParty->pPlayers[v374].pConditions[14]) = v1; | 5976 LODWORD(pParty->pPlayers[v374].pConditions[14]) = 0; |
5977 HIDWORD(pParty->pPlayers[v374].pConditions[14]) = v1; | 5977 HIDWORD(pParty->pPlayers[v374].pConditions[14]) = 0; |
5978 v376 = v3->uPlayerID_2; | 5978 v376 = v3->uPlayerID_2; |
5979 LODWORD(pParty->pPlayers[v376].pConditions[13]) = v1; | 5979 LODWORD(pParty->pPlayers[v376].pConditions[13]) = 0; |
5980 HIDWORD(pParty->pPlayers[v376].pConditions[13]) = v1; | 5980 HIDWORD(pParty->pPlayers[v376].pConditions[13]) = 0; |
5981 } | 5981 } |
5982 else | 5982 else |
5983 { | 5983 { |
5984 v732 = amount << 7; | 5984 v732 = amount << 7; |
5985 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | 5985 *(float *)&a2 = (double)(amount << 7) * 0.033333335; |
6013 ++v382; | 6013 ++v382; |
6014 } | 6014 } |
6015 while ( v382 <= 4 ); | 6015 while ( v382 <= 4 ); |
6016 v384 = 0; | 6016 v384 = 0; |
6017 v730 = v381; | 6017 v730 = v381; |
6018 if ( v381 > v1 ) | 6018 if ( v381 > 0 ) |
6019 { | 6019 { |
6020 do | 6020 do |
6021 HIDWORD(v733) += pPlayers[v682[v384++]]->sHealth; | 6021 HIDWORD(v733) += pPlayers[v682[v384++]]->sHealth; |
6022 while ( v384 < v381 ); | 6022 while ( v384 < v381 ); |
6023 } | 6023 } |
6024 v732 = (signed __int64)((double)SHIDWORD(v733) / (double)v730); | 6024 v732 = (signed __int64)((double)SHIDWORD(v733) / (double)v730); |
6025 HIDWORD(v733) = v1; | 6025 HIDWORD(v733) = 0; |
6026 if ( v381 > v1 ) | 6026 if ( v381 > 0 ) |
6027 { | 6027 { |
6028 do | 6028 do |
6029 { | 6029 { |
6030 v385 = 4 * v682[HIDWORD(v733)] + 10965188; | 6030 v385 = 4 * v682[HIDWORD(v733)] + 10965188; |
6031 pPlayers[v682[HIDWORD(v733)]]->sHealth = v732; | 6031 pPlayers[v682[HIDWORD(v733)]]->sHealth = v732; |
6032 v726 = *(Player **)v385; | 6032 v726 = *(Player **)v385; |
6033 v386 = v726->GetMaxHealth(); | 6033 v386 = v726->GetMaxHealth(); |
6034 if ( v726->sHealth > v386 ) | 6034 if ( v726->sHealth > v386 ) |
6035 *(int *)(*(int *)v385 + 6460) = v726->GetMaxHealth(); | 6035 *(int *)(*(int *)v385 + 6460) = v726->GetMaxHealth(); |
6036 v387 = *(Player **)v385; | 6036 v387 = *(Player **)v385; |
6037 if ( v387->sHealth > v1 ) | 6037 if ( v387->sHealth > 0 ) |
6038 { | 6038 { |
6039 LODWORD(v387->pConditions[13]) = v1; | 6039 LODWORD(v387->pConditions[13]) = 0; |
6040 HIDWORD(v387->pConditions[13]) = v1; | 6040 HIDWORD(v387->pConditions[13]) = 0; |
6041 } | 6041 } |
6042 v388 = HIDWORD(v733); | 6042 v388 = HIDWORD(v733); |
6043 v389 = LOWORD(v682[HIDWORD(v733)]) - 1; | 6043 v389 = LOWORD(v682[HIDWORD(v733)]) - 1; |
6044 v390 = v3->spellnum; | 6044 v390 = v3->spellnum; |
6045 v391 = pGame->GetStru6(); | 6045 v391 = pGame->GetStru6(); |
6069 LABEL_750: | 6069 LABEL_750: |
6070 amount = v395; | 6070 amount = v395; |
6071 goto LABEL_751; | 6071 goto LABEL_751; |
6072 } | 6072 } |
6073 if ( v394 == 1 ) | 6073 if ( v394 == 1 ) |
6074 amount = v1; | 6074 amount = 0; |
6075 LABEL_751: | 6075 LABEL_751: |
6076 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 6076 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
6077 goto LABEL_83; | 6077 goto LABEL_83; |
6078 v396 = v3->uPlayerID_2; | 6078 v396 = v3->uPlayerID_2; |
6079 if ( HIDWORD(pParty->pPlayers[v396].pConditions[16]) | LODWORD(pParty->pPlayers[v396].pConditions[16]) | 6079 if ( HIDWORD(pParty->pPlayers[v396].pConditions[16]) | LODWORD(pParty->pPlayers[v396].pConditions[16]) |
6080 || HIDWORD(pParty->pPlayers[v396].pConditions[14]) | LODWORD(pParty->pPlayers[v396].pConditions[14]) ) | 6080 || HIDWORD(pParty->pPlayers[v396].pConditions[14]) | LODWORD(pParty->pPlayers[v396].pConditions[14]) ) |
6081 { | 6081 { |
6082 if ( !(HIDWORD(pParty->pPlayers[v396].pConditions[1]) | LODWORD(pParty->pPlayers[v396].pConditions[1])) ) | 6082 if ( !(HIDWORD(pParty->pPlayers[v396].pConditions[1]) | LODWORD(pParty->pPlayers[v396].pConditions[1])) ) |
6083 pParty->pPlayers[v396].PlaySound(SPEECH_25, v1); | 6083 pParty->pPlayers[v396].PlaySound(SPEECH_25, 0); |
6084 if ( v731 == 4 ) | 6084 if ( v731 == 4 ) |
6085 { | 6085 { |
6086 v397 = v3->uPlayerID_2; | 6086 v397 = v3->uPlayerID_2; |
6087 LODWORD(pParty->pPlayers[v397].pConditions[16]) = v1; | 6087 LODWORD(pParty->pPlayers[v397].pConditions[16]) = 0; |
6088 HIDWORD(pParty->pPlayers[v397].pConditions[16]) = v1; | 6088 HIDWORD(pParty->pPlayers[v397].pConditions[16]) = 0; |
6089 v398 = v3->uPlayerID_2; | 6089 v398 = v3->uPlayerID_2; |
6090 LODWORD(pParty->pPlayers[v398].pConditions[14]) = v1; | 6090 LODWORD(pParty->pPlayers[v398].pConditions[14]) = 0; |
6091 HIDWORD(pParty->pPlayers[v398].pConditions[14]) = v1; | 6091 HIDWORD(pParty->pPlayers[v398].pConditions[14]) = 0; |
6092 v399 = v3->uPlayerID_2; | 6092 v399 = v3->uPlayerID_2; |
6093 LODWORD(pParty->pPlayers[v399].pConditions[13]) = v1; | 6093 LODWORD(pParty->pPlayers[v399].pConditions[13]) = 0; |
6094 HIDWORD(pParty->pPlayers[v399].pConditions[13]) = v1; | 6094 HIDWORD(pParty->pPlayers[v399].pConditions[13]) = 0; |
6095 } | 6095 } |
6096 else | 6096 else |
6097 { | 6097 { |
6098 v732 = amount << 7; | 6098 v732 = amount << 7; |
6099 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | 6099 *(float *)&a2 = (double)(amount << 7) * 0.033333335; |
6128 v406 = v405 - 1; | 6128 v406 = v405 - 1; |
6129 if ( v406 ) | 6129 if ( v406 ) |
6130 { | 6130 { |
6131 if ( v406 == 1 ) | 6131 if ( v406 == 1 ) |
6132 { | 6132 { |
6133 amount = v1; | 6133 amount = 0; |
6134 goto LABEL_768; | 6134 goto LABEL_768; |
6135 } | 6135 } |
6136 LABEL_766: | 6136 LABEL_766: |
6137 v407 = 3600 * v2; | 6137 v407 = 3600 * v2; |
6138 } | 6138 } |
6165 v412 = v411 - 1; | 6165 v412 = v411 - 1; |
6166 if ( v412 ) | 6166 if ( v412 ) |
6167 { | 6167 { |
6168 if ( v412 == 1 ) | 6168 if ( v412 == 1 ) |
6169 { | 6169 { |
6170 amount = v1; | 6170 amount = 0; |
6171 goto LABEL_780; | 6171 goto LABEL_780; |
6172 } | 6172 } |
6173 v413 = 180 * v2; | 6173 v413 = 180 * v2; |
6174 } | 6174 } |
6175 else | 6175 else |
6200 v656 = 3; | 6200 v656 = 3; |
6201 goto LABEL_640; | 6201 goto LABEL_640; |
6202 case 59: | 6202 case 59: |
6203 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 6203 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
6204 goto LABEL_83; | 6204 goto LABEL_83; |
6205 if ( a2 == v1 || (a2 & 7) != OBJECT_Actor) | 6205 if ( a2 == 0 || (a2 & 7) != OBJECT_Actor) |
6206 goto LABEL_1056; | 6206 goto LABEL_1056; |
6207 v417 = (int)&pActors[a2 >> 3]; | 6207 v417 = (int)&pActors[a2 >> 3]; |
6208 v730 = v417; | 6208 v730 = v417; |
6209 if ( !(*(char *)(v417 + 38) & 0x80) ) | 6209 if ( !(*(char *)(v417 + 38) & 0x80) ) |
6210 { | 6210 { |
6211 ((Actor *)v417)->SetRandomGoldIfTheresNoItem(); | 6211 ((Actor *)v417)->SetRandomGoldIfTheresNoItem(); |
6212 v417 = v730; | 6212 v417 = v730; |
6213 } | 6213 } |
6214 v418 = *(int *)(v417 + 672); | 6214 v418 = *(int *)(v417 + 672); |
6215 HIDWORD(v733) = v1; | 6215 HIDWORD(v733) = 0; |
6216 if ( pItemsTable->pItems[v418].uEquipType == 18 ) | 6216 if ( pItemsTable->pItems[v418].uEquipType == 18 ) |
6217 HIDWORD(v733) = *(int *)(v417 + 684); | 6217 HIDWORD(v733) = *(int *)(v417 + 684); |
6218 | 6218 |
6219 //ItemGen::ItemGen(&v683); | 6219 //ItemGen::ItemGen(&v683); |
6220 v683.Reset(); | 6220 v683.Reset(); |
6221 | 6221 |
6222 v419 = *(short *)(v730 + 180); | 6222 v419 = *(short *)(v730 + 180); |
6223 if ( v419 != (short)v1 ) | 6223 if (v419) |
6224 { | 6224 { |
6225 v683.uItemID = v419; | 6225 v683.uItemID = v419; |
6226 goto LABEL_799; | 6226 goto LABEL_799; |
6227 } | 6227 } |
6228 v420 = 0; | 6228 v420 = 0; |
6229 v421 = v730 + 564; | 6229 v421 = v730 + 564; |
6230 while ( *(int *)v421 == v1 || pItemsTable->pItems[*(int *)v421].uEquipType == 18 ) | 6230 while ( !*(int *)v421 || pItemsTable->pItems[*(int *)v421].uEquipType == 18 ) |
6231 { | 6231 { |
6232 ++v420; | 6232 ++v420; |
6233 v421 += 36; | 6233 v421 += 36; |
6234 if ( v420 >= 4 ) | 6234 if ( v420 >= 4 ) |
6235 goto LABEL_799; | 6235 goto LABEL_799; |
6236 } | 6236 } |
6237 memcpy(&v683, (const void *)(v730 + 36 * v420 + 564), sizeof(v683)); | 6237 memcpy(&v683, (const void *)(v730 + 36 * v420 + 564), sizeof(v683)); |
6238 v2 = v723; | 6238 v2 = v723; |
6239 v1 = 0; | 6239 //v1 = 0; |
6240 LABEL_799: | 6240 LABEL_799: |
6241 if ( HIDWORD(v733) != v1 ) | 6241 if ( HIDWORD(v733) != 0 ) |
6242 { | 6242 { |
6243 v675 = (const char *)HIDWORD(v733); | 6243 v675 = (const char *)HIDWORD(v733); |
6244 if ( v683.uItemID != v1 ) | 6244 if (v683.uItemID) |
6245 { | 6245 { |
6246 v422 = v683.GetDisplayName(); | 6246 v422 = v683.GetDisplayName(); |
6247 sprintf(pTmpBuf2, "(%s), and %d gold", v422, v675); | 6247 sprintf(pTmpBuf2, "(%s), and %d gold", v422, v675); |
6248 goto LABEL_807; | 6248 goto LABEL_807; |
6249 } | 6249 } |
6250 v664 = "%d gold"; | 6250 v664 = "%d gold"; |
6251 goto LABEL_803; | 6251 goto LABEL_803; |
6252 } | 6252 } |
6253 if ( v683.uItemID != v1 ) | 6253 if (v683.uItemID) |
6254 { | 6254 { |
6255 v675 = v683.GetDisplayName(); | 6255 v675 = v683.GetDisplayName(); |
6256 v664 = "(%s)"; | 6256 v664 = "(%s)"; |
6257 LABEL_803: | 6257 LABEL_803: |
6258 sprintf(pTmpBuf2, v664, v675); | 6258 sprintf(pTmpBuf2, v664, v675); |
6302 pActors[v426].pActorBuffs[1].Reset(); | 6302 pActors[v426].pActorBuffs[1].Reset(); |
6303 pActors[v426].pActorBuffs[12].Reset(); | 6303 pActors[v426].pActorBuffs[12].Reset(); |
6304 v732 = amount << 7; | 6304 v732 = amount << 7; |
6305 pActors[v426].pActorBuffs[9].Apply( | 6305 pActors[v426].pActorBuffs[9].Apply( |
6306 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), | 6306 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), |
6307 v731, | 6307 v731, 0, 0, 0); |
6308 v1, | |
6309 v1, | |
6310 v1); | |
6311 pActors[v426].pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long; | 6308 pActors[v426].pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long; |
6312 } | 6309 } |
6313 a1.stru_24.Reset(); | 6310 a1.stru_24.Reset(); |
6314 a1.field_48 = v3->spellnum; | 6311 a1.field_48 = v3->spellnum; |
6315 a1.field_4C = v2; | 6312 a1.field_4C = v2; |
6332 pActors[v427].pActorBuffs[9].Reset(); | 6329 pActors[v427].pActorBuffs[9].Reset(); |
6333 pActors[v427].pActorBuffs[1].Reset(); | 6330 pActors[v427].pActorBuffs[1].Reset(); |
6334 v732 = amount << 7; | 6331 v732 = amount << 7; |
6335 pActors[v427].pActorBuffs[12].Apply( | 6332 pActors[v427].pActorBuffs[12].Apply( |
6336 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), | 6333 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), |
6337 v731, | 6334 v731, 0, 0, 0); |
6338 v1, | |
6339 v1, | |
6340 v1); | |
6341 } | 6335 } |
6342 a1.stru_24.Reset(); | 6336 a1.stru_24.Reset(); |
6343 a1.field_48 = v3->spellnum; | 6337 a1.field_48 = v3->spellnum; |
6344 a1.field_4C = v2; | 6338 a1.field_4C = v2; |
6345 a1.field_50 = v731; | 6339 a1.field_50 = v731; |
6362 a1.stru_24.Reset(); | 6356 a1.stru_24.Reset(); |
6363 a1.field_48 = v3->spellnum; | 6357 a1.field_48 = v3->spellnum; |
6364 a1.field_4C = v2; | 6358 a1.field_4C = v2; |
6365 a1.field_50 = v731; | 6359 a1.field_50 = v731; |
6366 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | 6360 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); |
6367 a1.uAttributes = v1; | 6361 a1.uAttributes = 0; |
6368 a1.uSectorID = v1; | 6362 a1.uSectorID = 0; |
6369 a1.uSpriteFrameID = v1; | 6363 a1.uSpriteFrameID = 0; |
6370 v432 = v3->uPlayerID; | 6364 v432 = v3->uPlayerID; |
6371 a1.field_60_distance_related_prolly_lod = 0; | 6365 a1.field_60_distance_related_prolly_lod = 0; |
6372 a1.uFacing = v1; | 6366 a1.uFacing = 0; |
6373 v432 *= 8; | 6367 v432 *= 8; |
6374 LOBYTE(v432) = v432 | OBJECT_Player; | 6368 LOBYTE(v432) = v432 | OBJECT_Player; |
6375 a1.field_58_pid = v432; | 6369 a1.field_58_pid = v432; |
6376 a1.uSoundID = LOWORD(v3->field_10); | 6370 a1.uSoundID = LOWORD(v3->field_10); |
6377 for ( a2 = v1; a2 < (signed int)v726; ++a2 ) | 6371 for ( a2 = 0; a2 < (signed int)v726; ++a2 ) |
6378 { | 6372 { |
6379 v433 = &pActors[dword_50BF30[a2]]; | 6373 v433 = &pActors[dword_50BF30[a2]]; |
6380 if ( MonsterStats::BelongsToSupertype(v433->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | 6374 if ( MonsterStats::BelongsToSupertype(v433->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) |
6381 break; | 6375 break; |
6382 a1.vPosition.x = v433->vPosition.x; | 6376 a1.vPosition.x = v433->vPosition.x; |
6383 a1.vPosition.y = v433->vPosition.y; | 6377 a1.vPosition.y = v433->vPosition.y; |
6384 v732 = v433->uActorHeight; | 6378 v732 = v433->uActorHeight; |
6385 a1.vPosition.z = v433->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | 6379 a1.vPosition.z = v433->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); |
6386 v434 = 8 * dword_50BF30[a2]; | 6380 v434 = 8 * dword_50BF30[a2]; |
6387 LOBYTE(v434) = v434 | 3; | 6381 LOBYTE(v434) = v434 | OBJECT_Actor; |
6388 a1.field_5C = v434; | 6382 a1.field_5C = v434; |
6389 a1.Create(0, v1, v1, v1); | 6383 a1.Create(0, 0, 0, 0); |
6390 if ( stru_50C198.GetMagicalResistance(v433, 7u) ) | 6384 if ( stru_50C198.GetMagicalResistance(v433, 7u) ) |
6391 { | 6385 { |
6392 v732 = amount << 7; | 6386 v732 = amount << 7; |
6393 v433->pActorBuffs[4].Apply( | 6387 v433->pActorBuffs[4].Apply( |
6394 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), | 6388 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), |
6395 v731, | 6389 v731, 0, 0, 0); |
6396 v1, | |
6397 v1, | |
6398 v1); | |
6399 } | 6390 } |
6400 } | 6391 } |
6401 goto LABEL_1056; | 6392 goto LABEL_1056; |
6402 case 64: | 6393 case 64: |
6403 v435 = v12 - 2; | 6394 v435 = v12 - 2; |
6404 if ( v435 && (v436 = v435 - 1) != 0 && v436 == 1 ) | 6395 if ( v435 && (v436 = v435 - 1) != 0 && v436 == 1 ) |
6405 amount = v1; | 6396 amount = 0; |
6406 else | 6397 else |
6407 amount = 86400 * v2; | 6398 amount = 86400 * v2; |
6408 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 6399 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
6409 goto LABEL_83; | 6400 goto LABEL_83; |
6410 v437 = v3->uPlayerID_2; | 6401 v437 = v3->uPlayerID_2; |
6413 pGame->GetStru6()->SetPlayerBuffAnim(v438, v437); | 6404 pGame->GetStru6()->SetPlayerBuffAnim(v438, v437); |
6414 v440 = v3->uPlayerID_2; | 6405 v440 = v3->uPlayerID_2; |
6415 if ( HIDWORD(pParty->pPlayers[v440].pConditions[5]) | LODWORD(pParty->pPlayers[v440].pConditions[5]) ) | 6406 if ( HIDWORD(pParty->pPlayers[v440].pConditions[5]) | LODWORD(pParty->pPlayers[v440].pConditions[5]) ) |
6416 { | 6407 { |
6417 if ( !(HIDWORD(pParty->pPlayers[v440].pConditions[1]) | LODWORD(pParty->pPlayers[v440].pConditions[1])) ) | 6408 if ( !(HIDWORD(pParty->pPlayers[v440].pConditions[1]) | LODWORD(pParty->pPlayers[v440].pConditions[1])) ) |
6418 pParty->pPlayers[v440].PlaySound(SPEECH_25, v1); | 6409 pParty->pPlayers[v440].PlaySound(SPEECH_25, 0); |
6419 if ( v731 == 4 ) | 6410 if ( v731 == 4 ) |
6420 { | 6411 { |
6421 v441 = v3->uPlayerID_2; | 6412 v441 = v3->uPlayerID_2; |
6422 LODWORD(pParty->pPlayers[v441].pConditions[5]) = v1; | 6413 LODWORD(pParty->pPlayers[v441].pConditions[5]) = 0; |
6423 HIDWORD(pParty->pPlayers[v441].pConditions[5]) = v1; | 6414 HIDWORD(pParty->pPlayers[v441].pConditions[5]) = 0; |
6424 } | 6415 } |
6425 else | 6416 else |
6426 { | 6417 { |
6427 v732 = amount << 7; | 6418 v732 = amount << 7; |
6428 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | 6419 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( |
6429 5u, | 6420 5u, |
6430 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335)); | 6421 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335)); |
6431 } | 6422 } |
6432 v377 = &pParty->pPlayers[v3->uPlayerID_2]; | 6423 v377 = &pParty->pPlayers[v3->uPlayerID_2]; |
6433 LABEL_720: | 6424 LABEL_720: |
6434 v377->SetCondition(1u, v1); | 6425 v377->SetCondition(1, 0); |
6435 } | 6426 } |
6436 goto LABEL_1056; | 6427 goto LABEL_1056; |
6437 case 42: | 6428 case 42: |
6438 v442 = v12 - 2; | 6429 v442 = v12 - 2; |
6439 if ( !v442 ) | 6430 if ( !v442 ) |
6494 goto LABEL_866; | 6485 goto LABEL_866; |
6495 } | 6486 } |
6496 v447 = &pLevelDecorations[v445]; | 6487 v447 = &pLevelDecorations[v445]; |
6497 dword_507CD8 = 1; | 6488 dword_507CD8 = 1; |
6498 v448 = v447->field_16_event_id; | 6489 v448 = v447->field_16_event_id; |
6499 if ( v448 != (short)v1 ) | 6490 if (v448) |
6500 { | 6491 { |
6501 v677 = 1; | 6492 v677 = 1; |
6502 v446 = v448; | 6493 v446 = v448; |
6503 LABEL_866: | 6494 LABEL_866: |
6504 EventProcessor(v446, a2, v677); | 6495 EventProcessor(v446, a2, v677); |
6506 } | 6497 } |
6507 if ( v447->IsInteractive() ) | 6498 if ( v447->IsInteractive() ) |
6508 { | 6499 { |
6509 GlobalEventInfo = (int)v447; | 6500 GlobalEventInfo = (int)v447; |
6510 EventProcessor(stru_5E4C90._decor_events[v447->_idx_in_stru123 - 75] + 380, 0, 1); | 6501 EventProcessor(stru_5E4C90._decor_events[v447->_idx_in_stru123 - 75] + 380, 0, 1); |
6511 GlobalEventInfo = v1; | 6502 GlobalEventInfo = 0; |
6512 } | 6503 } |
6513 } | 6504 } |
6514 } | 6505 } |
6515 goto LABEL_1056; | 6506 goto LABEL_1056; |
6516 case 67: | 6507 case 67: |
6520 v452 = v451 - 1; | 6511 v452 = v451 - 1; |
6521 if ( v452 ) | 6512 if ( v452 ) |
6522 { | 6513 { |
6523 if ( v452 == 1 ) | 6514 if ( v452 == 1 ) |
6524 { | 6515 { |
6525 amount = v1; | 6516 amount = 0; |
6526 goto LABEL_883; | 6517 goto LABEL_883; |
6527 } | 6518 } |
6528 v453 = 180 * v2; | 6519 v453 = 180 * v2; |
6529 } | 6520 } |
6530 else | 6521 else |
6549 if ( !pParty->pPlayers[v323].pConditions[1] ) | 6540 if ( !pParty->pPlayers[v323].pConditions[1] ) |
6550 goto LABEL_1056; | 6541 goto LABEL_1056; |
6551 if ( v731 == 4 ) | 6542 if ( v731 == 4 ) |
6552 { | 6543 { |
6553 LABEL_637: | 6544 LABEL_637: |
6554 *(int *)v324 = v1; | 6545 *(int *)v324 = 0; |
6555 *((int *)v324 + 1) = v1; | 6546 *((int *)v324 + 1) = 0; |
6556 goto LABEL_1056; | 6547 goto LABEL_1056; |
6557 } | 6548 } |
6558 v732 = amount << 7; | 6549 v732 = amount << 7; |
6559 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | 6550 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); |
6560 v656 = 1; | 6551 v656 = 1; |
6584 } | 6575 } |
6585 amount = v459; | 6576 amount = v459; |
6586 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 6577 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
6587 goto LABEL_83; | 6578 goto LABEL_83; |
6588 v460 = *(int *)&v3->field_C; | 6579 v460 = *(int *)&v3->field_C; |
6589 if ( v460 == v1 ) | 6580 if (!v460) |
6590 { | 6581 { |
6591 pParty->pPlayers[v3->uPlayerID_2].Heal(amount); | 6582 pParty->pPlayers[v3->uPlayerID_2].Heal(amount); |
6592 LABEL_904: | 6583 LABEL_904: |
6593 v674 = v3->uPlayerID_2; | 6584 v674 = v3->uPlayerID_2; |
6594 LABEL_685: | 6585 LABEL_685: |
6628 v465 = v464 - 1; | 6619 v465 = v464 - 1; |
6629 if ( v465 ) | 6620 if ( v465 ) |
6630 { | 6621 { |
6631 if ( v465 == 1 ) | 6622 if ( v465 == 1 ) |
6632 { | 6623 { |
6633 amount = v1; | 6624 amount = 0; |
6634 goto LABEL_912; | 6625 goto LABEL_912; |
6635 } | 6626 } |
6636 LABEL_910: | 6627 LABEL_910: |
6637 v466 = 3600 * v2; | 6628 v466 = 3600 * v2; |
6638 } | 6629 } |
6653 && !(HIDWORD(pParty->pPlayers[v470].pConditions[8]) | LODWORD(pParty->pPlayers[v470].pConditions[8])) | 6644 && !(HIDWORD(pParty->pPlayers[v470].pConditions[8]) | LODWORD(pParty->pPlayers[v470].pConditions[8])) |
6654 && !(HIDWORD(pParty->pPlayers[v470].pConditions[10]) | LODWORD(pParty->pPlayers[v470].pConditions[10])) ) | 6645 && !(HIDWORD(pParty->pPlayers[v470].pConditions[10]) | LODWORD(pParty->pPlayers[v470].pConditions[10])) ) |
6655 goto LABEL_1056; | 6646 goto LABEL_1056; |
6656 if ( v731 == 4 ) | 6647 if ( v731 == 4 ) |
6657 { | 6648 { |
6658 LODWORD(pParty->pPlayers[v470].pConditions[6]) = v1; | 6649 LODWORD(pParty->pPlayers[v470].pConditions[6]) = 0; |
6659 HIDWORD(pParty->pPlayers[v470].pConditions[6]) = v1; | 6650 HIDWORD(pParty->pPlayers[v470].pConditions[6]) = 0; |
6660 v471 = v3->uPlayerID_2; | 6651 v471 = v3->uPlayerID_2; |
6661 LODWORD(pParty->pPlayers[v471].pConditions[8]) = v1; | 6652 LODWORD(pParty->pPlayers[v471].pConditions[8]) = 0; |
6662 HIDWORD(pParty->pPlayers[v471].pConditions[8]) = v1; | 6653 HIDWORD(pParty->pPlayers[v471].pConditions[8]) = 0; |
6663 v472 = v3->uPlayerID_2; | 6654 v472 = v3->uPlayerID_2; |
6664 LODWORD(pParty->pPlayers[v472].pConditions[10]) = v1; | 6655 LODWORD(pParty->pPlayers[v472].pConditions[10]) = 0; |
6665 HIDWORD(pParty->pPlayers[v472].pConditions[10]) = v1; | 6656 HIDWORD(pParty->pPlayers[v472].pConditions[10]) = 0; |
6666 goto LABEL_1056; | 6657 goto LABEL_1056; |
6667 } | 6658 } |
6668 v732 = amount << 7; | 6659 v732 = amount << 7; |
6669 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | 6660 *(float *)&a2 = (double)(amount << 7) * 0.033333335; |
6670 pParty->pPlayers[v470].DiscardConditionIfLastsLongerThan( | 6661 pParty->pPlayers[v470].DiscardConditionIfLastsLongerThan( |
6681 LODWORD(v733) = 3600 * v2; | 6672 LODWORD(v733) = 3600 * v2; |
6682 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 6673 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
6683 goto LABEL_83; | 6674 goto LABEL_83; |
6684 v474 = v3->spellnum; | 6675 v474 = v3->spellnum; |
6685 v475 = pGame->GetStru6(); | 6676 v475 = pGame->GetStru6(); |
6686 pGame->GetStru6()->SetPlayerBuffAnim(v474, v1); | 6677 pGame->GetStru6()->SetPlayerBuffAnim(v474, 0); |
6687 v476 = v3->spellnum; | 6678 v476 = v3->spellnum; |
6688 v477 = pGame->GetStru6(); | 6679 v477 = pGame->GetStru6(); |
6689 pGame->GetStru6()->SetPlayerBuffAnim(v476, 1u); | 6680 pGame->GetStru6()->SetPlayerBuffAnim(v476, 1); |
6690 v478 = v3->spellnum; | 6681 v478 = v3->spellnum; |
6691 v479 = pGame->GetStru6(); | 6682 v479 = pGame->GetStru6(); |
6692 pGame->GetStru6()->SetPlayerBuffAnim(v478, 2u); | 6683 pGame->GetStru6()->SetPlayerBuffAnim(v478, 2); |
6693 v480 = v3->spellnum; | 6684 v480 = v3->spellnum; |
6694 v481 = pGame->GetStru6(); | 6685 v481 = pGame->GetStru6(); |
6695 pGame->GetStru6()->SetPlayerBuffAnim(v480, 3u); | 6686 pGame->GetStru6()->SetPlayerBuffAnim(v480, 3); |
6696 v668 = v1; | 6687 v668 = 0; |
6697 v732 = (int)v733 << 7; | 6688 v732 = (int)v733 << 7; |
6698 v658 = v1; | 6689 v658 = 0; |
6699 v653 = v2; | 6690 v653 = v2; |
6700 v651 = v731; | 6691 v651 = v731; |
6701 v26 = (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | 6692 v26 = (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); |
6702 v27 = (char *)&pParty->pPartyBuffs[13]; | 6693 v27 = (char *)&pParty->pPartyBuffs[13]; |
6703 goto LABEL_101; | 6694 goto LABEL_101; |
6708 goto LABEL_83; | 6699 goto LABEL_83; |
6709 if ( v731 == 4 ) | 6700 if ( v731 == 4 ) |
6710 { | 6701 { |
6711 v482 = v3->spellnum; | 6702 v482 = v3->spellnum; |
6712 v483 = pGame->GetStru6(); | 6703 v483 = pGame->GetStru6(); |
6713 pGame->GetStru6()->SetPlayerBuffAnim(v482, v1); | 6704 pGame->GetStru6()->SetPlayerBuffAnim(v482, 0); |
6714 v484 = v3->spellnum; | 6705 v484 = v3->spellnum; |
6715 v485 = pGame->GetStru6(); | 6706 v485 = pGame->GetStru6(); |
6716 pGame->GetStru6()->SetPlayerBuffAnim(v484, 1u); | 6707 pGame->GetStru6()->SetPlayerBuffAnim(v484, 1); |
6717 v486 = v3->spellnum; | 6708 v486 = v3->spellnum; |
6718 v487 = pGame->GetStru6(); | 6709 v487 = pGame->GetStru6(); |
6719 pGame->GetStru6()->SetPlayerBuffAnim(v486, 2u); | 6710 pGame->GetStru6()->SetPlayerBuffAnim(v486, 2); |
6720 v488 = v3->spellnum; | 6711 v488 = v3->spellnum; |
6721 v489 = pGame->GetStru6(); | 6712 v489 = pGame->GetStru6(); |
6722 pGame->GetStru6()->SetPlayerBuffAnim(v488, 3u); | 6713 pGame->GetStru6()->SetPlayerBuffAnim(v488, 3); |
6723 v732 = (int)v733 << 7; | 6714 v732 = (int)v733 << 7; |
6724 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | 6715 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); |
6725 pParty->pPlayers[0].pPlayerBuffs[6].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, v1); | 6716 pParty->pPlayers[0].pPlayerBuffs[6].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, 0); |
6726 pParty->pPlayers[1].pPlayerBuffs[6].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, v1); | 6717 pParty->pPlayers[1].pPlayerBuffs[6].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, 0); |
6727 pParty->pPlayers[2].pPlayerBuffs[6].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, v1); | 6718 pParty->pPlayers[2].pPlayerBuffs[6].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, 0); |
6728 v668 = v1; | 6719 v668 = 0; |
6729 v658 = v2; | 6720 v658 = v2; |
6730 v653 = v2; | 6721 v653 = v2; |
6731 LODWORD(v28) = LODWORD(pParty->uTimePlayed) + v717; | 6722 LODWORD(v28) = LODWORD(pParty->uTimePlayed) + v717; |
6732 v651 = 4; | 6723 v651 = 4; |
6733 HIDWORD(v650) = (pParty->uTimePlayed + v717) >> 32; | 6724 HIDWORD(v650) = (pParty->uTimePlayed + v717) >> 32; |
6736 } | 6727 } |
6737 v490 = v3->uPlayerID_2; | 6728 v490 = v3->uPlayerID_2; |
6738 v491 = v3->spellnum; | 6729 v491 = v3->spellnum; |
6739 v492 = pGame->GetStru6(); | 6730 v492 = pGame->GetStru6(); |
6740 pGame->GetStru6()->SetPlayerBuffAnim(v491, v490); | 6731 pGame->GetStru6()->SetPlayerBuffAnim(v491, v490); |
6741 v668 = v1; | 6732 v668 = 0; |
6742 v732 = (int)v733 << 7; | 6733 v732 = (int)v733 << 7; |
6743 v658 = v2; | 6734 v658 = v2; |
6744 v653 = v2; | 6735 v653 = v2; |
6745 v651 = v731; | 6736 v651 = v731; |
6746 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | 6737 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); |
6747 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[6]; | 6738 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[6]; |
6748 goto LABEL_103; | 6739 goto LABEL_103; |
6749 case 74: | 6740 case 74: |
6750 v493 = v12 - 2; | 6741 v493 = v12 - 2; |
6751 if ( v493 && (v494 = v493 - 1) != 0 && v494 == 1 ) | 6742 if ( v493 && (v494 = v493 - 1) != 0 && v494 == 1 ) |
6752 amount = v1; | 6743 amount = 0; |
6753 else | 6744 else |
6754 amount = 86400 * v2; | 6745 amount = 86400 * v2; |
6755 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 6746 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
6756 goto LABEL_83; | 6747 goto LABEL_83; |
6757 v495 = v3->uPlayerID_2; | 6748 v495 = v3->uPlayerID_2; |
6763 && !(HIDWORD(pParty->pPlayers[v498].pConditions[9]) | LODWORD(pParty->pPlayers[v498].pConditions[9])) | 6754 && !(HIDWORD(pParty->pPlayers[v498].pConditions[9]) | LODWORD(pParty->pPlayers[v498].pConditions[9])) |
6764 && !(HIDWORD(pParty->pPlayers[v498].pConditions[11]) | LODWORD(pParty->pPlayers[v498].pConditions[11])) ) | 6755 && !(HIDWORD(pParty->pPlayers[v498].pConditions[11]) | LODWORD(pParty->pPlayers[v498].pConditions[11])) ) |
6765 goto LABEL_1056; | 6756 goto LABEL_1056; |
6766 if ( v731 == 4 ) | 6757 if ( v731 == 4 ) |
6767 { | 6758 { |
6768 LODWORD(pParty->pPlayers[v498].pConditions[7]) = v1; | 6759 LODWORD(pParty->pPlayers[v498].pConditions[7]) = 0; |
6769 HIDWORD(pParty->pPlayers[v498].pConditions[7]) = v1; | 6760 HIDWORD(pParty->pPlayers[v498].pConditions[7]) = 0; |
6770 v499 = v3->uPlayerID_2; | 6761 v499 = v3->uPlayerID_2; |
6771 LODWORD(pParty->pPlayers[v499].pConditions[9]) = v1; | 6762 LODWORD(pParty->pPlayers[v499].pConditions[9]) = 0; |
6772 HIDWORD(pParty->pPlayers[v499].pConditions[9]) = v1; | 6763 HIDWORD(pParty->pPlayers[v499].pConditions[9]) = 0; |
6773 v500 = v3->uPlayerID_2; | 6764 v500 = v3->uPlayerID_2; |
6774 LODWORD(pParty->pPlayers[v500].pConditions[11]) = v1; | 6765 LODWORD(pParty->pPlayers[v500].pConditions[11]) = 0; |
6775 HIDWORD(pParty->pPlayers[v500].pConditions[11]) = v1; | 6766 HIDWORD(pParty->pPlayers[v500].pConditions[11]) = 0; |
6776 } | 6767 } |
6777 else | 6768 else |
6778 { | 6769 { |
6779 v732 = amount << 7; | 6770 v732 = amount << 7; |
6780 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | 6771 *(float *)&a2 = (double)(amount << 7) * 0.033333335; |
6791 LABEL_641: | 6782 LABEL_641: |
6792 v325->DiscardConditionIfLastsLongerThan(v656, v663); | 6783 v325->DiscardConditionIfLastsLongerThan(v656, v663); |
6793 } | 6784 } |
6794 goto LABEL_1056; | 6785 goto LABEL_1056; |
6795 case 77: | 6786 case 77: |
6787 { | |
6796 amount = 5 * v2 + 10; | 6788 amount = 5 * v2 + 10; |
6797 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 6789 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
6798 goto LABEL_83; | 6790 goto LABEL_83; |
6799 v501 = pParty->pPlayers; | 6791 v501 = pParty->pPlayers; |
6792 int v1 = 0; | |
6800 do | 6793 do |
6801 { | 6794 { |
6802 v502 = v3->spellnum; | 6795 v502 = v3->spellnum; |
6803 v503 = pGame->GetStru6(); | 6796 v503 = pGame->GetStru6(); |
6804 pGame->GetStru6()->SetPlayerBuffAnim(v502, v1); | 6797 pGame->GetStru6()->SetPlayerBuffAnim(v502, v1); |
6806 ++v501; | 6799 ++v501; |
6807 ++v1; | 6800 ++v1; |
6808 } | 6801 } |
6809 while ( (signed int)v501 < (signed int)pParty->pHirelings ); | 6802 while ( (signed int)v501 < (signed int)pParty->pHirelings ); |
6810 goto LABEL_1056; | 6803 goto LABEL_1056; |
6804 } | |
6811 case 80: | 6805 case 80: |
6812 sRecoveryTime -= v2; | 6806 sRecoveryTime -= v2; |
6813 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 6807 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
6814 goto LABEL_83; | 6808 goto LABEL_83; |
6815 v504 = pGame->GetStru6(); | 6809 v504 = pGame->GetStru6(); |
6816 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xAFF0Au, 0xC0u); | 6810 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xAFF0Au, 0xC0u); |
6817 v505 = sub_46A6AC((int)dword_50BF30, 100, 4096); | 6811 v505 = sub_46A6AC((int)dword_50BF30, 100, 4096); |
6818 ++a1.uItemType; | 6812 ++a1.uItemType; |
6819 HIDWORD(v733) = v505; | 6813 HIDWORD(v733) = v505; |
6820 v690 = v1; | 6814 v690 = 0; |
6821 v689 = v1; | 6815 v689 = 0; |
6822 v688 = v1; | 6816 v688 = 0; |
6823 a1.stru_24.Reset(); | 6817 a1.stru_24.Reset(); |
6824 a1.field_48 = v3->spellnum; | 6818 a1.field_48 = v3->spellnum; |
6825 a1.field_4C = v2; | 6819 a1.field_4C = v2; |
6826 a1.field_50 = v731; | 6820 a1.field_50 = v731; |
6827 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | 6821 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); |
6828 a1.uAttributes = v1; | 6822 a1.uAttributes = 0; |
6829 a1.uSectorID = v1; | 6823 a1.uSectorID = 0; |
6830 a1.uSpriteFrameID = v1; | 6824 a1.uSpriteFrameID = 0; |
6831 v506 = v3->uPlayerID; | 6825 v506 = v3->uPlayerID; |
6832 a1.field_60_distance_related_prolly_lod = 0; | 6826 a1.field_60_distance_related_prolly_lod = 0; |
6833 a1.uFacing = v1; | 6827 a1.uFacing = 0; |
6834 v506 *= 8; | 6828 v506 *= 8; |
6835 LOBYTE(v506) = v506 | OBJECT_Player; | 6829 LOBYTE(v506) = v506 | OBJECT_Player; |
6836 a1.field_58_pid = v506; | 6830 a1.field_58_pid = v506; |
6837 a1.uSoundID = LOWORD(v3->field_10); | 6831 a1.uSoundID = LOWORD(v3->field_10); |
6838 a2 = v1; | 6832 a2 = 0; |
6839 if ( SHIDWORD(v733) > v1 ) | 6833 if ( SHIDWORD(v733) > 0 ) |
6840 { | 6834 { |
6841 do | 6835 do |
6842 { | 6836 { |
6843 v507 = dword_50BF30[a2]; | 6837 v507 = dword_50BF30[a2]; |
6844 a1.vPosition.x = pActors[v507].vPosition.x; | 6838 a1.vPosition.x = pActors[v507].vPosition.x; |
6845 a1.vPosition.y = pActors[v507].vPosition.y; | 6839 a1.vPosition.y = pActors[v507].vPosition.y; |
6846 v732 = pActors[v507].uActorHeight; | 6840 v732 = pActors[v507].uActorHeight; |
6847 a1.vPosition.z = pActors[v507].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | 6841 a1.vPosition.z = pActors[v507].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); |
6848 v508 = 8 * dword_50BF30[a2]; | 6842 v508 = 8 * dword_50BF30[a2]; |
6849 LOBYTE(v508) = v508 | 3; | 6843 LOBYTE(v508) = v508 | OBJECT_Actor; |
6850 a1.field_5C = v508; | 6844 a1.field_5C = v508; |
6851 v509 = a1.Create(0, v1, v1, v1); | 6845 v509 = a1.Create(0, 0, 0, 0); |
6852 v510 = a2; | 6846 v510 = a2; |
6853 DamageMonsterFromParty(8 * v509 | 2, dword_50BF30[a2], (Vec3_int_ *)&v688); | 6847 DamageMonsterFromParty(8 * v509 | OBJECT_Item, dword_50BF30[a2], (Vec3_int_ *)&v688); |
6854 a2 = v510 + 1; | 6848 a2 = v510 + 1; |
6855 } | 6849 } |
6856 while ( v510 + 1 < SHIDWORD(v733) ); | 6850 while ( v510 + 1 < SHIDWORD(v733) ); |
6857 } | 6851 } |
6858 for ( a2 = v1; a2 < SHIDWORD(v733); ++a2 ) | 6852 for ( a2 = 0; a2 < SHIDWORD(v733); ++a2 ) |
6859 { | 6853 { |
6860 v511 = &pActors[dword_50BF30[a2]]; | 6854 v511 = &pActors[dword_50BF30[a2]]; |
6861 a1.vPosition.x = v511->vPosition.x; | 6855 a1.vPosition.x = v511->vPosition.x; |
6862 a1.vPosition.y = v511->vPosition.y; | 6856 a1.vPosition.y = v511->vPosition.y; |
6863 v732 = v511->uActorHeight; | 6857 v732 = v511->uActorHeight; |
6864 a1.vPosition.z = v511->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | 6858 a1.vPosition.z = v511->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); |
6865 v512 = 8 * dword_50BF30[a2]; | 6859 v512 = 8 * dword_50BF30[a2]; |
6866 LOBYTE(v512) = v512 | 3; | 6860 LOBYTE(v512) = v512 | OBJECT_Actor; |
6867 a1.field_5C = v512; | 6861 a1.field_5C = v512; |
6868 a1.Create(0, v1, v1, v1); | 6862 a1.Create(0, 0, 0, 0); |
6869 v513 = v511->pActorBuffs; | 6863 v513 = v511->pActorBuffs; |
6870 v726 = (Player *)22; | 6864 v726 = (Player *)22; |
6871 do | 6865 do |
6872 { | 6866 { |
6873 v513->Reset(); | 6867 v513->Reset(); |
6899 else | 6893 else |
6900 { | 6894 { |
6901 v516 = 900 * v2; | 6895 v516 = 900 * v2; |
6902 amount = 3; | 6896 amount = 3; |
6903 } | 6897 } |
6904 v733 = __PAIR__(v1, v516); | 6898 v733 = __PAIR__(0, v516); |
6905 v517 = 8 * v3->uPlayerID; | 6899 v517 = 8 * v3->uPlayerID; |
6906 LOBYTE(v517) = v517 | 4; | 6900 LOBYTE(v517) = v517 | 4; |
6907 if ( (signed int)uNumActors > v1 ) | 6901 if ( (signed int)uNumActors > 0 ) |
6908 { | 6902 { |
6909 v518 = pActors;//[0].uAIState; | 6903 v518 = pActors;//[0].uAIState; |
6910 v726b = uNumActors; | 6904 v726b = uNumActors; |
6911 do | 6905 do |
6912 { | 6906 { |
6954 amount = v522; | 6948 amount = v522; |
6955 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 6949 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
6956 goto LABEL_83; | 6950 goto LABEL_83; |
6957 v523 = v3->spellnum; | 6951 v523 = v3->spellnum; |
6958 v524 = pGame->GetStru6(); | 6952 v524 = pGame->GetStru6(); |
6959 pGame->GetStru6()->SetPlayerBuffAnim(v523, v1); | 6953 pGame->GetStru6()->SetPlayerBuffAnim(v523, 0); |
6960 v83 = 1; | 6954 v83 = 1; |
6961 v525 = v3->spellnum; | 6955 v525 = v3->spellnum; |
6962 v526 = pGame->GetStru6(); | 6956 v526 = pGame->GetStru6(); |
6963 pGame->GetStru6()->SetPlayerBuffAnim(v525, 1u); | 6957 pGame->GetStru6()->SetPlayerBuffAnim(v525, 1); |
6964 v527 = v3->spellnum; | 6958 v527 = v3->spellnum; |
6965 v528 = pGame->GetStru6(); | 6959 v528 = pGame->GetStru6(); |
6966 pGame->GetStru6()->SetPlayerBuffAnim(v527, 2u); | 6960 pGame->GetStru6()->SetPlayerBuffAnim(v527, 2); |
6967 v529 = v3->spellnum; | 6961 v529 = v3->spellnum; |
6968 v530 = pGame->GetStru6(); | 6962 v530 = pGame->GetStru6(); |
6969 pGame->GetStru6()->SetPlayerBuffAnim(v529, 3u); | 6963 pGame->GetStru6()->SetPlayerBuffAnim(v529, 3); |
6970 v673 = v1; | 6964 v673 = 0; |
6971 v732 = (int)v733 << 7; | 6965 v732 = (int)v733 << 7; |
6972 v662 = v1; | 6966 v662 = 0; |
6973 v655 = amount; | 6967 v655 = amount; |
6974 v652 = v731; | 6968 v652 = v731; |
6975 v183 = (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | 6969 v183 = (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); |
6976 v137 = (char *)&pParty->pPartyBuffs[2]; | 6970 v137 = (char *)&pParty->pPartyBuffs[2]; |
6977 goto LABEL_976; | 6971 goto LABEL_976; |
6985 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 6979 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
6986 goto LABEL_83; | 6980 goto LABEL_83; |
6987 v531 = sub_46A6AC((int)dword_50BF30, 100, 4096); | 6981 v531 = sub_46A6AC((int)dword_50BF30, 100, 4096); |
6988 ++a1.uItemType; | 6982 ++a1.uItemType; |
6989 v726 = (Player *)v531; | 6983 v726 = (Player *)v531; |
6990 v696 = v1; | 6984 v696 = 0; |
6991 v695 = v1; | 6985 v695 = 0; |
6992 v694 = v1; | 6986 v694 = 0; |
6993 a1.stru_24.Reset(); | 6987 a1.stru_24.Reset(); |
6994 a1.field_48 = v3->spellnum; | 6988 a1.field_48 = v3->spellnum; |
6995 a1.field_4C = v2; | 6989 a1.field_4C = v2; |
6996 a1.field_50 = v731; | 6990 a1.field_50 = v731; |
6997 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | 6991 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); |
6998 a1.uAttributes = v1; | 6992 a1.uAttributes = 0; |
6999 a1.uSectorID = v1; | 6993 a1.uSectorID = 0; |
7000 a1.uSpriteFrameID = v1; | 6994 a1.uSpriteFrameID = 0; |
7001 v532 = v3->uPlayerID; | 6995 v532 = v3->uPlayerID; |
7002 a1.field_60_distance_related_prolly_lod = 0; | 6996 a1.field_60_distance_related_prolly_lod = 0; |
7003 a1.uFacing = v1; | 6997 a1.uFacing = 0; |
7004 v532 *= 8; | 6998 v532 *= 8; |
7005 LOBYTE(v532) = v532 | OBJECT_Player; | 6999 LOBYTE(v532) = v532 | OBJECT_Player; |
7006 a1.field_58_pid = v532; | 7000 a1.field_58_pid = v532; |
7007 a1.uSoundID = LOWORD(v3->field_10); | 7001 a1.uSoundID = LOWORD(v3->field_10); |
7008 a2 = v1; | 7002 a2 = 0; |
7009 if ( (signed int)v726 > v1 ) | 7003 if ( (signed int)v726 > 0 ) |
7010 { | 7004 { |
7011 do | 7005 do |
7012 { | 7006 { |
7013 v533 = dword_50BF30[a2]; | 7007 v533 = dword_50BF30[a2]; |
7014 a1.vPosition.x = pActors[v533].vPosition.x; | 7008 a1.vPosition.x = pActors[v533].vPosition.x; |
7015 a1.vPosition.y = pActors[v533].vPosition.y; | 7009 a1.vPosition.y = pActors[v533].vPosition.y; |
7016 v732 = pActors[v533].uActorHeight; | 7010 v732 = pActors[v533].uActorHeight; |
7017 a1.vPosition.z = pActors[v533].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | 7011 a1.vPosition.z = pActors[v533].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); |
7018 v534 = 8 * dword_50BF30[a2]; | 7012 v534 = 8 * dword_50BF30[a2]; |
7019 LOBYTE(v534) = v534 | 3; | 7013 LOBYTE(v534) = v534 | OBJECT_Actor; |
7020 a1.field_5C = v534; | 7014 a1.field_5C = v534; |
7021 v535 = a1.Create(0, v1, v1, v1); | 7015 v535 = a1.Create(0, 0, 0, 0); |
7022 v536 = a2; | 7016 v536 = a2; |
7023 DamageMonsterFromParty(8 * v535 | 2, dword_50BF30[a2], (Vec3_int_ *)&v694); | 7017 DamageMonsterFromParty(8 * v535 | OBJECT_Item, dword_50BF30[a2], (Vec3_int_ *)&v694); |
7024 a2 = v536 + 1; | 7018 a2 = v536 + 1; |
7025 } | 7019 } |
7026 while ( v536 + 1 < (signed int)v726 ); | 7020 while ( v536 + 1 < (signed int)v726 ); |
7027 } | 7021 } |
7028 v537 = pGame->GetStru6(); | 7022 v537 = pGame->GetStru6(); |
7044 LODWORD(v733) = v540; | 7038 LODWORD(v733) = v540; |
7045 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 7039 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
7046 goto LABEL_83; | 7040 goto LABEL_83; |
7047 v541 = v3->spellnum; | 7041 v541 = v3->spellnum; |
7048 v542 = pGame->GetStru6(); | 7042 v542 = pGame->GetStru6(); |
7049 pGame->GetStru6()->SetPlayerBuffAnim(v541, v1); | 7043 pGame->GetStru6()->SetPlayerBuffAnim(v541, 0); |
7050 v543 = v3->spellnum; | 7044 v543 = v3->spellnum; |
7051 v544 = pGame->GetStru6(); | 7045 v544 = pGame->GetStru6(); |
7052 pGame->GetStru6()->SetPlayerBuffAnim(v543, 1u); | 7046 pGame->GetStru6()->SetPlayerBuffAnim(v543, 1); |
7053 v545 = v3->spellnum; | 7047 v545 = v3->spellnum; |
7054 v546 = pGame->GetStru6(); | 7048 v546 = pGame->GetStru6(); |
7055 pGame->GetStru6()->SetPlayerBuffAnim(v545, 2u); | 7049 pGame->GetStru6()->SetPlayerBuffAnim(v545, 2); |
7056 v547 = v3->spellnum; | 7050 v547 = v3->spellnum; |
7057 v548 = pGame->GetStru6(); | 7051 v548 = pGame->GetStru6(); |
7058 pGame->GetStru6()->SetPlayerBuffAnim(v547, 3u); | 7052 pGame->GetStru6()->SetPlayerBuffAnim(v547, 3); |
7059 v732 = v730 << 7; | 7053 v732 = v730 << 7; |
7060 v549 = (double)(v730 << 7) * 0.033333335; | 7054 v549 = (double)(v730 << 7) * 0.033333335; |
7061 *((float *)&v733 + 1) = v549; | 7055 *((float *)&v733 + 1) = v549; |
7062 v712 = (signed __int64)v549; | 7056 v712 = (signed __int64)v549; |
7063 pParty->pPartyBuffs[ 1].Apply(pParty->uTimePlayed + (signed __int64)v549, v731, amount, v1, v1); | 7057 pParty->pPartyBuffs[ 1].Apply(pParty->uTimePlayed + (signed __int64)v549, v731, amount, 0, 0); |
7064 pParty->pPartyBuffs[12].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1); | 7058 pParty->pPartyBuffs[12].Apply(pParty->uTimePlayed + v712, v731, amount, 0, 0); |
7065 pParty->pPartyBuffs[ 6].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1); | 7059 pParty->pPartyBuffs[ 6].Apply(pParty->uTimePlayed + v712, v731, amount, 0, 0); |
7066 pParty->pPartyBuffs[17].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1); | 7060 pParty->pPartyBuffs[17].Apply(pParty->uTimePlayed + v712, v731, amount, 0, 0); |
7067 pParty->pPartyBuffs[ 0].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1); | 7061 pParty->pPartyBuffs[ 0].Apply(pParty->uTimePlayed + v712, v731, amount, 0, 0); |
7068 pParty->pPartyBuffs[ 4].Apply(pParty->uTimePlayed + v712, v731, amount, v1, v1); | 7062 pParty->pPartyBuffs[ 4].Apply(pParty->uTimePlayed + v712, v731, amount, 0, 0); |
7069 v550 = v2 + 5; | 7063 v550 = v2 + 5; |
7070 pParty->pPartyBuffs[ 5].Apply( | 7064 pParty->pPartyBuffs[ 5].Apply( |
7071 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), | 7065 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), |
7072 v731, | 7066 v731, |
7073 v550, | 7067 v550, 0, 0); |
7074 v1, | 7068 v668 = 0; |
7075 v1); | 7069 v658 = 0; |
7076 v668 = v1; | |
7077 v658 = v1; | |
7078 v653 = v550; | 7070 v653 = v550; |
7079 v651 = v731; | 7071 v651 = v731; |
7080 v28 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)); | 7072 v28 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)); |
7081 LABEL_992: | 7073 LABEL_992: |
7082 v27 = (char *)&pParty->pPartyBuffs[19]; | 7074 v27 = (char *)&pParty->pPartyBuffs[19]; |
7107 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 7099 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
7108 goto LABEL_83; | 7100 goto LABEL_83; |
7109 y = (char *)(60 * (v2 * HIDWORD(v733) + 60)); | 7101 y = (char *)(60 * (v2 * HIDWORD(v733) + 60)); |
7110 v732 = (300 * amount * v2 + 60) << 7; | 7102 v732 = (300 * amount * v2 + 60) << 7; |
7111 v730 = v2 + 5; | 7103 v730 = v2 + 5; |
7112 v726 = (Player *)v1; | 7104 v726 = 0; |
7113 v553 = pParty->pPlayers;//[0].pConditions[1]; | 7105 v553 = pParty->pPlayers;//[0].pConditions[1]; |
7114 *((float *)&v733 + 1) = (double)v732 * 0.033333335; | 7106 *((float *)&v733 + 1) = (double)v732 * 0.033333335; |
7115 do | 7107 do |
7116 { | 7108 { |
7117 v554 = v3->spellnum; | 7109 v554 = v3->spellnum; |
7118 v555 = pGame->GetStru6(); | 7110 v555 = pGame->GetStru6(); |
7119 pGame->GetStru6()->SetPlayerBuffAnim(v554, v1); | 7111 pGame->GetStru6()->SetPlayerBuffAnim(v554, 0); |
7120 v556 = v3->spellnum; | 7112 v556 = v3->spellnum; |
7121 v557 = pGame->GetStru6(); | 7113 v557 = pGame->GetStru6(); |
7122 pGame->GetStru6()->SetPlayerBuffAnim(v556, 1u); | 7114 pGame->GetStru6()->SetPlayerBuffAnim(v556, 1); |
7123 v558 = v3->spellnum; | 7115 v558 = v3->spellnum; |
7124 v559 = pGame->GetStru6(); | 7116 v559 = pGame->GetStru6(); |
7125 pGame->GetStru6()->SetPlayerBuffAnim(v558, 2u); | 7117 pGame->GetStru6()->SetPlayerBuffAnim(v558, 2); |
7126 v560 = v3->spellnum; | 7118 v560 = v3->spellnum; |
7127 v561 = pGame->GetStru6(); | 7119 v561 = pGame->GetStru6(); |
7128 pGame->GetStru6()->SetPlayerBuffAnim(v560, 3u); | 7120 pGame->GetStru6()->SetPlayerBuffAnim(v560, 3); |
7129 //((SpellBuff *)(v553 + 6056))->Apply( | 7121 //((SpellBuff *)(v553 + 6056))->Apply( |
7130 v553->pPlayerBuffs[4].Apply( | 7122 v553->pPlayerBuffs[4].Apply( |
7131 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), | 7123 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), |
7132 v731, | 7124 v731, v730, 0, 0); |
7133 v730, | |
7134 v1, | |
7135 v1); | |
7136 if ( *(_QWORD *)v553 ) | 7125 if ( *(_QWORD *)v553 ) |
7137 v726 = (Player *)1; | 7126 v726 = (Player *)1; |
7138 ++v553; | 7127 ++v553; |
7139 } | 7128 } |
7140 while ( v553 <= &pParty->pPlayers[3] ); | 7129 while ( v553 <= &pParty->pPlayers[3] ); |
7141 v562 = v731; | 7130 v562 = v731; |
7142 pParty->pPartyBuffs[9].Apply( | 7131 pParty->pPartyBuffs[9].Apply( |
7143 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), | 7132 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), |
7144 v731, | 7133 v731, v730, 0, 0); |
7145 v730, | |
7146 v1, | |
7147 v1); | |
7148 pParty->pPartyBuffs[14].Apply( | 7134 pParty->pPartyBuffs[14].Apply( |
7149 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), | 7135 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), |
7150 v562, | 7136 v562, 0, 0, 0); |
7151 v1, | |
7152 v1, | |
7153 v1); | |
7154 pParty->pPartyBuffs[15].Apply( | 7137 pParty->pPartyBuffs[15].Apply( |
7155 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), | 7138 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), |
7156 v562, | 7139 v562, v730, 0, 0); |
7157 v730, | 7140 if (v726) |
7158 v1, | |
7159 v1); | |
7160 if ( v726 != (Player *)v1 ) | |
7161 goto LABEL_1056; | 7141 goto LABEL_1056; |
7162 v668 = v1; | 7142 v668 = 0; |
7163 v732 = (int)y << 7; | 7143 v732 = (int)y << 7; |
7164 v658 = v1; | 7144 v658 = 0; |
7165 v653 = v730; | 7145 v653 = v730; |
7166 v651 = v562; | 7146 v651 = v562; |
7167 v28 = (signed __int64)((double)(signed int)((int)y << 7) * 0.033333335 | 7147 v28 = (signed __int64)((double)(signed int)((int)y << 7) * 0.033333335 |
7168 + (double)(signed __int64)pParty->uTimePlayed); | 7148 + (double)(signed __int64)pParty->uTimePlayed); |
7169 v27 = (char *)&pParty->pPartyBuffs[8]; | 7149 v27 = (char *)&pParty->pPartyBuffs[8]; |
7172 amount = 3; | 7152 amount = 3; |
7173 if ( pPlayer->uNumDivineInterventionCastsThisDay >= 3u ) | 7153 if ( pPlayer->uNumDivineInterventionCastsThisDay >= 3u ) |
7174 goto LABEL_200; | 7154 goto LABEL_200; |
7175 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 7155 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
7176 goto LABEL_83; | 7156 goto LABEL_83; |
7177 a2 = v1; | 7157 a2 = 0; |
7178 _this = (ItemGen *)&pPlayers[1]; | 7158 _this = (ItemGen *)&pPlayers[1]; |
7179 do | 7159 do |
7180 { | 7160 { |
7181 v563 = 0; | 7161 v563 = 0; |
7182 do | 7162 do |
7183 { | 7163 { |
7184 v564 = _this->uItemID; | 7164 v564 = _this->uItemID; |
7185 *(int *)(v563 + _this->uItemID) = v1; | 7165 *(int *)(v563 + _this->uItemID) = 0; |
7186 v563 += 8; | 7166 v563 += 8; |
7187 *(int *)(v563 + v564 - 4) = v1; | 7167 *(int *)(v563 + v564 - 4) = 0; |
7188 } | 7168 } |
7189 while ( v563 <= 128 ); | 7169 while ( v563 <= 128 ); |
7190 v565 = ((Player *)_this->uItemID)->GetMaxHealth(); | 7170 v565 = ((Player *)_this->uItemID)->GetMaxHealth(); |
7191 v566 = (Player **)_this; | 7171 v566 = (Player **)_this; |
7192 *(int *)(_this->uItemID + 6460) = v565; | 7172 *(int *)(_this->uItemID + 6460) = v565; |
7232 } | 7212 } |
7233 amount = v575; | 7213 amount = v575; |
7234 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 7214 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
7235 goto LABEL_83; | 7215 goto LABEL_83; |
7236 v576 = *(int *)&v3->field_C; | 7216 v576 = *(int *)&v3->field_C; |
7237 if ( v576 == v1 ) | 7217 if (!v576) |
7238 { | 7218 { |
7239 v583 = v3->uPlayerID_2; | 7219 v583 = v3->uPlayerID_2; |
7240 v584 = v3->spellnum; | 7220 v584 = v3->spellnum; |
7241 v585 = (char *)&pParty->pPlayers[v3->uPlayerID_2]; | 7221 v585 = (char *)&pParty->pPlayers[v3->uPlayerID_2]; |
7242 v586 = pGame->GetStru6(); | 7222 v586 = pGame->GetStru6(); |
7257 v66 = pGlobalTXT_LocalizationStrings[496]; | 7237 v66 = pGlobalTXT_LocalizationStrings[496]; |
7258 goto LABEL_201; | 7238 goto LABEL_201; |
7259 } | 7239 } |
7260 v578 = (int)&pActors[(int)v577]; | 7240 v578 = (int)&pActors[(int)v577]; |
7261 v721 = v578; | 7241 v721 = v578; |
7262 if ( *(short *)(v578 + 40) > (signed __int16)v1 || (v579 = *(short *)(v578 + 176), v579 != 5) && v579 != 4 ) | 7242 if ( *(short *)(v578 + 40) > 0 || (v579 = *(short *)(v578 + 176), v579 != 5) && v579 != 4 ) |
7263 goto LABEL_200; | 7243 goto LABEL_200; |
7264 ++a1.uItemType; | 7244 ++a1.uItemType; |
7265 a1.stru_24.Reset(); | 7245 a1.stru_24.Reset(); |
7266 a1.field_48 = v3->spellnum; | 7246 a1.field_48 = v3->spellnum; |
7267 a1.field_4C = v2; | 7247 a1.field_4C = v2; |
7268 a1.field_50 = v731; | 7248 a1.field_50 = v731; |
7269 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | 7249 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); |
7270 a1.uAttributes = v1; | 7250 a1.uAttributes = 0; |
7271 a1.uSectorID = v1; | 7251 a1.uSectorID = 0; |
7272 a1.uSpriteFrameID = v1; | 7252 a1.uSpriteFrameID = 0; |
7273 v580 = v3->uPlayerID; | 7253 v580 = v3->uPlayerID; |
7274 a1.field_60_distance_related_prolly_lod = 0; | 7254 a1.field_60_distance_related_prolly_lod = 0; |
7275 v581 = v721; | 7255 v581 = v721; |
7276 v580 *= 8; | 7256 v580 *= 8; |
7277 LOBYTE(v580) = v580 | OBJECT_Player; | 7257 LOBYTE(v580) = v580 | OBJECT_Player; |
7278 a1.uFacing = v1; | 7258 a1.uFacing = 0; |
7279 a1.field_58_pid = v580; | 7259 a1.field_58_pid = v580; |
7280 a1.uSoundID = LOWORD(v3->field_10); | 7260 a1.uSoundID = LOWORD(v3->field_10); |
7281 a1.vPosition.x = *(short *)(v721 + 142); | 7261 a1.vPosition.x = *(short *)(v721 + 142); |
7282 a1.vPosition.y = *(short *)(v721 + 144); | 7262 a1.vPosition.y = *(short *)(v721 + 144); |
7283 v732 = *(short *)(v721 + 138); | 7263 v732 = *(short *)(v721 + 138); |
7284 v582 = 8 * (int)v726; | 7264 v582 = 8 * (int)v726; |
7285 a1.vPosition.z = *(short *)(v721 + 146) - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | 7265 a1.vPosition.z = *(short *)(v721 + 146) - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); |
7286 LOBYTE(v582) = 8 * (char)v726 | 3; | 7266 LOBYTE(v582) = 8 * (char)v726 | OBJECT_Actor; |
7287 a1.field_5C = v582; | 7267 a1.field_5C = v582; |
7288 a1.Create(0, v1, v1, v1); | 7268 a1.Create(0, 0, 0, 0); |
7289 if ( *(char *)(v581 + 52) > amount ) | 7269 if ( *(char *)(v581 + 52) > amount ) |
7290 goto LABEL_83; | 7270 goto LABEL_83; |
7291 Actor::Resurrect((unsigned int)v726); | 7271 Actor::Resurrect((unsigned int)v726); |
7292 *(char *)(v581 + 61) = 0; | 7272 *(char *)(v581 + 61) = 0; |
7293 *(char *)(v581 + 53) = 0; | 7273 *(char *)(v581 + 53) = 0; |
7295 *(char *)(v581 + 55) = 0; | 7275 *(char *)(v581 + 55) = 0; |
7296 *(char *)(v581 + 56) = 0; | 7276 *(char *)(v581 + 56) = 0; |
7297 *(char *)(v581 + 57) = 0; | 7277 *(char *)(v581 + 57) = 0; |
7298 *(int *)(v581 + 712) = 9999; | 7278 *(int *)(v581 + 712) = 9999; |
7299 *(char *)(v581 + 38) &= 0xF7u; | 7279 *(char *)(v581 + 38) &= 0xF7u; |
7300 *(int *)(v581 + 708) = v1; | 7280 *(int *)(v581 + 708) = 0; |
7301 ((SpellBuff *)(v581 + 356))->Reset(); | 7281 ((SpellBuff *)(v581 + 356))->Reset(); |
7302 ((SpellBuff *)(v581 + 228))->Reset(); | 7282 ((SpellBuff *)(v581 + 228))->Reset(); |
7303 ((SpellBuff *)(v581 + 404))->Reset(); | 7283 ((SpellBuff *)(v581 + 404))->Reset(); |
7304 if ( *(short *)(v581 + 40) > 10 * amount ) | 7284 if ( *(short *)(v581 + 40) > 10 * amount ) |
7305 *(short *)(v581 + 40) = 10 * amount; | 7285 *(short *)(v581 + 40) = 10 * amount; |
7308 v588 = v12 - 1; | 7288 v588 = v12 - 1; |
7309 amount = 16; | 7289 amount = 16; |
7310 if ( v588 && (v589 = v588 - 1) != 0 && (v590 = v589 - 1) != 0 ) | 7290 if ( v588 && (v589 = v588 - 1) != 0 && (v590 = v589 - 1) != 0 ) |
7311 { | 7291 { |
7312 if ( v590 == 1 ) | 7292 if ( v590 == 1 ) |
7313 LODWORD(v733) = v1; | 7293 LODWORD(v733) = 0; |
7314 } | 7294 } |
7315 else | 7295 else |
7316 { | 7296 { |
7317 LODWORD(v733) = 3600 * v2; | 7297 LODWORD(v733) = 3600 * v2; |
7318 } | 7298 } |
7321 HIDWORD(v733) = (int)(char *)&pParty + 6972 * v3->uPlayerID_2 + 36 * a2 + 3040; | 7301 HIDWORD(v733) = (int)(char *)&pParty + 6972 * v3->uPlayerID_2 + 36 * a2 + 3040; |
7322 v732 = (signed int)&pItemsTable->pItems[*(int *)HIDWORD(v733)].pIconName; | 7302 v732 = (signed int)&pItemsTable->pItems[*(int *)HIDWORD(v733)].pIconName; |
7323 ((ItemGen *)HIDWORD(v733))->UpdateTempBonus(pParty->uTimePlayed); | 7303 ((ItemGen *)HIDWORD(v733))->UpdateTempBonus(pParty->uTimePlayed); |
7324 if ( *(int *)HIDWORD(v733) >= 64 && *(int *)HIDWORD(v733) <= 65 | 7304 if ( *(int *)HIDWORD(v733) >= 64 && *(int *)HIDWORD(v733) <= 65 |
7325 || *(char *)(HIDWORD(v733) + 20) & 2 | 7305 || *(char *)(HIDWORD(v733) + 20) & 2 |
7326 || *(int *)(HIDWORD(v733) + 12) != v1 | 7306 || *(int *)(HIDWORD(v733) + 12) != 0 |
7327 || *(int *)(HIDWORD(v733) + 4) != v1 | 7307 || *(int *)(HIDWORD(v733) + 4) != 0 |
7328 || (v591 = *(char *)(v732 + 28)) != 0 && v591 != 1 && v591 != 2 | 7308 || (v591 = *(char *)(v732 + 28)) != 0 && v591 != 1 && v591 != 2 |
7329 || pItemsTable->IsMaterialNonCommon((ItemGen *)HIDWORD(v733)) ) | 7309 || pItemsTable->IsMaterialNonCommon((ItemGen *)HIDWORD(v733)) ) |
7330 goto LABEL_199; | 7310 goto LABEL_199; |
7331 v592 = HIDWORD(v733); | 7311 v592 = HIDWORD(v733); |
7332 v14 = v731 == 4; | 7312 v14 = v731 == 4; |
7366 a1.field_4C = v2; | 7346 a1.field_4C = v2; |
7367 a1.field_50 = v731; | 7347 a1.field_50 = v731; |
7368 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | 7348 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); |
7369 a1.vPosition.x = pParty->vPosition.x; | 7349 a1.vPosition.x = pParty->vPosition.x; |
7370 a1.vPosition.y = pParty->vPosition.y; | 7350 a1.vPosition.y = pParty->vPosition.y; |
7371 a1.uAttributes = v1; | 7351 a1.uAttributes = 0; |
7372 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; | 7352 a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; |
7373 a1.uSectorID = pIndoor->GetSector( | 7353 a1.uSectorID = pIndoor->GetSector( |
7374 pParty->vPosition.x, | 7354 pParty->vPosition.x, |
7375 pParty->vPosition.y, | 7355 pParty->vPosition.y, |
7376 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2); | 7356 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2); |
7377 a1.uSpriteFrameID = v1; | 7357 a1.uSpriteFrameID = 0; |
7378 v595 = 8 * v3->uPlayerID; | 7358 v595 = 8 * v3->uPlayerID; |
7379 LOBYTE(v595) = v595 | OBJECT_Player; | 7359 LOBYTE(v595) = v595 | OBJECT_Player; |
7380 a1.field_58_pid = v595; | 7360 a1.field_58_pid = v595; |
7381 a1.field_5C = a2; | 7361 a1.field_5C = a2; |
7382 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | 7362 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); |
7432 pActors[v599].pActorBuffs[9].Reset(); | 7412 pActors[v599].pActorBuffs[9].Reset(); |
7433 pActors[v599].pActorBuffs[1].Reset(); | 7413 pActors[v599].pActorBuffs[1].Reset(); |
7434 v732 = (int)v733 << 7; | 7414 v732 = (int)v733 << 7; |
7435 pActors[v599].pActorBuffs[12].Apply( | 7415 pActors[v599].pActorBuffs[12].Apply( |
7436 pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), | 7416 pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), |
7437 v731, | 7417 v731, 0, 0, 0); |
7438 v1, | |
7439 v1, | |
7440 v1); | |
7441 a1.stru_24.Reset(); | 7418 a1.stru_24.Reset(); |
7442 a1.field_48 = v3->spellnum; | 7419 a1.field_48 = v3->spellnum; |
7443 a1.field_4C = v2; | 7420 a1.field_4C = v2; |
7444 a1.field_50 = v731; | 7421 a1.field_50 = v731; |
7445 v60 = pObjectList->ObjectIDByItemID(a1.uItemType); | 7422 v60 = pObjectList->ObjectIDByItemID(a1.uItemType); |
7455 v676 = v603 + v602; | 7432 v676 = v603 + v602; |
7456 v665 = v600; | 7433 v665 = v600; |
7457 a1.vPosition.z = v603 + v602; | 7434 a1.vPosition.z = v603 + v602; |
7458 v657 = v601; | 7435 v657 = v601; |
7459 LABEL_1087: | 7436 LABEL_1087: |
7460 a1.uAttributes = v1; | 7437 a1.uAttributes = 0; |
7461 a1.uSectorID = pIndoor->GetSector(v657, v665, v676); | 7438 a1.uSectorID = pIndoor->GetSector(v657, v665, v676); |
7462 a1.uSpriteFrameID = v1; | 7439 a1.uSpriteFrameID = 0; |
7463 v604 = 8 * v3->uPlayerID; | 7440 v604 = 8 * v3->uPlayerID; |
7464 LOBYTE(v604) = v604 | OBJECT_Player; | 7441 LOBYTE(v604) = v604 | OBJECT_Player; |
7465 a1.field_58_pid = v604; | 7442 a1.field_58_pid = v604; |
7466 a1.field_5C = a2; | 7443 a1.field_5C = a2; |
7467 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | 7444 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); |
7468 a1.uFacing = LOWORD(v715.uYawAngle); | 7445 a1.uFacing = LOWORD(v715.uYawAngle); |
7469 LOWORD(v604) = LOWORD(v3->field_10); | 7446 LOWORD(v604) = LOWORD(v3->field_10); |
7470 LOBYTE(a1.uAttributes) |= 0x80u; | 7447 LOBYTE(a1.uAttributes) |= 0x80u; |
7471 a1.uSoundID = v604; | 7448 a1.uSoundID = v604; |
7472 a1.Create(0, v1, v1, v3->uPlayerID + 1); | 7449 a1.Create(0, 0, 0, v3->uPlayerID + 1); |
7473 goto LABEL_1056; | 7450 goto LABEL_1056; |
7474 case 96: | 7451 case 96: |
7475 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 7452 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
7476 goto LABEL_83; | 7453 goto LABEL_83; |
7477 HIDWORD(v733) = v1; | 7454 HIDWORD(v733) = 0; |
7478 memset(&pStru179, v1, 0xFA0u); | 7455 memset(&pStru179, 0, 0xFA0u); |
7479 _this = (ItemGen *)v1; | 7456 _this = 0; |
7480 v605 = (char *)pParty->pHirelings; | 7457 v605 = (char *)pParty->pHirelings; |
7481 do | 7458 do |
7482 { | 7459 { |
7483 if ( *(int *)v605 != v1 ) | 7460 if ( *(int *)v605) |
7484 { | 7461 { |
7485 v606 = HIDWORD(v733)++; | 7462 v606 = HIDWORD(v733)++; |
7486 pStru179.field_0[v606] = (int)((char *)&_this->uItemID + 1); | 7463 pStru179.field_0[v606] = (int)((char *)&_this->uItemID + 1); |
7487 } | 7464 } |
7488 _this = (ItemGen *)((char *)_this + 1); | 7465 _this = (ItemGen *)((char *)_this + 1); |
7489 v605 += 76; | 7466 v605 += 76; |
7490 } | 7467 } |
7491 while ( (signed int)v605 < (signed int)&pParty->pPickedItem ); | 7468 while ( (signed int)v605 < (signed int)&pParty->pPickedItem ); |
7492 _this = (ItemGen *)v1; | 7469 _this = 0; |
7493 if ( (signed int)pNPCStats->uNumNewNPCs > v1 ) | 7470 if ( (signed int)pNPCStats->uNumNewNPCs > 0) |
7494 { | 7471 { |
7495 v730 = (int)pNPCStats->pNewNPCData; | 7472 v730 = (int)pNPCStats->pNewNPCData; |
7496 HIDWORD(v733) = 4 * HIDWORD(v733) + 6043152; | 7473 HIDWORD(v733) = 4 * HIDWORD(v733) + 6043152; |
7497 do | 7474 do |
7498 { | 7475 { |
7499 if ( *(char *)(v730 + 8) & 0x80 | 7476 if ( *(char *)(v730 + 8) & 0x80 |
7500 && (pParty->pHirelings[0].pName == (char *)v1 || strcmp(*(const char **)v730, pParty->pHirelings[0].pName)) | 7477 && (!pParty->pHirelings[0].pName || strcmp(*(const char **)v730, pParty->pHirelings[0].pName)) |
7501 && (pParty->pHirelings[1].pName == (char *)v1 || strcmp(*(const char **)v730, pParty->pHirelings[1].pName)) ) | 7478 && (!pParty->pHirelings[1].pName || strcmp(*(const char **)v730, pParty->pHirelings[1].pName)) ) |
7502 { | 7479 { |
7503 v607 = HIDWORD(v733); | 7480 v607 = HIDWORD(v733); |
7504 HIDWORD(v733) += 4; | 7481 HIDWORD(v733) += 4; |
7505 *(int *)v607 = (int)_this + 3; | 7482 *(int *)v607 = (int)_this + 3; |
7506 } | 7483 } |
7509 } | 7486 } |
7510 while ( (signed int)this < (signed int)pNPCStats->uNumNewNPCs ); | 7487 while ( (signed int)this < (signed int)pNPCStats->uNumNewNPCs ); |
7511 } | 7488 } |
7512 v608 = v3->uPlayerID_2; | 7489 v608 = v3->uPlayerID_2; |
7513 if ( v608 != 4 && v608 != 5 | 7490 if ( v608 != 4 && v608 != 5 |
7514 || (v609 = (signed int)*(&pFontCChar + v608 + (unsigned __int8)pParty->field_709), v609 <= v1) | 7491 || (v609 = (signed int)*(&pFontCChar + v608 + (unsigned __int8)pParty->field_709), v609 <= 0) |
7515 || v609 >= 3 ) | 7492 || v609 >= 3 ) |
7516 goto LABEL_200; | 7493 goto LABEL_200; |
7517 v610 = 76 * v609; | 7494 v610 = 76 * v609; |
7518 *((int *)&pParty->pPlayers[3].pInstalledBeacons[4].uBeaconTime + 19 * v609) = v1; | 7495 *((int *)&pParty->pPlayers[3].pInstalledBeacons[4].uBeaconTime + 19 * v609) = 0; |
7519 v611 = pIconsFrameTable->FindIcon("spell96"); | 7496 v611 = pIconsFrameTable->FindIcon("spell96"); |
7520 *(int *)((char *)&pParty->pPlayers[3].pInstalledBeacons[4].uBeaconTime + v610 + 4) = pIconsFrameTable->GetIconAnimLength( | 7497 *(int *)((char *)&pParty->pPlayers[3].pInstalledBeacons[4].uBeaconTime + v610 + 4) = pIconsFrameTable->GetIconAnimLength( |
7521 v611); | 7498 v611); |
7522 v232 = 1; | 7499 v232 = 1; |
7523 *(int *)((char *)&pParty->pPlayers[3].pInstalledBeacons[3].field_18 + v610) = 1; | 7500 *(int *)((char *)&pParty->pPlayers[3].pInstalledBeacons[3].field_18 + v610) = 1; |
7536 if ( v613->uReputation > 10000 ) | 7513 if ( v613->uReputation > 10000 ) |
7537 v613->uReputation = 10000; | 7514 v613->uReputation = 10000; |
7538 LODWORD(v727) = v232; | 7515 LODWORD(v727) = v232; |
7539 goto LABEL_83; | 7516 goto LABEL_83; |
7540 case 95: | 7517 case 95: |
7541 if ( v12 <= v1 ) | 7518 if ( v12 <= 0 ) |
7542 goto LABEL_1119; | 7519 goto LABEL_1119; |
7543 if ( v12 <= 3 ) | 7520 if ( v12 <= 3 ) |
7544 { | 7521 { |
7545 v614 = 300 * (v2 + 12); | 7522 v614 = 300 * (v2 + 12); |
7546 } | 7523 } |
7560 { | 7537 { |
7561 v616 = v3->uPlayerID_2; | 7538 v616 = v3->uPlayerID_2; |
7562 v617 = v3->spellnum; | 7539 v617 = v3->spellnum; |
7563 v618 = pGame->GetStru6(); | 7540 v618 = pGame->GetStru6(); |
7564 pGame->GetStru6()->SetPlayerBuffAnim(v617, v616); | 7541 pGame->GetStru6()->SetPlayerBuffAnim(v617, v616); |
7565 v668 = v1; | 7542 v668 = 0; |
7566 v658 = v716; | 7543 v658 = v716; |
7567 v732 = (int)v733 << 7; | 7544 v732 = (int)v733 << 7; |
7568 v653 = v615; | 7545 v653 = v615; |
7569 v651 = v731; | 7546 v651 = v731; |
7570 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | 7547 v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); |
7571 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[10]; | 7548 v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[10]; |
7572 goto LABEL_103; | 7549 goto LABEL_103; |
7573 } | 7550 } |
7574 a2 = v1; | 7551 a2 = 0; |
7575 v732 = (int)v733 << 7; | 7552 v732 = (int)v733 << 7; |
7576 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | 7553 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); |
7577 v619 = pParty->pPlayers;//[0].pPlayerBuffs[10]; | 7554 v619 = pParty->pPlayers;//[0].pPlayerBuffs[10]; |
7578 do | 7555 do |
7579 { | 7556 { |
7580 v620 = a2; | 7557 v620 = a2; |
7581 v621 = v3->spellnum; | 7558 v621 = v3->spellnum; |
7582 v622 = pGame->GetStru6(); | 7559 v622 = pGame->GetStru6(); |
7583 pGame->GetStru6()->SetPlayerBuffAnim(v621, v620); | 7560 pGame->GetStru6()->SetPlayerBuffAnim(v621, v620); |
7584 v619->pPlayerBuffs[10].Apply(pParty->uTimePlayed + v717, v731, amount, v716, v1); | 7561 v619->pPlayerBuffs[10].Apply(pParty->uTimePlayed + v717, v731, amount, v716, 0); |
7585 ++a2; | 7562 ++a2; |
7586 ++v619; | 7563 ++v619; |
7587 } | 7564 } |
7588 while ( v619 <= &pParty->pPlayers[3] ); | 7565 while ( v619 <= &pParty->pPlayers[3] ); |
7589 goto LABEL_1056; | 7566 goto LABEL_1056; |
7590 case 99: | 7567 case 99: |
7591 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 7568 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
7592 goto LABEL_83; | 7569 goto LABEL_83; |
7593 v726 = (Player *)v1; | 7570 v726 = 0; |
7594 pGame->GetIndoorCamera(); | 7571 pGame->GetIndoorCamera(); |
7595 v623 = (signed __int64)GetPickDepth(); | 7572 v623 = (signed __int64)GetPickDepth(); |
7596 HIDWORD(v733) = sub_46A6AC((int)dword_50BF30, 100, v623); | 7573 HIDWORD(v733) = sub_46A6AC((int)dword_50BF30, 100, v623); |
7597 v709 = v1; | 7574 v709 = 0; |
7598 v708 = v1; | 7575 v708 = 0; |
7599 v707 = v1; | 7576 v707 = 0; |
7600 a1.stru_24.Reset(); | 7577 a1.stru_24.Reset(); |
7601 a1.field_48 = v3->spellnum; | 7578 a1.field_48 = v3->spellnum; |
7602 a1.field_4C = v2; | 7579 a1.field_4C = v2; |
7603 a1.field_50 = v731; | 7580 a1.field_50 = v731; |
7604 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); | 7581 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType); |
7605 a1.uAttributes = v1; | 7582 a1.uAttributes = 0; |
7606 a1.uSectorID = v1; | 7583 a1.uSectorID = 0; |
7607 a1.uSpriteFrameID = v1; | 7584 a1.uSpriteFrameID = 0; |
7608 v624 = v3->uPlayerID; | 7585 v624 = v3->uPlayerID; |
7609 a1.field_60_distance_related_prolly_lod = 0; | 7586 a1.field_60_distance_related_prolly_lod = 0; |
7610 a1.uFacing = v1; | 7587 a1.uFacing = 0; |
7611 v624 *= 8; | 7588 v624 *= 8; |
7612 LOBYTE(v624) = v624 | OBJECT_Player; | 7589 LOBYTE(v624) = v624 | OBJECT_Player; |
7613 a1.field_58_pid = v624; | 7590 a1.field_58_pid = v624; |
7614 a1.uSoundID = LOWORD(v3->field_10); | 7591 a1.uSoundID = LOWORD(v3->field_10); |
7615 a2 = v1; | 7592 a2 = 0; |
7616 if ( SHIDWORD(v733) > v1 ) | 7593 if ( SHIDWORD(v733) > 0 ) |
7617 { | 7594 { |
7618 v726 = (Player *)(HIDWORD(v733) * (7 * v2 + 25)); | 7595 v726 = (Player *)(HIDWORD(v733) * (7 * v2 + 25)); |
7619 do | 7596 do |
7620 { | 7597 { |
7621 v625 = dword_50BF30[a2]; | 7598 v625 = dword_50BF30[a2]; |
7622 a1.vPosition.x = pActors[v625].vPosition.x; | 7599 a1.vPosition.x = pActors[v625].vPosition.x; |
7623 a1.vPosition.y = pActors[v625].vPosition.y; | 7600 a1.vPosition.y = pActors[v625].vPosition.y; |
7624 v732 = pActors[v625].uActorHeight; | 7601 v732 = pActors[v625].uActorHeight; |
7625 a1.vPosition.z = pActors[v625].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | 7602 a1.vPosition.z = pActors[v625].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); |
7626 v626 = 8 * dword_50BF30[a2]; | 7603 v626 = 8 * dword_50BF30[a2]; |
7627 LOBYTE(v626) = v626 | 3; | 7604 LOBYTE(v626) = v626 | OBJECT_Actor; |
7628 a1.field_5C = v626; | 7605 a1.field_5C = v626; |
7629 v627 = a1.Create(0, v1, v1, v1); | 7606 v627 = a1.Create(0, 0, 0, 0); |
7630 v628 = a2; | 7607 v628 = a2; |
7631 DamageMonsterFromParty(8 * v627 | 2, dword_50BF30[a2], (Vec3_int_ *)&v707); | 7608 DamageMonsterFromParty(8 * v627 | 2, dword_50BF30[a2], (Vec3_int_ *)&v707); |
7632 a2 = v628 + 1; | 7609 a2 = v628 + 1; |
7633 } | 7610 } |
7634 while ( v628 + 1 < SHIDWORD(v733) ); | 7611 while ( v628 + 1 < SHIDWORD(v733) ); |
7635 } | 7612 } |
7636 v730 = v1; | 7613 v730 = 0; |
7637 v629 = 1; | 7614 v629 = 1; |
7638 do | 7615 do |
7639 { | 7616 { |
7640 v630 = pPlayers[v629]; | 7617 v630 = pPlayers[v629]; |
7641 if ( !v630->pConditions[2] | 7618 if ( !v630->pConditions[2] |
7650 } | 7627 } |
7651 ++v629; | 7628 ++v629; |
7652 } | 7629 } |
7653 while ( v629 <= 4 ); | 7630 while ( v629 <= 4 ); |
7654 v732 = (signed __int64)((double)(signed int)v726 / (double)v730); | 7631 v732 = (signed __int64)((double)(signed int)v726 / (double)v730); |
7655 HIDWORD(v733) = v1; | 7632 HIDWORD(v733) = 0; |
7656 if ( v730 > v1 ) | 7633 if ( v730 > 0 ) |
7657 { | 7634 { |
7658 do | 7635 do |
7659 { | 7636 { |
7660 v632 = 4 * v681[HIDWORD(v733)] + 10965188; | 7637 v632 = 4 * v681[HIDWORD(v733)] + 10965188; |
7661 v633 = pPlayers[v681[HIDWORD(v733)]]; | 7638 v633 = pPlayers[v681[HIDWORD(v733)]]; |
7672 HIDWORD(v733) = v635 + 1; | 7649 HIDWORD(v733) = v635 + 1; |
7673 } | 7650 } |
7674 while ( v635 + 1 < v730 ); | 7651 while ( v635 + 1 < v730 ); |
7675 } | 7652 } |
7676 v639 = pGame->GetStru6(); | 7653 v639 = pGame->GetStru6(); |
7677 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(v1, 0x40u); | 7654 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0, 0x40u); |
7678 goto LABEL_1056; | 7655 goto LABEL_1056; |
7679 case 98: | 7656 case 98: |
7680 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | 7657 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) |
7681 { | 7658 { |
7682 v66 = pGlobalTXT_LocalizationStrings[499]; | 7659 v66 = pGlobalTXT_LocalizationStrings[499]; |
7683 goto LABEL_201; | 7660 goto LABEL_201; |
7684 } | 7661 } |
7685 v640 = v12 - 2; | 7662 v640 = v12 - 2; |
7686 if ( !v640 || (v641 = v640 - 1) == 0 || (amount = 4, v641 != 1) ) | 7663 if ( !v640 || (v641 = v640 - 1) == 0 || (amount = 4, v641 != 1) ) |
7687 amount = 3; | 7664 amount = 3; |
7688 if ( pPlayer->uNumArmageddonCasts >= amount || pParty->armageddon_timer > v1 ) | 7665 if ( pPlayer->uNumArmageddonCasts >= amount || pParty->armageddon_timer > 0 ) |
7689 goto LABEL_200; | 7666 goto LABEL_200; |
7690 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 7667 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
7691 goto LABEL_83; | 7668 goto LABEL_83; |
7692 pParty->armageddon_timer = 256; | 7669 pParty->armageddon_timer = 256; |
7693 pParty->field_16140 = v2; | 7670 pParty->field_16140 = v2; |
7699 { | 7676 { |
7700 v642 = rand() % 4096 - 2048; | 7677 v642 = rand() % 4096 - 2048; |
7701 v643 = rand(); | 7678 v643 = rand(); |
7702 v721 = v642 + pParty->vPosition.x; | 7679 v721 = v642 + pParty->vPosition.x; |
7703 y = (char *)(pParty->vPosition.y + v643 % 4096 - 2048); | 7680 y = (char *)(pParty->vPosition.y + v643 % 4096 - 2048); |
7704 v732 = GetTerrainHeightsAroundParty2(v642 + pParty->vPosition.x, (int)y, (int *)&v710, v1); | 7681 v732 = GetTerrainHeightsAroundParty2(v642 + pParty->vPosition.x, (int)y, (int *)&v710, 0); |
7705 v644 = rand(); | 7682 v644 = rand(); |
7706 sub_42F7EB_DropItemAt(0xFE6u, v721, (int)y, v732 + 16, v644 % 500 + 500, 1, v1, v1, (ItemGen *)v1); | 7683 sub_42F7EB_DropItemAt(0xFE6u, v721, (int)y, v732 + 16, v644 % 500 + 500, 1, 0, 0, 0); |
7707 v726 = (Player *)((char *)v726 - 1); | 7684 v726 = (Player *)((char *)v726 - 1); |
7708 } | 7685 } |
7709 while ( *(float *)&v726 != 0.0 ); | 7686 while ( *(float *)&v726 != 0.0 ); |
7710 goto LABEL_1056; | 7687 goto LABEL_1056; |
7711 default: | 7688 default: |
7715 { | 7692 { |
7716 if ( v731 == 4 ) | 7693 if ( v731 == 4 ) |
7717 { | 7694 { |
7718 if ( *((_QWORD *)v222 + 2) ) | 7695 if ( *((_QWORD *)v222 + 2) ) |
7719 { | 7696 { |
7720 *((int *)v222 + 4) = v1; | 7697 *((int *)v222 + 4) = 0; |
7721 *((int *)v222 + 5) = v1; | 7698 *((int *)v222 + 5) = 0; |
7722 goto LABEL_439; | 7699 goto LABEL_439; |
7723 } | 7700 } |
7724 } | 7701 } |
7725 else | 7702 else |
7726 { | 7703 { |
7729 2u, | 7706 2u, |
7730 pParty->uTimePlayed - (signed int)(signed __int64)((double)(amount << 7) * 0.033333335)); | 7707 pParty->uTimePlayed - (signed int)(signed __int64)((double)(amount << 7) * 0.033333335)); |
7731 v222 = (char *)HIDWORD(v733); | 7708 v222 = (char *)HIDWORD(v733); |
7732 if ( v223 ) | 7709 if ( v223 ) |
7733 LABEL_439: | 7710 LABEL_439: |
7734 ((Player *)v222)->PlaySound(SPEECH_103, v1); | 7711 ((Player *)v222)->PlaySound(SPEECH_103, 0); |
7735 } | 7712 } |
7736 v222 += 6972; | 7713 v222 += 6972; |
7737 HIDWORD(v733) = (int)v222; | 7714 HIDWORD(v733) = (int)v222; |
7738 if ( (signed int)v222 >= (signed int)pParty->pHirelings ) | 7715 if ( (signed int)v222 >= (signed int)pParty->pHirelings ) |
7739 goto LABEL_1056; | 7716 goto LABEL_1056; |
7740 continue; | 7717 continue; |
7741 } | 7718 } |
7742 } | 7719 } |
7743 if ( pParty->bTurnBasedModeOn == v1 ) | 7720 if ( pParty->bTurnBasedModeOn == 0 ) |
7744 { | 7721 { |
7745 v646 = pPlayer; | 7722 v646 = pPlayer; |
7746 pPlayer->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * 213.3333333333333)); | 7723 pPlayer->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * 213.3333333333333)); |
7747 v647 = n; | 7724 v647 = n; |
7748 } | 7725 } |
7755 pParty->pTurnBasedPlayerRecoveryTimes[v711[n].uPlayerID] = 100; | 7732 pParty->pTurnBasedPlayerRecoveryTimes[v711[n].uPlayerID] = 100; |
7756 v649->SetRecoveryTime(v648); | 7733 v649->SetRecoveryTime(v648); |
7757 pTurnEngine->_40471C(); | 7734 pTurnEngine->_40471C(); |
7758 } | 7735 } |
7759 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); | 7736 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); |
7760 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, v1, v1, -1, v1, v1, v1, v1); | 7737 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
7761 v711[v647].spellnum = v1; | 7738 v711[v647].spellnum = 0; |
7762 v646->sMana -= uRequiredMana; | 7739 v646->sMana -= uRequiredMana; |
7763 } | 7740 } |
7764 //----- (0042EB42) -------------------------------------------------------- | 7741 //----- (0042EB42) -------------------------------------------------------- |
7765 __int16 ObjectList::ObjectIDByItemID(unsigned __int16 uItemID) | 7742 __int16 ObjectList::ObjectIDByItemID(unsigned __int16 uItemID) |
7766 { | 7743 { |
8936 else | 8913 else |
8937 pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; | 8914 pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; |
8938 } | 8915 } |
8939 | 8916 |
8940 //pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; | 8917 //pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; |
8941 LABEL_6: | 8918 //LABEL_6: |
8942 if ( !pEventTimer->bPaused ) | 8919 if ( !pEventTimer->bPaused ) |
8943 { | 8920 { |
8944 inputAction = (InputAction)0; | 8921 inputAction = (InputAction)0; |
8945 pActionQueue = pPartyActionQueue; | 8922 pActionQueue = pPartyActionQueue; |
8946 while ( 1 ) | 8923 while ( 1 ) |