Mercurial > mm7
comparison Actor.cpp @ 1858:d7c028a6a084
Actor::AI_SpellAttack removing unnecessary temporary vars
author | Grumpy7 |
---|---|
date | Mon, 14 Oct 2013 02:12:01 +0200 |
parents | f357e4cbd169 |
children | f135ff4decbb |
comparison
equal
deleted
inserted
replaced
1857:f357e4cbd169 | 1858:d7c028a6a084 |
---|---|
204 { | 204 { |
205 Actor *v5; // esi@1 | 205 Actor *v5; // esi@1 |
206 unsigned int realPoints; // edi@1 | 206 unsigned int realPoints; // edi@1 |
207 unsigned int masteryLevel; // eax@1 | 207 unsigned int masteryLevel; // eax@1 |
208 int v8; // edi@16 | 208 int v8; // edi@16 |
209 int v9; // edi@17 | |
210 signed int v10; // ecx@22 | 209 signed int v10; // ecx@22 |
211 signed int v11; // eax@29 | |
212 __int16 *v12; // edi@30 | |
213 int v13; // ecx@34 | |
214 int v14; // edx@34 | |
215 int v15; // eax@34 | |
216 AIDirection *v16; // esi@34 | |
217 unsigned __int16 v17; // di@34 | |
218 //int v18; // eax@34 | |
219 int v19; // edi@34 | 210 int v19; // edi@34 |
220 int v20; // eax@35 | 211 int v20; // eax@35 |
221 int v21; // eax@39 | |
222 SoundID v22; // eax@39 | |
223 signed int v23; // eax@41 | 212 signed int v23; // eax@41 |
224 double v24; // st7@49 | |
225 float v25; // ST5C_4@50 | |
226 int v26; // eax@50 | |
227 double v27; // st7@50 | |
228 double v28; // st6@50 | 213 double v28; // st6@50 |
229 float v29; // ST4C_4@51 | |
230 int v30; // esi@50 | 214 int v30; // esi@50 |
231 int v31; // ST3C_4@51 | 215 int v31; // ST3C_4@51 |
232 unsigned int v32; // edi@51 | 216 unsigned int v32; // edi@51 |
233 char *v33; // eax@54 | |
234 unsigned __int16 v34; // ax@57 | |
235 signed int v35; // ecx@58 | |
236 signed int v36; // eax@67 | 217 signed int v36; // eax@67 |
237 signed int v37; // eax@68 | |
238 signed __int64 v38; // qtt@69 | |
239 int v39; // ecx@75 | 218 int v39; // ecx@75 |
240 int v40; // eax@79 | |
241 int v41; // ecx@90 | |
242 int v42; // ecx@91 | 219 int v42; // ecx@91 |
243 int v43; // eax@95 | |
244 int v44; // ecx@100 | 220 int v44; // ecx@100 |
245 int v45; // ecx@101 | |
246 int v46; // eax@105 | |
247 int v48; // ecx@110 | 221 int v48; // ecx@110 |
248 char v49; // zf@123 | |
249 int v50; // eax@127 | |
250 int v51; // ecx@130 | 222 int v51; // ecx@130 |
251 int v52; // eax@132 | |
252 int v53; // ecx@137 | |
253 int v54; // ecx@138 | 223 int v54; // ecx@138 |
254 int v55; // eax@142 | |
255 SpellBuff *v56; // esi@143 | |
256 Player *v57; // esi@145 | 224 Player *v57; // esi@145 |
257 int v58; // eax@146 | 225 int v58; // eax@146 |
258 int v59; // edi@146 | 226 int v59; // edi@146 |
259 int v60; // eax@146 | 227 int v60; // eax@146 |
260 int v61; // edi@146 | 228 int v61; // edi@146 |
261 int v62; // eax@146 | 229 int v62; // eax@146 |
262 signed int v63; // edi@146 | 230 signed int v63; // edi@146 |
263 signed int v64; // edi@147 | |
264 int v65; // eax@151 | |
265 char *v66; // eax@160 | |
266 int v67; // edi@167 | |
267 int v68; // edi@168 | 231 int v68; // edi@168 |
268 int v69; // eax@171 | |
269 signed int v70; // ecx@172 | 232 signed int v70; // ecx@172 |
270 signed int v71; // eax@179 | |
271 __int16 *v72; // edi@180 | |
272 int v73; // ecx@184 | |
273 int v74; // edx@184 | |
274 int v75; // eax@184 | |
275 AIDirection *v76; // esi@184 | |
276 unsigned __int16 v77; // di@184 | |
277 //int v78; // eax@184 | |
278 int v79; // edx@185 | 233 int v79; // edx@185 |
279 int v80; // eax@185 | 234 int v80; // eax@185 |
280 int v81; // eax@189 | |
281 unsigned __int16 v82; // ax@190 | |
282 int v83; // ecx@192 | |
283 int v84; // edx@192 | |
284 int v85; // eax@192 | |
285 AIDirection *v86; // esi@192 | |
286 unsigned __int16 v87; // di@192 | |
287 __int16 v88; // ax@192 | |
288 signed int v89; // ecx@192 | 235 signed int v89; // ecx@192 |
289 //int v90; // eax@192 | |
290 signed int v91; // eax@200 | 236 signed int v91; // eax@200 |
291 int v92; // eax@201 | |
292 int v93; // ecx@207 | |
293 int v94; // ecx@208 | 237 int v94; // ecx@208 |
294 int v95; // eax@212 | |
295 int v96; // ecx@217 | 238 int v96; // ecx@217 |
296 int v97; // eax@221 | |
297 SoundID v98; // [sp-18h] [bp-E8h]@79 | |
298 signed int v99; // [sp-14h] [bp-E4h]@39 | |
299 signed int v105; // [sp+4h] [bp-CCh]@23 | |
300 signed int v107; // [sp+4h] [bp-CCh]@42 | |
301 signed int v108; // [sp+4h] [bp-CCh]@173 | |
302 int pitch; // [sp+2Ch] [bp-A4h]@51 | 239 int pitch; // [sp+2Ch] [bp-A4h]@51 |
303 float v110; // [sp+30h] [bp-A0h]@50 | |
304 int v111; // [sp+38h] [bp-98h]@41 | 240 int v111; // [sp+38h] [bp-98h]@41 |
305 float v112; // [sp+3Ch] [bp-94h]@49 | |
306 int v113; // [sp+40h] [bp-90h]@41 | 241 int v113; // [sp+40h] [bp-90h]@41 |
307 int v114; // [sp+48h] [bp-88h]@41 | 242 int v114; // [sp+48h] [bp-88h]@41 |
308 SpriteObject a1; // [sp+4Ch] [bp-84h]@1 | 243 SpriteObject a1; // [sp+4Ch] [bp-84h]@1 |
309 int v116; // [sp+BCh] [bp-14h]@49 | 244 int v116; // [sp+BCh] [bp-14h]@49 |
310 AIDirection *v117; // [sp+C0h] [bp-10h]@1 | |
311 int v118; // [sp+C4h] [bp-Ch]@29 | 245 int v118; // [sp+C4h] [bp-Ch]@29 |
312 float v119; // [sp+C8h] [bp-8h]@48 | 246 float v119; // [sp+C8h] [bp-8h]@48 |
313 float v120; // [sp+CCh] [bp-4h]@1 | 247 float v120; // [sp+CCh] [bp-4h]@1 |
314 int spellnuma; // [sp+D8h] [bp+8h]@29 | 248 int spellnuma; // [sp+D8h] [bp+8h]@29 |
315 int spellnumb; // [sp+D8h] [bp+8h]@48 | 249 int spellnumb; // [sp+D8h] [bp+8h]@48 |
316 float spellnumc; // [sp+D8h] [bp+8h]@50 | 250 float spellnumc; // [sp+D8h] [bp+8h]@50 |
317 signed int spellnumd; // [sp+D8h] [bp+8h]@53 | |
318 int spellnume; // [sp+D8h] [bp+8h]@179 | 251 int spellnume; // [sp+D8h] [bp+8h]@179 |
319 int a1a; // [sp+E0h] [bp+10h]@34 | 252 int a1a; // [sp+E0h] [bp+10h]@34 |
320 signed int a1b; // [sp+E0h] [bp+10h]@145 | |
321 int a1c; // [sp+E0h] [bp+10h]@184 | 253 int a1c; // [sp+E0h] [bp+10h]@184 |
322 | 254 |
323 | 255 |
324 LODWORD(v120) = uActorID; | 256 LODWORD(v120) = uActorID; |
325 v5 = &pActors[uActorID]; | 257 v5 = &pActors[uActorID]; |
326 v117 = pDir; | |
327 realPoints = uSkillLevel & 0x3F; | 258 realPoints = uSkillLevel & 0x3F; |
328 masteryLevel = SkillToMastery(uSkillLevel); | 259 masteryLevel = SkillToMastery(uSkillLevel); |
329 | 260 |
330 switch (uSpellID) | 261 switch (uSpellID) |
331 { | 262 { |
342 case 70: | 273 case 70: |
343 case 78: | 274 case 78: |
344 case 90: | 275 case 90: |
345 case 97: | 276 case 97: |
346 a1.uType = stru_4E3ACC[uSpellID].uType; | 277 a1.uType = stru_4E3ACC[uSpellID].uType; |
347 v119 = 0.0; | 278 a1.uObjectDescID = 0; |
348 v82 = 0; | |
349 for (int i = 0; i < pObjectList->uNumObjects; i++) | 279 for (int i = 0; i < pObjectList->uNumObjects; i++) |
350 { | 280 { |
351 if (a1.uType == pObjectList->pObjects[i].uObjectID) | 281 if (a1.uType == pObjectList->pObjects[i].uObjectID) |
352 { | 282 { |
353 v82 = i; | 283 a1.uObjectDescID = i; |
354 break; | 284 break; |
355 } | 285 } |
356 } | 286 } |
357 a1.uObjectDescID = v82; | |
358 a1.stru_24.Reset(); | 287 a1.stru_24.Reset(); |
359 a1.spell_id = uSpellID; | 288 a1.spell_id = uSpellID; |
360 v83 = v5->vPosition.x; | |
361 v84 = v5->vPosition.y; | |
362 a1.spell_level = uSkillLevel; | 289 a1.spell_level = uSkillLevel; |
363 a1.vPosition.x = v83; | 290 a1.vPosition.x = v5->vPosition.x; |
364 v85 = v5->vPosition.z + ((signed int)v5->uActorHeight >> 1); | |
365 v86 = v117; | |
366 v87 = LOWORD(v117->uYawAngle); | |
367 a1.spell_skill = 0; | 291 a1.spell_skill = 0; |
368 a1.vPosition.y = v84; | 292 a1.vPosition.y = v5->vPosition.y; |
369 a1.vPosition.z = v85; | 293 a1.vPosition.z = v5->vPosition.z + ((signed int)v5->uActorHeight >> 1); |
370 a1.uFacing = v87; | 294 a1.uFacing = LOWORD(pDir->uYawAngle); |
371 a1.uSoundID = 0; | 295 a1.uSoundID = 0; |
372 a1.uAttributes = 0; | 296 a1.uAttributes = 0; |
373 v88 = pIndoor->GetSector(v83, v84, v85); | 297 v89 = pDir->uDistance; |
374 v89 = v86->uDistance; | 298 a1.uSectorID = pIndoor->GetSector(a1.vPosition.x, a1.vPosition.y, a1.vPosition.z); |
375 a1.uSectorID = v88; | |
376 LODWORD(v119) = v89; | |
377 a1.uSpriteFrameID = 0; | 299 a1.uSpriteFrameID = 0; |
378 a1.spell_caster_pid = PID(OBJECT_Actor, LODWORD(v120)); | 300 a1.spell_caster_pid = PID(OBJECT_Actor, uActorID); |
379 a1.spell_target_pid = 0; | 301 a1.spell_target_pid = 0; |
380 if ((double)v89 < 307.2 ) | 302 if ((double)v89 < 307.2 ) |
381 a1.field_60_distance_related_prolly_lod = 0; | 303 a1.field_60_distance_related_prolly_lod = 0; |
382 else if ( v89 < 1024 ) | 304 else if ( v89 < 1024 ) |
383 a1.field_60_distance_related_prolly_lod = 1; | 305 a1.field_60_distance_related_prolly_lod = 1; |
386 else | 308 else |
387 a1.field_60_distance_related_prolly_lod = 3; | 309 a1.field_60_distance_related_prolly_lod = 3; |
388 | 310 |
389 a1.field_61 = 2; | 311 a1.field_61 = 2; |
390 v91 = a1.Create( | 312 v91 = a1.Create( |
391 v86->uYawAngle, | 313 pDir->uYawAngle, |
392 v86->uPitchAngle, | 314 pDir->uPitchAngle, |
393 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | 315 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, |
394 0); | 316 0); |
395 if ( v91 != -1 ) | 317 if ( v91 != -1 ) |
396 { | 318 { |
397 v92 = 8 * v91; | 319 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], PID(OBJECT_Item, v91), 0, -1, 0, 0, 0, 0); |
398 LOBYTE(v92) = v92 | 2; | |
399 v99 = v92; | |
400 v22 = (SoundID)word_4EE088_sound_ids[uSpellID]; | |
401 v98 = v22; | |
402 pAudioPlayer->PlaySound(v98, v99, 0, -1, 0, 0, 0, 0); | |
403 return; | 320 return; |
404 } | 321 } |
405 return; | 322 return; |
406 break; | 323 break; |
407 | 324 |
408 | 325 case 5: |
409 case 5: | 326 if (masteryLevel == 1 || masteryLevel == 2) |
410 if (masteryLevel == 0) | 327 v39 = 60 * (realPoints + 60); |
411 { | 328 else if (masteryLevel == 3 ) |
329 v39 = 180 * (realPoints + 20); | |
330 else if (masteryLevel == 4 ) | |
331 v39 = 240 * (realPoints + 15); | |
332 else | |
412 v39 = 0; | 333 v39 = 0; |
413 } | |
414 else if (masteryLevel == 1 || masteryLevel == 2) | |
415 { | |
416 v39 = 60 * (realPoints + 60); | |
417 } | |
418 else if (masteryLevel == 3 ) | |
419 { | |
420 v39 = 180 * (realPoints + 20); | |
421 } | |
422 else if (masteryLevel == 4 ) | |
423 { | |
424 v39 = 240 * (realPoints + 15); | |
425 } | |
426 v5->pActorBuffs[19].Apply( | 334 v5->pActorBuffs[19].Apply( |
427 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v39 << 7) * 0.033333335), | 335 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v39 << 7) * 0.033333335), |
428 masteryLevel, | 336 masteryLevel, |
429 0, | 337 0, |
430 0, | 338 0, |
431 0); | 339 0); |
432 pGame->pStru6Instance->_4A7E89_sparkles_on_actor_after_it_casts_buff(v5, 0xFF3C1Eu); | 340 pGame->pStru6Instance->_4A7E89_sparkles_on_actor_after_it_casts_buff(v5, 0xFF3C1Eu); |
433 v40 = 8 * LODWORD(v120); | 341 pAudioPlayer->PlaySound((SoundID)10040, PID(OBJECT_Actor, uActorID), 0, -1, 0, 0, 0, 0); |
434 LOBYTE(v40) = PID(OBJECT_Actor,LOBYTE(v120)); | |
435 v99 = v40; | |
436 v98 = (SoundID)10040; | |
437 pAudioPlayer->PlaySound(v98, v99, 0, -1, 0, 0, 0, 0); | |
438 return; | 342 return; |
439 | 343 |
440 case 9: | 344 case 9: |
441 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) | 345 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) |
442 return; | 346 return; |
449 v23 = 10; | 353 v23 = 10; |
450 else if (masteryLevel == 3) | 354 else if (masteryLevel == 3) |
451 v23 = 12; | 355 v23 = 12; |
452 else if (masteryLevel == 4) | 356 else if (masteryLevel == 4) |
453 v23 = 14; | 357 v23 = 14; |
454 v119 = 0.0; | |
455 spellnumb = 0; | 358 spellnumb = 0; |
456 if ( v23 > 0 ) | 359 for ( int i = 0; i < v23; i++) |
457 { | 360 { |
458 v24 = (double)v118; | 361 v28 = (double)spellnumb; |
459 v118 = v23; | 362 v30 = rand() % 1000; |
460 v112 = v24; | 363 spellnumc = v30 + pParty->vPosition.z - v114; |
461 v116 = PID(OBJECT_Actor,LODWORD(v120)); | 364 v120 = v28 * v28; |
462 do | 365 v119 = spellnumb * spellnumb; |
366 if ( sqrt(spellnumc * spellnumc + v119 + v120) <= 1.0 ) | |
463 { | 367 { |
464 v26 = rand(); | 368 v32 = 0; |
465 v27 = (double)spellnumb; | 369 pitch = 0; |
466 v110 = v27; | 370 } |
467 v28 = (double)SLODWORD(v119); | 371 else |
468 v30 = v26 % 1000; | 372 { |
469 v25 = (double)v114; | 373 v31 = (signed __int64)sqrt(v119 + v120); |
470 spellnumc = (double)(v26 % 1000) + v112 - v25; | 374 v32 = stru_5C6E00->Atan2(spellnumb, (int)v28); |
471 v120 = v28 * v28; | 375 pitch = stru_5C6E00->Atan2(v31, (int)spellnumc); |
472 v119 = v27 * v27; | 376 } |
473 if ( sqrt(spellnumc * spellnumc + v119 + v120) <= 1.0 ) | 377 a1.stru_24.Reset(); |
378 a1.uType = stru_4E3ACC[9].uType; | |
379 a1.uObjectDescID = 0; | |
380 for (int i = 0; i < pObjectList->uNumObjects; i++) | |
381 { | |
382 if (pObjectList->pObjects[i].uObjectID == a1.uType) | |
474 { | 383 { |
475 v32 = 0; | 384 a1.uObjectDescID = i; |
476 pitch = 0; | 385 break; |
477 } | 386 } |
478 else | |
479 { | |
480 v31 = (signed __int64)sqrt(v119 + v120); | |
481 v29 = v28; | |
482 v32 = stru_5C6E00->Atan2((signed __int64)v110, (signed __int64)v29); | |
483 pitch = stru_5C6E00->Atan2(v31, (signed __int64)spellnumc); | |
484 } | |
485 a1.stru_24.Reset(); | |
486 a1.uType = stru_4E3ACC[9].uType; | |
487 v34 = 0; | |
488 for (int i = 0; i < pObjectList->uNumObjects; i++) | |
489 { | |
490 if (pObjectList->pObjects[i].uObjectID == a1.uType) | |
491 { | |
492 v34 = i; | |
493 break; | |
494 } | |
495 } | |
496 a1.uObjectDescID = v34; | |
497 a1.spell_level = uSkillLevel; | |
498 a1.vPosition.x = v111; | |
499 a1.vPosition.y = v113; | |
500 a1.vPosition.z = v30 + v114; | |
501 a1.spell_id = SPELL_FIRE_METEOR_SHOWER; | |
502 a1.spell_skill = 0; | |
503 a1.uAttributes = 0; | |
504 a1.uSectorID = 0; | |
505 a1.uSpriteFrameID = 0; | |
506 a1.spell_caster_pid = v116; | |
507 a1.spell_target_pid = 0; | |
508 a1.field_60_distance_related_prolly_lod = stru_50C198._427546(v30 + 2500); | |
509 a1.uFacing = v32; | |
510 a1.uSoundID = 0; | |
511 v35 = v117->uDistance; | |
512 LODWORD(v119) = v117->uDistance; | |
513 if ((double)v119 < 307.2 ) | |
514 a1.field_60_distance_related_prolly_lod = 0; | |
515 else if ( v119 < 1024 ) | |
516 a1.field_60_distance_related_prolly_lod = 1; | |
517 else if ( v119 < 2560 ) | |
518 a1.field_60_distance_related_prolly_lod = 2; | |
519 else | |
520 a1.field_60_distance_related_prolly_lod = 3; | |
521 a1.field_61 = 2; | |
522 v36 = a1.Create( | |
523 v32, | |
524 pitch, | |
525 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
526 0); | |
527 if ( v36 != -1 ) | |
528 { | |
529 v37 = 8 * v36; | |
530 LOBYTE(v37) = v37 | 2; | |
531 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[9], v37, 0, -1, 0, 0, 0, 0); | |
532 } | |
533 spellnumb = rand() % 1024 - 512; | |
534 v38 = rand(); | |
535 v49 = v118-- == 1; | |
536 LODWORD(v119) = (unsigned __int64)(v38 % 1024) - 512; | |
537 } | 387 } |
538 while ( !v49 ); | 388 a1.spell_level = uSkillLevel; |
389 a1.vPosition.x = pParty->vPosition.x; | |
390 a1.vPosition.y = pParty->vPosition.y; | |
391 a1.vPosition.z = v30 + v114; | |
392 a1.spell_id = SPELL_FIRE_METEOR_SHOWER; | |
393 a1.spell_skill = 0; | |
394 a1.uAttributes = 0; | |
395 a1.uSectorID = 0; | |
396 a1.uSpriteFrameID = 0; | |
397 a1.spell_caster_pid = PID(OBJECT_Actor, uActorID); | |
398 a1.spell_target_pid = 0; | |
399 a1.field_60_distance_related_prolly_lod = stru_50C198._427546(v30 + 2500); | |
400 a1.uFacing = v32; | |
401 a1.uSoundID = 0; | |
402 if (pDir->uDistance < 307.2 ) | |
403 a1.field_60_distance_related_prolly_lod = 0; | |
404 else if ( pDir->uDistance < 1024 ) | |
405 a1.field_60_distance_related_prolly_lod = 1; | |
406 else if ( pDir->uDistance < 2560 ) | |
407 a1.field_60_distance_related_prolly_lod = 2; | |
408 else | |
409 a1.field_60_distance_related_prolly_lod = 3; | |
410 a1.field_61 = 2; | |
411 v36 = a1.Create( | |
412 v32, | |
413 pitch, | |
414 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
415 0); | |
416 if ( v36 != -1 ) | |
417 { | |
418 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[9], PID(OBJECT_Item, v36), 0, -1, 0, 0, 0, 0); | |
419 } | |
420 spellnumb = rand() % 1024 - 512; | |
539 } | 421 } |
540 return; | 422 return; |
541 break; | 423 break; |
542 | 424 |
543 case 15: | 425 case 15:if (masteryLevel == 2 ) |
544 if (masteryLevel <= 1) | |
545 v10 = 3; | |
546 else if (masteryLevel == 2 ) | |
547 v10 = 5; | 426 v10 = 5; |
548 else if (masteryLevel == 3 ) | 427 else if (masteryLevel == 3 ) |
549 v10 = 7; | 428 v10 = 7; |
550 else if (masteryLevel == 4 ) | 429 else if (masteryLevel == 4 ) |
551 v10 = 9; | 430 v10 = 9; |
431 else | |
432 v10 = 3; | |
552 spellnuma = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360; | 433 spellnuma = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360; |
553 a1.uType = stru_4E3ACC[15].uType; | 434 a1.uType = stru_4E3ACC[15].uType; |
554 v118 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (v10 - 1); | 435 v118 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (v10 - 1); |
555 v11 = 0; | 436 a1.uObjectDescID = 0; |
556 for (unsigned int i = 0; i < pObjectList->uNumObjects; i++) | 437 for (unsigned int i = 0; i < pObjectList->uNumObjects; i++) |
557 { | 438 { |
558 if (stru_4E3ACC[15].uType == pObjectList->pObjects[i].uObjectID) | 439 if (stru_4E3ACC[15].uType == pObjectList->pObjects[i].uObjectID) |
559 { | 440 { |
560 v11 = i; | 441 a1.uObjectDescID = i; |
561 break; | 442 break; |
562 } | 443 } |
563 } | 444 } |
564 a1.uObjectDescID = v11; | |
565 a1.stru_24.Reset(); | 445 a1.stru_24.Reset(); |
566 a1.spell_id = SPELL_AIR_SPARKS; | 446 a1.spell_id = SPELL_AIR_SPARKS; |
567 v13 = v5->vPosition.x; | |
568 v14 = v5->vPosition.y; | |
569 a1.spell_level = uSkillLevel; | 447 a1.spell_level = uSkillLevel; |
570 a1.vPosition.x = v13; | 448 a1.vPosition.x = v5->vPosition.x; |
571 v15 = v5->vPosition.z + ((signed int)v5->uActorHeight >> 1); | |
572 v16 = v117; | |
573 v17 = LOWORD(v117->uYawAngle); | |
574 a1.spell_skill = 0; | 449 a1.spell_skill = 0; |
575 a1.vPosition.y = v14; | 450 a1.vPosition.y = v5->vPosition.y; |
576 a1.vPosition.z = v15; | 451 a1.vPosition.z = v5->vPosition.z + ((signed int)v5->uActorHeight >> 1); |
577 a1.uFacing = v17; | 452 a1.uFacing = pDir->uYawAngle; |
578 a1.uSoundID = 0; | 453 a1.uSoundID = 0; |
579 a1.uAttributes = 0; | 454 a1.uAttributes = 0; |
580 a1.uSectorID = pIndoor->GetSector(v13, v14, v15); | 455 a1.uSectorID = pIndoor->GetSector(a1.vPosition.x, a1.vPosition.y, a1.vPosition.z); |
581 a1.spell_caster_pid = PID(OBJECT_Actor, LODWORD(v120)); | 456 a1.spell_caster_pid = PID(OBJECT_Actor, LODWORD(v120)); |
582 a1.uSpriteFrameID = 0; | 457 a1.uSpriteFrameID = 0; |
583 a1.spell_target_pid = 0; | 458 a1.spell_target_pid = 0; |
584 a1.field_60_distance_related_prolly_lod = 3; | 459 a1.field_60_distance_related_prolly_lod = 3; |
585 v19 = spellnuma / -2; | 460 v19 = spellnuma / -2; |
590 } | 465 } |
591 else | 466 else |
592 { | 467 { |
593 do | 468 do |
594 { | 469 { |
595 a1.uFacing = v19 + LOWORD(v16->uYawAngle); | 470 a1.uFacing = v19 + LOWORD(pDir->uYawAngle); |
596 v20 = a1.Create( | 471 v20 = a1.Create( |
597 (signed __int16)a1.uFacing, | 472 (signed __int16)a1.uFacing, |
598 v16->uPitchAngle, | 473 pDir->uPitchAngle, |
599 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | 474 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, |
600 0); | 475 0); |
601 v19 += v118; | 476 v19 += v118; |
602 } | 477 } |
603 while ( v19 <= a1a ); | 478 while ( v19 <= a1a ); |
604 } | 479 } |
605 if ( v20 != -1 ) | 480 if ( v20 != -1 ) |
606 { | 481 { |
607 v21 = 8 * v20; | 482 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[15], PID(OBJECT_Item, v20), 0, -1, 0, 0, 0, 0); |
608 LOBYTE(v21) = v21 | 2; | |
609 v99 = v21; | |
610 v22 = (SoundID)word_4EE088_sound_ids[15]; | |
611 v98 = v22; | |
612 pAudioPlayer->PlaySound(v98, v99, 0, -1, 0, 0, 0, 0); | |
613 return; | 483 return; |
614 } | 484 } |
615 return; | 485 return; |
616 break; | 486 break; |
617 | 487 |
618 case 17: | 488 case 17: |
619 if (masteryLevel == 0) | 489 if (masteryLevel == 1 || masteryLevel == 2) |
620 { | 490 v8 = 300 * realPoints + 3840; |
491 else if (masteryLevel == 3 ) | |
492 v8 = 900 * realPoints + 3840; | |
493 else if (masteryLevel == 4 ) | |
494 v8 = 3600 * (realPoints + 64); | |
495 else | |
621 v8 = 0; | 496 v8 = 0; |
622 } | |
623 else if (masteryLevel == 1 || masteryLevel == 2) | |
624 { | |
625 v9 = 300 * realPoints; | |
626 v8 = v9 + 3840; | |
627 } | |
628 else if (masteryLevel == 3 ) | |
629 { | |
630 v9 = 900 * realPoints; | |
631 v8 = v9 + 3840; | |
632 } | |
633 else if (masteryLevel == 4 ) | |
634 { | |
635 v8 = 3600 * (realPoints + 64); | |
636 } | |
637 v5->pActorBuffs[15].Apply( | 497 v5->pActorBuffs[15].Apply( |
638 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v8 << 7) * 0.033333335), | 498 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v8 << 7) * 0.033333335), |
639 masteryLevel, | 499 masteryLevel, |
640 0, | 500 0, |
641 0, | 501 0, |
642 0); | 502 0); |
643 return; | 503 return; |
644 | 504 |
645 case 38: | 505 case 38: |
646 if (masteryLevel == 0) | 506 if (masteryLevel == 1 || masteryLevel == 2) |
647 { | 507 v44 = 300 * realPoints + 3840; |
648 v44 = 0; | |
649 } | |
650 else if (masteryLevel == 1 || masteryLevel == 2) | |
651 { | |
652 v45 = 300 * realPoints; | |
653 v44 = v45 + 3840; | |
654 } | |
655 else if (masteryLevel == 3 ) | 508 else if (masteryLevel == 3 ) |
656 { | 509 v44 = 900 * realPoints + 3840; |
657 v45 = 900 * realPoints; | |
658 v44 = v45 + 3840; | |
659 } | |
660 else if (masteryLevel == 4 ) | 510 else if (masteryLevel == 4 ) |
661 { | |
662 v44 = 3600 * (realPoints + 64); | 511 v44 = 3600 * (realPoints + 64); |
663 } | 512 else |
513 v44 = 0; | |
664 v5->pActorBuffs[16].Apply( | 514 v5->pActorBuffs[16].Apply( |
665 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v44 << 7) * 0.033333335), | 515 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v44 << 7) * 0.033333335), |
666 masteryLevel, | 516 masteryLevel, |
667 realPoints + 5, | 517 realPoints + 5, |
668 0, | 518 0, |
669 0); | 519 0); |
670 pGame->pStru6Instance->_4A7E89_sparkles_on_actor_after_it_casts_buff(v5,0x5C310Eu); | 520 pGame->pStru6Instance->_4A7E89_sparkles_on_actor_after_it_casts_buff(v5,0x5C310Eu); |
671 v46 = 8 * LODWORD(v120); | 521 pAudioPlayer->PlaySound((SoundID)13040, PID(OBJECT_Actor,uActorID), 0, -1, 0, 0, 0, 0); |
672 LOBYTE(v46) = PID(OBJECT_Actor,LOBYTE(v120)); | |
673 v99 = v46; | |
674 v98 = (SoundID)13040; | |
675 pAudioPlayer->PlaySound(v98, v99, 0, -1, 0, 0, 0, 0); | |
676 return; | 522 return; |
677 | 523 |
678 case 46: | 524 case 46: |
679 if (masteryLevel == 0) | 525 if (masteryLevel == 1 || masteryLevel == 2) |
680 { | 526 v42 = 300 * realPoints + 3840; |
527 else if (masteryLevel == 3 ) | |
528 v42 = 900 * realPoints + 3840; | |
529 else if (masteryLevel == 4 ) | |
530 v42 = 1200 * realPoints + 3840; | |
531 else | |
681 v42 = 0; | 532 v42 = 0; |
682 } | |
683 else if (masteryLevel == 1 || masteryLevel == 2) | |
684 { | |
685 v41 = 300 * realPoints; | |
686 v42 = v41 + 3840; | |
687 } | |
688 else if (masteryLevel == 3 ) | |
689 { | |
690 v41 = 900 * realPoints; | |
691 v42 = v41 + 3840; | |
692 } | |
693 else if (masteryLevel == 4 ) | |
694 { | |
695 v41 = 1200 * realPoints; | |
696 v42 = v41 + 3840; | |
697 } | |
698 v5->pActorBuffs[17].Apply( | 533 v5->pActorBuffs[17].Apply( |
699 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v42 << 7) * 0.033333335), | 534 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v42 << 7) * 0.033333335), |
700 masteryLevel, | 535 masteryLevel, |
701 realPoints + 5, | 536 realPoints + 5, |
702 0, | 537 0, |
703 0); | 538 0); |
704 pGame->pStru6Instance->_4A7E89_sparkles_on_actor_after_it_casts_buff(v5,0xC8C805u); | 539 pGame->pStru6Instance->_4A7E89_sparkles_on_actor_after_it_casts_buff(v5,0xC8C805u); |
705 v43 = 8 * LODWORD(v120); | 540 pAudioPlayer->PlaySound((SoundID)14010, PID(OBJECT_Actor,uActorID), 0, -1, 0, 0, 0, 0); |
706 LOBYTE(v43) = PID(OBJECT_Actor,LOBYTE(v120)); | |
707 v99 = v43; | |
708 v98 = (SoundID)14010; | |
709 pAudioPlayer->PlaySound(v98, v99, 0, -1, 0, 0, 0, 0); | |
710 return; | 541 return; |
711 break; | 542 break; |
712 | 543 |
713 case 47: | 544 case 47: |
714 if (masteryLevel == 0) | 545 if (masteryLevel == 1 || masteryLevel == 2) |
715 { | |
716 LOWORD(v48) = 0; | |
717 } | |
718 else if (masteryLevel == 1 || masteryLevel == 2) | |
719 { | |
720 v48 = 2 * realPoints + 40; | 546 v48 = 2 * realPoints + 40; |
721 } | |
722 else if (masteryLevel == 3 ) | 547 else if (masteryLevel == 3 ) |
723 { | |
724 v48 = 3 * realPoints + 60; | 548 v48 = 3 * realPoints + 60; |
725 } | |
726 else if (masteryLevel == 4 ) | 549 else if (masteryLevel == 4 ) |
727 { | 550 v48 = 2 * (3 * realPoints + 60); |
728 LOWORD(v48) = 2 * (3 * realPoints + 60); | 551 else |
729 } | 552 v48 = 0; |
730 v5->pActorBuffs[11].Apply(pParty->uTimePlayed + 1280, masteryLevel, v48, 0, 0); | 553 v5->pActorBuffs[11].Apply(pParty->uTimePlayed + 1280, masteryLevel, v48, 0, 0); |
731 pGame->pStru6Instance->_4A7E89_sparkles_on_actor_after_it_casts_buff(v5,0xC8C805u); | 554 pGame->pStru6Instance->_4A7E89_sparkles_on_actor_after_it_casts_buff(v5,0xC8C805u); |
732 v50 = 8 * LODWORD(v120); | 555 pAudioPlayer->PlaySound((SoundID)14020, PID(OBJECT_Actor, uActorID), 0, -1, 0, 0, 0, 0); |
733 LOBYTE(v50) = PID(OBJECT_Actor,LOBYTE(v120)); | |
734 v99 = v50; | |
735 v98 = (SoundID)14020; | |
736 pAudioPlayer->PlaySound(v98, v99, 0, -1, 0, 0, 0, 0); | |
737 return; | 556 return; |
738 | 557 |
739 case 51: | 558 case 51: |
740 if (masteryLevel == 0) | 559 if (masteryLevel == 1 || masteryLevel == 2) |
741 { | 560 v54 = 300 * realPoints + 3840; |
561 else if (masteryLevel == 3 ) | |
562 v54 = 900 * realPoints + 3840; | |
563 else if (masteryLevel == 4 ) | |
564 v54 = 1200 * realPoints + 3840; | |
565 else | |
742 v54 = 0; | 566 v54 = 0; |
743 } | |
744 else if (masteryLevel == 1 || masteryLevel == 2) | |
745 { | |
746 v53 = 300 * realPoints; | |
747 v54 = v53 + 3840; | |
748 } | |
749 else if (masteryLevel == 3 ) | |
750 { | |
751 v53 = 900 * realPoints; | |
752 v54 = v53 + 3840; | |
753 } | |
754 else if (masteryLevel == 4 ) | |
755 { | |
756 v53 = 1200 * realPoints; | |
757 v54 = v53 + 3840; | |
758 } | |
759 v5->pActorBuffs[18].Apply( | 567 v5->pActorBuffs[18].Apply( |
760 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v54 << 7) * 0.033333335), | 568 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v54 << 7) * 0.033333335), |
761 masteryLevel, | 569 masteryLevel, |
762 realPoints + 5, | 570 realPoints + 5, |
763 0, | 571 0, |
764 0); | 572 0); |
765 pGame->pStru6Instance->_4A7E89_sparkles_on_actor_after_it_casts_buff(v5,0xC8C805u); | 573 pGame->pStru6Instance->_4A7E89_sparkles_on_actor_after_it_casts_buff(v5,0xC8C805u); |
766 v55 = 8 * LODWORD(v120); | 574 pAudioPlayer->PlaySound((SoundID)14060, PID(OBJECT_Actor,uActorID), 0, -1, 0, 0, 0, 0); |
767 LOBYTE(v55) = PID(OBJECT_Actor,LOBYTE(v120)); | |
768 v99 = v55; | |
769 v98 = (SoundID)14060; | |
770 pAudioPlayer->PlaySound(v98, v99, 0, -1, 0, 0, 0, 0); | |
771 return; | 575 return; |
772 | 576 |
773 case 73: | 577 case 73: |
774 if ( (signed int)masteryLevel <= 0 || (signed int)masteryLevel > 4 ) | 578 if ( (signed int)masteryLevel <= 0 || (signed int)masteryLevel > 4 ) |
775 v51 = 0; | 579 v51 = 0; |
780 masteryLevel, | 584 masteryLevel, |
781 realPoints, | 585 realPoints, |
782 0, | 586 0, |
783 0); | 587 0); |
784 pGame->pStru6Instance->_4A7E89_sparkles_on_actor_after_it_casts_buff(v5, 0xA81376u); | 588 pGame->pStru6Instance->_4A7E89_sparkles_on_actor_after_it_casts_buff(v5, 0xA81376u); |
785 v52 = 8 * LODWORD(v120); | 589 pAudioPlayer->PlaySound((SoundID)16060, PID(OBJECT_Actor, uActorID), 0, -1, 0, 0, 0, 0); |
786 LOBYTE(v52) = PID(OBJECT_Actor,LOBYTE(v120)); | |
787 v99 = v52; | |
788 v98 = (SoundID)16060; | |
789 pAudioPlayer->PlaySound(v98, v99, 0, -1, 0, 0, 0, 0); | |
790 return; | 590 return; |
791 | 591 |
792 case 77: | 592 case 77: |
793 v5->sCurrentHP += 5 * realPoints + 10; | 593 v5->sCurrentHP += 5 * realPoints + 10; |
794 if ( v5->sCurrentHP >= (signed int)v5->pMonsterInfo.uHP ) | 594 if ( v5->sCurrentHP >= (signed int)v5->pMonsterInfo.uHP ) |
795 v5->sCurrentHP = LOWORD(v5->pMonsterInfo.uHP); | 595 v5->sCurrentHP = LOWORD(v5->pMonsterInfo.uHP); |
796 pGame->pStru6Instance->_4A7E89_sparkles_on_actor_after_it_casts_buff(v5, 0xA81376u); | 596 pGame->pStru6Instance->_4A7E89_sparkles_on_actor_after_it_casts_buff(v5, 0xA81376u); |
797 v50 = 8 * LODWORD(v120); | 597 pAudioPlayer->PlaySound((SoundID)14020, PID(OBJECT_Actor, uActorID), 0, -1, 0, 0, 0, 0); |
798 LOBYTE(v50) = PID(OBJECT_Actor,LOBYTE(v120)); | |
799 v99 = v50; | |
800 v98 = (SoundID)14020; | |
801 pAudioPlayer->PlaySound(v98, v99, 0, -1, 0, 0, 0, 0); | |
802 return; | 598 return; |
803 | 599 |
804 case 80: | 600 case 80: |
805 for (int i = 0; i < 20; i++ ) | 601 for (int i = 0; i < 20; i++ ) |
806 { | 602 { |
807 pParty->pPartyBuffs[i].Reset(); | 603 pParty->pPartyBuffs[i].Reset(); |
808 } | 604 } |
809 for (int i = 1; i <= 4; i++) | 605 for (int i = 1; i <= 4; i++) |
810 { | 606 { |
811 v57 = pPlayers[i]; | 607 v57 = pPlayers[i]; |
812 v58 = (v57)->GetActualWillpower(); | 608 v58 = v57->GetActualWillpower(); |
813 v59 = (v57)->GetParameterBonus(v58); | 609 v59 = v57->GetParameterBonus(v58); |
814 v60 = (v57)->GetActualIntelligence(); | 610 v60 = v57->GetActualIntelligence(); |
815 v61 = ((v57)->GetParameterBonus(v60) + v59) >> 1; | 611 v61 = (v57->GetParameterBonus(v60) + v59) / 2; |
816 v62 = (v57)->GetActualLuck(); | 612 v62 = v57->GetActualLuck(); |
817 v63 = v61 + (v57)->GetParameterBonus(v62) + 30; | 613 v63 = v61 + v57->GetParameterBonus(v62) + 30; |
818 if ( rand() % v63 < 30 ) | 614 if ( rand() % v63 < 30 ) |
819 { | 615 { |
820 for (int k = 0; k < v57->pPlayerBuffs.size(); k++) | 616 for (int k = 0; k < v57->pPlayerBuffs.size(); k++) |
821 { | 617 { |
822 v57->pPlayerBuffs[k].Reset(); | 618 v57->pPlayerBuffs[k].Reset(); |
823 } | 619 } |
824 pOtherOverlayList->_4418B1(11210, i + 99, 0, 65536); | 620 pOtherOverlayList->_4418B1(11210, i + 99, 0, 65536); |
825 } | 621 } |
826 } | 622 } |
827 v65 = 8 * LODWORD(v120); | 623 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[80], PID(OBJECT_Actor, uActorID), 0, -1, 0, 0, 0, 0); |
828 LOBYTE(v65) = PID(OBJECT_Actor,LOBYTE(v120)); | |
829 v99 = v65; | |
830 v22 = (SoundID)word_4EE088_sound_ids[80]; | |
831 v98 = v22; | |
832 pAudioPlayer->PlaySound(v98, v99, 0, -1, 0, 0, 0, 0); | |
833 return; | 624 return; |
834 | 625 |
835 case 85: | 626 case 85: |
836 if (masteryLevel == 0) | 627 if (masteryLevel == 1 || masteryLevel == 2) |
628 { | |
629 v96 = 300 * realPoints + 3840; | |
630 } | |
631 else if (masteryLevel == 3 ) | |
632 { | |
633 LOWORD(realPoints) = 3 * realPoints; | |
634 v96 = 900 * (uSkillLevel & 0x3F) + 3840; | |
635 } | |
636 else if (masteryLevel == 4 ) | |
637 { | |
638 v96 = 1200 * realPoints + 3840; | |
639 LOWORD(realPoints) = 4 * realPoints; | |
640 } | |
641 else | |
837 { | 642 { |
838 LOWORD(realPoints) = uSkillLevel; | 643 LOWORD(realPoints) = uSkillLevel; |
839 v96 = 0; | 644 v96 = 0; |
840 } | |
841 else if (masteryLevel == 1 || masteryLevel == 2) | |
842 { | |
843 v96 = 300 * realPoints + 3840; | |
844 } | |
845 else if (masteryLevel == 3 ) | |
846 { | |
847 LOWORD(realPoints) = 3 * realPoints; | |
848 v96 = 900 * (uSkillLevel & 0x3F) + 3840; | |
849 } | |
850 else if (masteryLevel == 4 ) | |
851 { | |
852 v96 = 1200 * realPoints + 3840; | |
853 LOWORD(realPoints) = 4 * realPoints; | |
854 } | 645 } |
855 v5->pActorBuffs[13].Apply( | 646 v5->pActorBuffs[13].Apply( |
856 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v96 << 7) * 0.033333335), | 647 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v96 << 7) * 0.033333335), |
857 masteryLevel, | 648 masteryLevel, |
858 realPoints, | 649 realPoints, |
859 0, | 650 0, |
860 0); | 651 0); |
861 pGame->pStru6Instance->_4A7E89_sparkles_on_actor_after_it_casts_buff(v5, 0xFFFFFFu); | 652 pGame->pStru6Instance->_4A7E89_sparkles_on_actor_after_it_casts_buff(v5, 0xFFFFFFu); |
862 v97 = 8 * LODWORD(v120); | 653 pAudioPlayer->PlaySound((SoundID)17070, PID(OBJECT_Actor, uActorID), 0, -1, 0, 0, 0, 0); |
863 LOBYTE(v97) = PID(OBJECT_Actor,LOBYTE(v120)); | |
864 v99 = v97; | |
865 v98 = (SoundID)17070; | |
866 pAudioPlayer->PlaySound(v98, v99, 0, -1, 0, 0, 0, 0); | |
867 return; | 654 return; |
868 | 655 |
869 case 86: | 656 case 86: |
870 if (masteryLevel == 0) | 657 if (masteryLevel == 1 || masteryLevel == 2) |
871 { | 658 v94 = 300 * realPoints + 3840; |
659 else if (masteryLevel == 3) | |
660 v94 = 900 * realPoints + 3840; | |
661 else if (masteryLevel == 4) | |
662 v94 = 1200 * realPoints + 3840; | |
663 else | |
872 v94 = 0; | 664 v94 = 0; |
873 } | |
874 else if (masteryLevel == 1 || masteryLevel == 2) | |
875 { | |
876 v93 = 300 * realPoints; | |
877 v94 = v93 + 3840; | |
878 } | |
879 else if (masteryLevel == 3) | |
880 { | |
881 v93 = 900 * realPoints; | |
882 v94 = v93 + 3840; | |
883 } | |
884 else // if (v7 == 4) | |
885 { | |
886 v93 = 1200 * realPoints; | |
887 v94 = v93 + 3840; | |
888 } | |
889 v5->pActorBuffs[14].Apply( | 665 v5->pActorBuffs[14].Apply( |
890 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v94 << 7) * 0.033333335), | 666 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v94 << 7) * 0.033333335), |
891 masteryLevel, | 667 masteryLevel, |
892 realPoints + 5, | 668 realPoints + 5, |
893 0, | 669 0, |
894 0); | 670 0); |
895 pGame->pStru6Instance->_4A7E89_sparkles_on_actor_after_it_casts_buff(v5, 0xFFFFFFu); | 671 pGame->pStru6Instance->_4A7E89_sparkles_on_actor_after_it_casts_buff(v5, 0xFFFFFFu); |
896 v95 = 8 * LODWORD(v120); | 672 pAudioPlayer->PlaySound((SoundID)17080, PID(OBJECT_Actor, uActorID), 0, -1, 0, 0, 0, 0); |
897 LOBYTE(v95) = PID(OBJECT_Actor,LOBYTE(v120)); | |
898 v99 = v95; | |
899 v98 = (SoundID)17080; | |
900 pAudioPlayer->PlaySound(v98, v99, 0, -1, 0, 0, 0, 0); | |
901 return; | 673 return; |
902 | 674 |
903 case 93: | 675 case 93: |
904 v70 = 3; | |
905 if (masteryLevel == 2) | 676 if (masteryLevel == 2) |
906 v108 = 5; | 677 v70 = 5; |
907 else if (masteryLevel == 3) | 678 else if (masteryLevel == 3) |
908 v108 = 7; | 679 v70 = 7; |
909 else if (masteryLevel == 4) | 680 else if (masteryLevel == 4) |
910 v108 = 9; | 681 v70 = 9; |
682 else | |
683 v70 = 3; | |
911 | 684 |
912 spellnume = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360; | 685 spellnume = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360; |
913 a1.uType = stru_4E3ACC[SPELL_DARK_SHARPMETAL].uType; | 686 a1.uType = stru_4E3ACC[SPELL_DARK_SHARPMETAL].uType; |
914 v116 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (v70 - 1); | 687 v116 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (v70 - 1); |
915 v71 = 0; | 688 a1.uObjectDescID = 0; |
916 for (int i = 0; i < pObjectList->uNumObjects; i++) | 689 for (int i = 0; i < pObjectList->uNumObjects; i++) |
917 { | 690 { |
918 if (pObjectList->pObjects[i].uObjectID == stru_4E3ACC[SPELL_DARK_SHARPMETAL].uType) | 691 if (pObjectList->pObjects[i].uObjectID == stru_4E3ACC[SPELL_DARK_SHARPMETAL].uType) |
919 { | 692 { |
920 v71 = i; | 693 a1.uObjectDescID = i; |
921 break; | 694 break; |
922 } | 695 } |
923 } | 696 } |
924 a1.uObjectDescID = v71; | |
925 a1.stru_24.Reset(); | 697 a1.stru_24.Reset(); |
926 a1.spell_id = SPELL_DARK_SHARPMETAL; | 698 a1.spell_id = SPELL_DARK_SHARPMETAL; |
927 v73 = v5->vPosition.x; | |
928 v74 = v5->vPosition.y; | |
929 a1.spell_level = uSkillLevel; | 699 a1.spell_level = uSkillLevel; |
930 a1.vPosition.x = v73; | 700 a1.vPosition.x = v5->vPosition.x; |
931 v75 = v5->vPosition.z + ((signed int)v5->uActorHeight >> 1); | |
932 v76 = v117; | |
933 v77 = LOWORD(v117->uYawAngle); | |
934 a1.spell_skill = 0; | 701 a1.spell_skill = 0; |
935 a1.vPosition.y = v74; | 702 a1.vPosition.y = v5->vPosition.y; |
936 a1.vPosition.z = v75; | 703 a1.vPosition.z = v5->vPosition.z + ((signed int)v5->uActorHeight >> 1); |
937 a1.uFacing = v77; | 704 a1.uFacing = pDir->uYawAngle; |
938 a1.uSoundID = 0; | 705 a1.uSoundID = 0; |
939 a1.uAttributes = 0; | 706 a1.uAttributes = 0; |
940 a1.uSectorID = pIndoor->GetSector(v73, v74, v75); | 707 a1.uSectorID = pIndoor->GetSector(a1.vPosition.x, a1.vPosition.y, a1.vPosition.z); |
941 a1.spell_caster_pid = PID(OBJECT_Actor, LODWORD(v120)); | 708 a1.spell_caster_pid = PID(OBJECT_Actor, uActorID); |
942 a1.uSpriteFrameID = 0; | 709 a1.uSpriteFrameID = 0; |
943 a1.spell_target_pid = 0; | 710 a1.spell_target_pid = 0; |
944 a1.field_60_distance_related_prolly_lod = 3; | 711 a1.field_60_distance_related_prolly_lod = 3; |
945 a1c = spellnume / -2; | 712 a1c = spellnume / -2; |
946 if ( spellnume / -2 > spellnume / 2 ) | 713 if ( spellnume / -2 > spellnume / 2 ) |
949 } | 716 } |
950 else | 717 else |
951 { | 718 { |
952 do | 719 do |
953 { | 720 { |
954 v79 = v76->uYawAngle; | 721 v79 = pDir->uYawAngle; |
955 a1.uFacing = a1c + LOWORD(v76->uYawAngle); | 722 a1.uFacing = a1c + LOWORD(pDir->uYawAngle); |
956 v80 = a1.Create( | 723 v80 = a1.Create( |
957 v79, | 724 v79, |
958 v76->uPitchAngle, | 725 pDir->uPitchAngle, |
959 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | 726 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, |
960 0); | 727 0); |
961 a1c += v116; | 728 a1c += v116; |
962 } | 729 } |
963 while ( a1c <= spellnume / 2 ); | 730 while ( a1c <= spellnume / 2 ); |
964 } | 731 } |
965 if ( v80 != -1 ) | 732 if ( v80 != -1 ) |
966 { | 733 { |
967 v81 = 8 * v80; | 734 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[93], PID(OBJECT_Item, v80), 0, -1, 0, 0, 0, 0); |
968 LOBYTE(v81) = v81 | 2; | |
969 v99 = v81; | |
970 v22 = (SoundID)word_4EE088_sound_ids[93]; | |
971 v98 = v22; | |
972 pAudioPlayer->PlaySound(v98, v99, 0, -1, 0, 0, 0, 0); | |
973 return; | 735 return; |
974 } | 736 } |
737 return; | |
738 break; | |
975 | 739 |
976 case 95: | 740 case 95: |
977 if (masteryLevel == 0) | 741 if (masteryLevel == 0) |
978 v68 = 0; | 742 v68 = 0; |
979 else if (masteryLevel == 1 || (masteryLevel == 2) || (masteryLevel == 3)) | 743 else if (masteryLevel == 1 || (masteryLevel == 2) || (masteryLevel == 3)) |
980 { | 744 v68 = 300 * realPoints + 3840; |
981 v67 = 900 * realPoints; | |
982 v68 = v67 + 3840; | |
983 } | |
984 else | 745 else |
985 { | 746 v68 = 900 * realPoints + 3840; |
986 v67 = 300 * realPoints; | |
987 v68 = v67 + 3840; | |
988 } | |
989 v5->pActorBuffs[20].Apply( | 747 v5->pActorBuffs[20].Apply( |
990 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v68 << 7) * 0.033333335), | 748 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v68 << 7) * 0.033333335), |
991 masteryLevel, | 749 masteryLevel, |
992 0, | 750 0, |
993 0, | 751 0, |
994 0); | 752 0); |
995 pGame->pStru6Instance->_4A7E89_sparkles_on_actor_after_it_casts_buff(v5,0x7E7E7Eu); | 753 pGame->pStru6Instance->_4A7E89_sparkles_on_actor_after_it_casts_buff(v5,0x7E7E7Eu); |
996 v69 = 8 * LODWORD(v120); | 754 pAudioPlayer->PlaySound((SoundID)18060, PID(OBJECT_Actor, uActorID), 0, -1, 0, 0, 0, 0); |
997 LOBYTE(v69) = PID(OBJECT_Actor,LOBYTE(v120)); | |
998 v99 = v69; | |
999 v98 = (SoundID)18060; | |
1000 pAudioPlayer->PlaySound(v98, v99, 0, -1, 0, 0, 0, 0); | |
1001 return; | 755 return; |
1002 } | 756 } |
1003 | 757 |
1004 } | 758 } |
1005 | 759 |