Mercurial > mm7
comparison Actor.cpp @ 1857:f357e4cbd169
Actor::AI_SpellAttack moved spells into a huge case
author | Grumpy7 |
---|---|
date | Mon, 14 Oct 2013 00:58:05 +0200 |
parents | 656962b05d32 |
children | d7c028a6a084 |
comparison
equal
deleted
inserted
replaced
1856:656962b05d32 | 1857:f357e4cbd169 |
---|---|
402 pAudioPlayer->PlaySound(v98, v99, 0, -1, 0, 0, 0, 0); | 402 pAudioPlayer->PlaySound(v98, v99, 0, -1, 0, 0, 0, 0); |
403 return; | 403 return; |
404 } | 404 } |
405 return; | 405 return; |
406 break; | 406 break; |
407 } | 407 |
408 | 408 |
409 if ( uSpellID <= 47 ) | 409 case 5: |
410 { | 410 if (masteryLevel == 0) |
411 if ( uSpellID != 47 ) | 411 { |
412 { | 412 v39 = 0; |
413 if ( uSpellID <= 18 ) | 413 } |
414 { | 414 else if (masteryLevel == 1 || masteryLevel == 2) |
415 if ( uSpellID != 5 ) | 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( | |
427 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v39 << 7) * 0.033333335), | |
428 masteryLevel, | |
429 0, | |
430 0, | |
431 0); | |
432 pGame->pStru6Instance->_4A7E89_sparkles_on_actor_after_it_casts_buff(v5, 0xFF3C1Eu); | |
433 v40 = 8 * LODWORD(v120); | |
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; | |
439 | |
440 case 9: | |
441 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) | |
442 return; | |
443 v118 = pParty->vPosition.z; | |
444 v111 = pParty->vPosition.x; | |
445 v114 = pParty->vPosition.z + 2500; | |
446 v113 = pParty->vPosition.y; | |
447 v23 = 8; | |
448 if (masteryLevel == 2) | |
449 v23 = 10; | |
450 else if (masteryLevel == 3) | |
451 v23 = 12; | |
452 else if (masteryLevel == 4) | |
453 v23 = 14; | |
454 v119 = 0.0; | |
455 spellnumb = 0; | |
456 if ( v23 > 0 ) | |
457 { | |
458 v24 = (double)v118; | |
459 v118 = v23; | |
460 v112 = v24; | |
461 v116 = PID(OBJECT_Actor,LODWORD(v120)); | |
462 do | |
416 { | 463 { |
417 if ( uSpellID != 9 ) | 464 v26 = rand(); |
465 v27 = (double)spellnumb; | |
466 v110 = v27; | |
467 v28 = (double)SLODWORD(v119); | |
468 v30 = v26 % 1000; | |
469 v25 = (double)v114; | |
470 spellnumc = (double)(v26 % 1000) + v112 - v25; | |
471 v120 = v28 * v28; | |
472 v119 = v27 * v27; | |
473 if ( sqrt(spellnumc * spellnumc + v119 + v120) <= 1.0 ) | |
418 { | 474 { |
419 if ( uSpellID != 11 ) | 475 v32 = 0; |
476 pitch = 0; | |
477 } | |
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) | |
420 { | 491 { |
421 if ( uSpellID != 15 ) | 492 v34 = i; |
422 { | 493 break; |
423 if ( uSpellID != 17 ) | |
424 return; | |
425 | |
426 if (masteryLevel == 0) | |
427 { | |
428 v8 = 0; | |
429 } | |
430 else if (masteryLevel == 1 || masteryLevel == 2) | |
431 { | |
432 v9 = 300 * realPoints; | |
433 v8 = v9 + 3840; | |
434 } | |
435 else if (masteryLevel == 3 ) | |
436 { | |
437 v9 = 900 * realPoints; | |
438 v8 = v9 + 3840; | |
439 } | |
440 else if (masteryLevel == 4 ) | |
441 { | |
442 v8 = 3600 * (realPoints + 64); | |
443 } | |
444 v5->pActorBuffs[15].Apply( | |
445 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v8 << 7) * 0.033333335), | |
446 masteryLevel, | |
447 0, | |
448 0, | |
449 0); | |
450 return; | |
451 } | |
452 if (masteryLevel <= 1) | |
453 v10 = 3; | |
454 else if (masteryLevel == 2 ) | |
455 v10 = 5; | |
456 else if (masteryLevel == 3 ) | |
457 v10 = 7; | |
458 else if (masteryLevel == 4 ) | |
459 v10 = 9; | |
460 spellnuma = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360; | |
461 a1.uType = stru_4E3ACC[15].uType; | |
462 v118 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (v10 - 1); | |
463 v11 = 0; | |
464 for (unsigned int i = 0; i < pObjectList->uNumObjects; i++) | |
465 { | |
466 if (stru_4E3ACC[15].uType == pObjectList->pObjects[i].uObjectID) | |
467 { | |
468 v11 = i; | |
469 break; | |
470 } | |
471 } | |
472 a1.uObjectDescID = v11; | |
473 a1.stru_24.Reset(); | |
474 a1.spell_id = SPELL_AIR_SPARKS; | |
475 v13 = v5->vPosition.x; | |
476 v14 = v5->vPosition.y; | |
477 a1.spell_level = uSkillLevel; | |
478 a1.vPosition.x = v13; | |
479 v15 = v5->vPosition.z + ((signed int)v5->uActorHeight >> 1); | |
480 v16 = v117; | |
481 v17 = LOWORD(v117->uYawAngle); | |
482 a1.spell_skill = 0; | |
483 a1.vPosition.y = v14; | |
484 a1.vPosition.z = v15; | |
485 a1.uFacing = v17; | |
486 a1.uSoundID = 0; | |
487 a1.uAttributes = 0; | |
488 a1.uSectorID = pIndoor->GetSector(v13, v14, v15); | |
489 a1.spell_caster_pid = PID(OBJECT_Actor, LODWORD(v120)); | |
490 a1.uSpriteFrameID = 0; | |
491 a1.spell_target_pid = 0; | |
492 a1.field_60_distance_related_prolly_lod = 3; | |
493 v19 = spellnuma / -2; | |
494 a1a = spellnuma / 2; | |
495 if ( spellnuma / -2 > spellnuma / 2 ) | |
496 { | |
497 v20 = spellnuma / 2; | |
498 } | |
499 else | |
500 { | |
501 do | |
502 { | |
503 a1.uFacing = v19 + LOWORD(v16->uYawAngle); | |
504 v20 = a1.Create( | |
505 (signed __int16)a1.uFacing, | |
506 v16->uPitchAngle, | |
507 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
508 0); | |
509 v19 += v118; | |
510 } | |
511 while ( v19 <= a1a ); | |
512 } | |
513 if ( v20 != -1 ) | |
514 { | |
515 v21 = 8 * v20; | |
516 LOBYTE(v21) = v21 | 2; | |
517 v99 = v21; | |
518 v22 = (SoundID)word_4EE088_sound_ids[15]; | |
519 v98 = v22; | |
520 pAudioPlayer->PlaySound(v98, v99, 0, -1, 0, 0, 0, 0); | |
521 return; | |
522 } | |
523 return; | |
524 } | 494 } |
525 } | 495 } |
526 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) | 496 a1.uObjectDescID = v34; |
527 return; | 497 a1.spell_level = uSkillLevel; |
528 v118 = pParty->vPosition.z; | 498 a1.vPosition.x = v111; |
529 v111 = pParty->vPosition.x; | 499 a1.vPosition.y = v113; |
530 v114 = pParty->vPosition.z + 2500; | 500 a1.vPosition.z = v30 + v114; |
531 v113 = pParty->vPosition.y; | 501 a1.spell_id = SPELL_FIRE_METEOR_SHOWER; |
532 v23 = 8; | 502 a1.spell_skill = 0; |
533 if (masteryLevel == 2) | 503 a1.uAttributes = 0; |
534 v23 = 10; | 504 a1.uSectorID = 0; |
535 else if (masteryLevel == 3) | 505 a1.uSpriteFrameID = 0; |
536 v23 = 12; | 506 a1.spell_caster_pid = v116; |
537 else if (masteryLevel == 4) | 507 a1.spell_target_pid = 0; |
538 v23 = 14; | 508 a1.field_60_distance_related_prolly_lod = stru_50C198._427546(v30 + 2500); |
539 v119 = 0.0; | 509 a1.uFacing = v32; |
540 spellnumb = 0; | 510 a1.uSoundID = 0; |
541 if ( v23 > 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 ) | |
542 { | 528 { |
543 v24 = (double)v118; | 529 v37 = 8 * v36; |
544 v118 = v23; | 530 LOBYTE(v37) = v37 | 2; |
545 v112 = v24; | 531 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[9], v37, 0, -1, 0, 0, 0, 0); |
546 v116 = PID(OBJECT_Actor,LODWORD(v120)); | |
547 do | |
548 { | |
549 v26 = rand(); | |
550 v27 = (double)spellnumb; | |
551 v110 = v27; | |
552 v28 = (double)SLODWORD(v119); | |
553 v30 = v26 % 1000; | |
554 v25 = (double)v114; | |
555 spellnumc = (double)(v26 % 1000) + v112 - v25; | |
556 v120 = v28 * v28; | |
557 v119 = v27 * v27; | |
558 if ( sqrt(spellnumc * spellnumc + v119 + v120) <= 1.0 ) | |
559 { | |
560 v32 = 0; | |
561 pitch = 0; | |
562 } | |
563 else | |
564 { | |
565 v31 = (signed __int64)sqrt(v119 + v120); | |
566 v29 = v28; | |
567 v32 = stru_5C6E00->Atan2((signed __int64)v110, (signed __int64)v29); | |
568 pitch = stru_5C6E00->Atan2(v31, (signed __int64)spellnumc); | |
569 } | |
570 a1.stru_24.Reset(); | |
571 a1.uType = stru_4E3ACC[9].uType; | |
572 v34 = 0; | |
573 for (int i = 0; i < pObjectList->uNumObjects; i++) | |
574 { | |
575 if (pObjectList->pObjects[i].uObjectID == a1.uType) | |
576 { | |
577 v34 = i; | |
578 break; | |
579 } | |
580 } | |
581 a1.uObjectDescID = v34; | |
582 a1.spell_level = uSkillLevel; | |
583 a1.vPosition.x = v111; | |
584 a1.vPosition.y = v113; | |
585 a1.vPosition.z = v30 + v114; | |
586 a1.spell_id = SPELL_FIRE_METEOR_SHOWER; | |
587 a1.spell_skill = 0; | |
588 a1.uAttributes = 0; | |
589 a1.uSectorID = 0; | |
590 a1.uSpriteFrameID = 0; | |
591 a1.spell_caster_pid = v116; | |
592 a1.spell_target_pid = 0; | |
593 a1.field_60_distance_related_prolly_lod = stru_50C198._427546(v30 + 2500); | |
594 a1.uFacing = v32; | |
595 a1.uSoundID = 0; | |
596 v35 = v117->uDistance; | |
597 LODWORD(v119) = v117->uDistance; | |
598 if ((double)v119 < 307.2 ) | |
599 a1.field_60_distance_related_prolly_lod = 0; | |
600 else if ( v119 < 1024 ) | |
601 a1.field_60_distance_related_prolly_lod = 1; | |
602 else if ( v119 < 2560 ) | |
603 a1.field_60_distance_related_prolly_lod = 2; | |
604 else | |
605 a1.field_60_distance_related_prolly_lod = 3; | |
606 a1.field_61 = 2; | |
607 v36 = a1.Create( | |
608 v32, | |
609 pitch, | |
610 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
611 0); | |
612 if ( v36 != -1 ) | |
613 { | |
614 v37 = 8 * v36; | |
615 LOBYTE(v37) = v37 | 2; | |
616 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[9], v37, 0, -1, 0, 0, 0, 0); | |
617 } | |
618 spellnumb = rand() % 1024 - 512; | |
619 v38 = rand(); | |
620 v49 = v118-- == 1; | |
621 LODWORD(v119) = (unsigned __int64)(v38 % 1024) - 512; | |
622 } | |
623 while ( !v49 ); | |
624 } | 532 } |
625 return; | 533 spellnumb = rand() % 1024 - 512; |
534 v38 = rand(); | |
535 v49 = v118-- == 1; | |
536 LODWORD(v119) = (unsigned __int64)(v38 % 1024) - 512; | |
626 } | 537 } |
627 | 538 while ( !v49 ); |
628 if (masteryLevel == 0) | 539 } |
540 return; | |
541 break; | |
542 | |
543 case 15: | |
544 if (masteryLevel <= 1) | |
545 v10 = 3; | |
546 else if (masteryLevel == 2 ) | |
547 v10 = 5; | |
548 else if (masteryLevel == 3 ) | |
549 v10 = 7; | |
550 else if (masteryLevel == 4 ) | |
551 v10 = 9; | |
552 spellnuma = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360; | |
553 a1.uType = stru_4E3ACC[15].uType; | |
554 v118 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (v10 - 1); | |
555 v11 = 0; | |
556 for (unsigned int i = 0; i < pObjectList->uNumObjects; i++) | |
557 { | |
558 if (stru_4E3ACC[15].uType == pObjectList->pObjects[i].uObjectID) | |
629 { | 559 { |
630 v39 = 0; | 560 v11 = i; |
561 break; | |
631 } | 562 } |
632 else if (masteryLevel == 1 || masteryLevel == 2) | 563 } |
564 a1.uObjectDescID = v11; | |
565 a1.stru_24.Reset(); | |
566 a1.spell_id = SPELL_AIR_SPARKS; | |
567 v13 = v5->vPosition.x; | |
568 v14 = v5->vPosition.y; | |
569 a1.spell_level = uSkillLevel; | |
570 a1.vPosition.x = v13; | |
571 v15 = v5->vPosition.z + ((signed int)v5->uActorHeight >> 1); | |
572 v16 = v117; | |
573 v17 = LOWORD(v117->uYawAngle); | |
574 a1.spell_skill = 0; | |
575 a1.vPosition.y = v14; | |
576 a1.vPosition.z = v15; | |
577 a1.uFacing = v17; | |
578 a1.uSoundID = 0; | |
579 a1.uAttributes = 0; | |
580 a1.uSectorID = pIndoor->GetSector(v13, v14, v15); | |
581 a1.spell_caster_pid = PID(OBJECT_Actor, LODWORD(v120)); | |
582 a1.uSpriteFrameID = 0; | |
583 a1.spell_target_pid = 0; | |
584 a1.field_60_distance_related_prolly_lod = 3; | |
585 v19 = spellnuma / -2; | |
586 a1a = spellnuma / 2; | |
587 if ( spellnuma / -2 > spellnuma / 2 ) | |
588 { | |
589 v20 = spellnuma / 2; | |
590 } | |
591 else | |
592 { | |
593 do | |
633 { | 594 { |
634 v39 = 60 * (realPoints + 60); | 595 a1.uFacing = v19 + LOWORD(v16->uYawAngle); |
596 v20 = a1.Create( | |
597 (signed __int16)a1.uFacing, | |
598 v16->uPitchAngle, | |
599 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
600 0); | |
601 v19 += v118; | |
635 } | 602 } |
636 else if (masteryLevel == 3 ) | 603 while ( v19 <= a1a ); |
637 { | 604 } |
638 v39 = 180 * (realPoints + 20); | 605 if ( v20 != -1 ) |
639 } | 606 { |
640 else if (masteryLevel == 4 ) | 607 v21 = 8 * v20; |
641 { | 608 LOBYTE(v21) = v21 | 2; |
642 v39 = 240 * (realPoints + 15); | 609 v99 = v21; |
643 } | 610 v22 = (SoundID)word_4EE088_sound_ids[15]; |
644 v5->pActorBuffs[19].Apply( | 611 v98 = v22; |
645 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v39 << 7) * 0.033333335), | |
646 masteryLevel, | |
647 0, | |
648 0, | |
649 0); | |
650 pGame->pStru6Instance->_4A7E89_sparkles_on_actor_after_it_casts_buff(v5, 0xFF3C1Eu); | |
651 v40 = 8 * LODWORD(v120); | |
652 LOBYTE(v40) = PID(OBJECT_Actor,LOBYTE(v120)); | |
653 v99 = v40; | |
654 v98 = (SoundID)10040; | |
655 pAudioPlayer->PlaySound(v98, v99, 0, -1, 0, 0, 0, 0); | 612 pAudioPlayer->PlaySound(v98, v99, 0, -1, 0, 0, 0, 0); |
656 return; | 613 return; |
657 } | 614 } |
658 if ( uSpellID != 38 ) | 615 return; |
659 { | 616 break; |
660 if ( uSpellID != 46 ) | 617 |
661 return; | 618 case 17: |
662 | 619 if (masteryLevel == 0) |
663 if (masteryLevel == 0) | 620 { |
664 { | 621 v8 = 0; |
665 v42 = 0; | 622 } |
666 } | 623 else if (masteryLevel == 1 || masteryLevel == 2) |
667 else if (masteryLevel == 1 || masteryLevel == 2) | 624 { |
668 { | 625 v9 = 300 * realPoints; |
669 v41 = 300 * realPoints; | 626 v8 = v9 + 3840; |
670 v42 = v41 + 3840; | 627 } |
671 } | 628 else if (masteryLevel == 3 ) |
672 else if (masteryLevel == 3 ) | 629 { |
673 { | 630 v9 = 900 * realPoints; |
674 v41 = 900 * realPoints; | 631 v8 = v9 + 3840; |
675 v42 = v41 + 3840; | 632 } |
676 } | 633 else if (masteryLevel == 4 ) |
677 else if (masteryLevel == 4 ) | 634 { |
678 { | 635 v8 = 3600 * (realPoints + 64); |
679 v41 = 1200 * realPoints; | 636 } |
680 v42 = v41 + 3840; | 637 v5->pActorBuffs[15].Apply( |
681 } | 638 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v8 << 7) * 0.033333335), |
682 v5->pActorBuffs[17].Apply( | 639 masteryLevel, |
683 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v42 << 7) * 0.033333335), | 640 0, |
684 masteryLevel, | 641 0, |
685 realPoints + 5, | 642 0); |
686 0, | 643 return; |
687 0); | 644 |
688 pGame->pStru6Instance->_4A7E89_sparkles_on_actor_after_it_casts_buff(v5,0xC8C805u); | 645 case 38: |
689 v43 = 8 * LODWORD(v120); | |
690 LOBYTE(v43) = PID(OBJECT_Actor,LOBYTE(v120)); | |
691 v99 = v43; | |
692 v98 = (SoundID)14010; | |
693 pAudioPlayer->PlaySound(v98, v99, 0, -1, 0, 0, 0, 0); | |
694 return; | |
695 } | |
696 | |
697 if (masteryLevel == 0) | 646 if (masteryLevel == 0) |
698 { | 647 { |
699 v44 = 0; | 648 v44 = 0; |
700 } | 649 } |
701 else if (masteryLevel == 1 || masteryLevel == 2) | 650 else if (masteryLevel == 1 || masteryLevel == 2) |
723 LOBYTE(v46) = PID(OBJECT_Actor,LOBYTE(v120)); | 672 LOBYTE(v46) = PID(OBJECT_Actor,LOBYTE(v120)); |
724 v99 = v46; | 673 v99 = v46; |
725 v98 = (SoundID)13040; | 674 v98 = (SoundID)13040; |
726 pAudioPlayer->PlaySound(v98, v99, 0, -1, 0, 0, 0, 0); | 675 pAudioPlayer->PlaySound(v98, v99, 0, -1, 0, 0, 0, 0); |
727 return; | 676 return; |
728 } | 677 |
729 | 678 case 46: |
730 if (masteryLevel == 0) | 679 if (masteryLevel == 0) |
731 { | 680 { |
732 LOWORD(v48) = 0; | 681 v42 = 0; |
733 } | 682 } |
734 else if (masteryLevel == 1 || masteryLevel == 2) | 683 else if (masteryLevel == 1 || masteryLevel == 2) |
735 { | 684 { |
736 v48 = 2 * realPoints + 40; | 685 v41 = 300 * realPoints; |
737 } | 686 v42 = v41 + 3840; |
738 else if (masteryLevel == 3 ) | 687 } |
739 { | 688 else if (masteryLevel == 3 ) |
740 v48 = 3 * realPoints + 60; | 689 { |
741 } | 690 v41 = 900 * realPoints; |
742 else if (masteryLevel == 4 ) | 691 v42 = v41 + 3840; |
743 { | 692 } |
744 LOWORD(v48) = 2 * (3 * realPoints + 60); | 693 else if (masteryLevel == 4 ) |
745 } | 694 { |
746 v5->pActorBuffs[11].Apply(pParty->uTimePlayed + 1280, masteryLevel, v48, 0, 0); | 695 v41 = 1200 * realPoints; |
747 pGame->pStru6Instance->_4A7E89_sparkles_on_actor_after_it_casts_buff(v5,0xC8C805u); | 696 v42 = v41 + 3840; |
748 v50 = 8 * LODWORD(v120); | 697 } |
749 LOBYTE(v50) = PID(OBJECT_Actor,LOBYTE(v120)); | 698 v5->pActorBuffs[17].Apply( |
750 v99 = v50; | 699 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v42 << 7) * 0.033333335), |
751 v98 = (SoundID)14020; | 700 masteryLevel, |
752 pAudioPlayer->PlaySound(v98, v99, 0, -1, 0, 0, 0, 0); | 701 realPoints + 5, |
753 return; | 702 0, |
754 } | 703 0); |
755 if ( uSpellID <= 80 ) | 704 pGame->pStru6Instance->_4A7E89_sparkles_on_actor_after_it_casts_buff(v5,0xC8C805u); |
756 { | 705 v43 = 8 * LODWORD(v120); |
757 if ( uSpellID == 80 ) | 706 LOBYTE(v43) = PID(OBJECT_Actor,LOBYTE(v120)); |
758 { | 707 v99 = v43; |
708 v98 = (SoundID)14010; | |
709 pAudioPlayer->PlaySound(v98, v99, 0, -1, 0, 0, 0, 0); | |
710 return; | |
711 break; | |
712 | |
713 case 47: | |
714 if (masteryLevel == 0) | |
715 { | |
716 LOWORD(v48) = 0; | |
717 } | |
718 else if (masteryLevel == 1 || masteryLevel == 2) | |
719 { | |
720 v48 = 2 * realPoints + 40; | |
721 } | |
722 else if (masteryLevel == 3 ) | |
723 { | |
724 v48 = 3 * realPoints + 60; | |
725 } | |
726 else if (masteryLevel == 4 ) | |
727 { | |
728 LOWORD(v48) = 2 * (3 * realPoints + 60); | |
729 } | |
730 v5->pActorBuffs[11].Apply(pParty->uTimePlayed + 1280, masteryLevel, v48, 0, 0); | |
731 pGame->pStru6Instance->_4A7E89_sparkles_on_actor_after_it_casts_buff(v5,0xC8C805u); | |
732 v50 = 8 * LODWORD(v120); | |
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; | |
738 | |
739 case 51: | |
740 if (masteryLevel == 0) | |
741 { | |
742 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( | |
760 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v54 << 7) * 0.033333335), | |
761 masteryLevel, | |
762 realPoints + 5, | |
763 0, | |
764 0); | |
765 pGame->pStru6Instance->_4A7E89_sparkles_on_actor_after_it_casts_buff(v5,0xC8C805u); | |
766 v55 = 8 * LODWORD(v120); | |
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; | |
772 | |
773 case 73: | |
774 if ( (signed int)masteryLevel <= 0 || (signed int)masteryLevel > 4 ) | |
775 v51 = 0; | |
776 else | |
777 v51 = 3600 * realPoints; | |
778 v5->pActorBuffs[21].Apply( | |
779 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v51 << 7) * 0.033333335), | |
780 masteryLevel, | |
781 realPoints, | |
782 0, | |
783 0); | |
784 pGame->pStru6Instance->_4A7E89_sparkles_on_actor_after_it_casts_buff(v5, 0xA81376u); | |
785 v52 = 8 * LODWORD(v120); | |
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; | |
791 | |
792 case 77: | |
793 v5->sCurrentHP += 5 * realPoints + 10; | |
794 if ( v5->sCurrentHP >= (signed int)v5->pMonsterInfo.uHP ) | |
795 v5->sCurrentHP = LOWORD(v5->pMonsterInfo.uHP); | |
796 pGame->pStru6Instance->_4A7E89_sparkles_on_actor_after_it_casts_buff(v5, 0xA81376u); | |
797 v50 = 8 * LODWORD(v120); | |
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; | |
803 | |
804 case 80: | |
759 for (int i = 0; i < 20; i++ ) | 805 for (int i = 0; i < 20; i++ ) |
760 { | 806 { |
761 pParty->pPartyBuffs[i].Reset(); | 807 pParty->pPartyBuffs[i].Reset(); |
762 } | 808 } |
763 for (int i = 1; i <= 4; i++) | 809 for (int i = 1; i <= 4; i++) |
783 v99 = v65; | 829 v99 = v65; |
784 v22 = (SoundID)word_4EE088_sound_ids[80]; | 830 v22 = (SoundID)word_4EE088_sound_ids[80]; |
785 v98 = v22; | 831 v98 = v22; |
786 pAudioPlayer->PlaySound(v98, v99, 0, -1, 0, 0, 0, 0); | 832 pAudioPlayer->PlaySound(v98, v99, 0, -1, 0, 0, 0, 0); |
787 return; | 833 return; |
788 } | 834 |
789 if ( uSpellID != 51 ) | 835 case 85: |
790 { | 836 if (masteryLevel == 0) |
791 if ( uSpellID == 73 ) | 837 { |
792 { | 838 LOWORD(realPoints) = uSkillLevel; |
793 if ( (signed int)masteryLevel <= 0 || (signed int)masteryLevel > 4 ) | 839 v96 = 0; |
794 v51 = 0; | 840 } |
795 else | 841 else if (masteryLevel == 1 || masteryLevel == 2) |
796 v51 = 3600 * realPoints; | 842 { |
797 v5->pActorBuffs[21].Apply( | 843 v96 = 300 * realPoints + 3840; |
798 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v51 << 7) * 0.033333335), | 844 } |
799 masteryLevel, | 845 else if (masteryLevel == 3 ) |
800 realPoints, | 846 { |
801 0, | 847 LOWORD(realPoints) = 3 * realPoints; |
802 0); | 848 v96 = 900 * (uSkillLevel & 0x3F) + 3840; |
803 pGame->pStru6Instance->_4A7E89_sparkles_on_actor_after_it_casts_buff(v5, 0xA81376u); | 849 } |
804 v52 = 8 * LODWORD(v120); | 850 else if (masteryLevel == 4 ) |
805 LOBYTE(v52) = PID(OBJECT_Actor,LOBYTE(v120)); | 851 { |
806 v99 = v52; | 852 v96 = 1200 * realPoints + 3840; |
807 v98 = (SoundID)16060; | 853 LOWORD(realPoints) = 4 * realPoints; |
854 } | |
855 v5->pActorBuffs[13].Apply( | |
856 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v96 << 7) * 0.033333335), | |
857 masteryLevel, | |
858 realPoints, | |
859 0, | |
860 0); | |
861 pGame->pStru6Instance->_4A7E89_sparkles_on_actor_after_it_casts_buff(v5, 0xFFFFFFu); | |
862 v97 = 8 * LODWORD(v120); | |
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; | |
868 | |
869 case 86: | |
870 if (masteryLevel == 0) | |
871 { | |
872 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( | |
890 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v94 << 7) * 0.033333335), | |
891 masteryLevel, | |
892 realPoints + 5, | |
893 0, | |
894 0); | |
895 pGame->pStru6Instance->_4A7E89_sparkles_on_actor_after_it_casts_buff(v5, 0xFFFFFFu); | |
896 v95 = 8 * LODWORD(v120); | |
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; | |
902 | |
903 case 93: | |
904 v70 = 3; | |
905 if (masteryLevel == 2) | |
906 v108 = 5; | |
907 else if (masteryLevel == 3) | |
908 v108 = 7; | |
909 else if (masteryLevel == 4) | |
910 v108 = 9; | |
911 | |
912 spellnume = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360; | |
913 a1.uType = stru_4E3ACC[SPELL_DARK_SHARPMETAL].uType; | |
914 v116 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (v70 - 1); | |
915 v71 = 0; | |
916 for (int i = 0; i < pObjectList->uNumObjects; i++) | |
917 { | |
918 if (pObjectList->pObjects[i].uObjectID == stru_4E3ACC[SPELL_DARK_SHARPMETAL].uType) | |
919 { | |
920 v71 = i; | |
921 break; | |
922 } | |
923 } | |
924 a1.uObjectDescID = v71; | |
925 a1.stru_24.Reset(); | |
926 a1.spell_id = SPELL_DARK_SHARPMETAL; | |
927 v73 = v5->vPosition.x; | |
928 v74 = v5->vPosition.y; | |
929 a1.spell_level = uSkillLevel; | |
930 a1.vPosition.x = v73; | |
931 v75 = v5->vPosition.z + ((signed int)v5->uActorHeight >> 1); | |
932 v76 = v117; | |
933 v77 = LOWORD(v117->uYawAngle); | |
934 a1.spell_skill = 0; | |
935 a1.vPosition.y = v74; | |
936 a1.vPosition.z = v75; | |
937 a1.uFacing = v77; | |
938 a1.uSoundID = 0; | |
939 a1.uAttributes = 0; | |
940 a1.uSectorID = pIndoor->GetSector(v73, v74, v75); | |
941 a1.spell_caster_pid = PID(OBJECT_Actor, LODWORD(v120)); | |
942 a1.uSpriteFrameID = 0; | |
943 a1.spell_target_pid = 0; | |
944 a1.field_60_distance_related_prolly_lod = 3; | |
945 a1c = spellnume / -2; | |
946 if ( spellnume / -2 > spellnume / 2 ) | |
947 { | |
948 v80 = spellnume / -2; | |
949 } | |
950 else | |
951 { | |
952 do | |
953 { | |
954 v79 = v76->uYawAngle; | |
955 a1.uFacing = a1c + LOWORD(v76->uYawAngle); | |
956 v80 = a1.Create( | |
957 v79, | |
958 v76->uPitchAngle, | |
959 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
960 0); | |
961 a1c += v116; | |
962 } | |
963 while ( a1c <= spellnume / 2 ); | |
964 } | |
965 if ( v80 != -1 ) | |
966 { | |
967 v81 = 8 * v80; | |
968 LOBYTE(v81) = v81 | 2; | |
969 v99 = v81; | |
970 v22 = (SoundID)word_4EE088_sound_ids[93]; | |
971 v98 = v22; | |
808 pAudioPlayer->PlaySound(v98, v99, 0, -1, 0, 0, 0, 0); | 972 pAudioPlayer->PlaySound(v98, v99, 0, -1, 0, 0, 0, 0); |
809 return; | 973 return; |
810 } | 974 } |
811 if ( uSpellID == 77 ) | 975 |
812 { | 976 case 95: |
813 v5->sCurrentHP += 5 * realPoints + 10; | 977 if (masteryLevel == 0) |
814 if ( v5->sCurrentHP >= (signed int)v5->pMonsterInfo.uHP ) | 978 v68 = 0; |
815 v5->sCurrentHP = LOWORD(v5->pMonsterInfo.uHP); | 979 else if (masteryLevel == 1 || (masteryLevel == 2) || (masteryLevel == 3)) |
816 pGame->pStru6Instance->_4A7E89_sparkles_on_actor_after_it_casts_buff(v5, 0xA81376u); | 980 { |
817 v50 = 8 * LODWORD(v120); | 981 v67 = 900 * realPoints; |
818 LOBYTE(v50) = PID(OBJECT_Actor,LOBYTE(v120)); | 982 v68 = v67 + 3840; |
819 v99 = v50; | 983 } |
820 v98 = (SoundID)14020; | 984 else |
821 pAudioPlayer->PlaySound(v98, v99, 0, -1, 0, 0, 0, 0); | 985 { |
822 return; | 986 v67 = 300 * realPoints; |
823 } | 987 v68 = v67 + 3840; |
988 } | |
989 v5->pActorBuffs[20].Apply( | |
990 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v68 << 7) * 0.033333335), | |
991 masteryLevel, | |
992 0, | |
993 0, | |
994 0); | |
995 pGame->pStru6Instance->_4A7E89_sparkles_on_actor_after_it_casts_buff(v5,0x7E7E7Eu); | |
996 v69 = 8 * LODWORD(v120); | |
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); | |
824 return; | 1001 return; |
825 } | 1002 } |
826 if (masteryLevel == 0) | 1003 |
827 { | |
828 v54 = 0; | |
829 } | |
830 else if (masteryLevel == 1 || masteryLevel == 2) | |
831 { | |
832 v53 = 300 * realPoints; | |
833 v54 = v53 + 3840; | |
834 } | |
835 else if (masteryLevel == 3 ) | |
836 { | |
837 v53 = 900 * realPoints; | |
838 v54 = v53 + 3840; | |
839 } | |
840 else if (masteryLevel == 4 ) | |
841 { | |
842 v53 = 1200 * realPoints; | |
843 v54 = v53 + 3840; | |
844 } | |
845 v5->pActorBuffs[18].Apply( | |
846 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v54 << 7) * 0.033333335), | |
847 masteryLevel, | |
848 realPoints + 5, | |
849 0, | |
850 0); | |
851 pGame->pStru6Instance->_4A7E89_sparkles_on_actor_after_it_casts_buff(v5,0xC8C805u); | |
852 v55 = 8 * LODWORD(v120); | |
853 LOBYTE(v55) = PID(OBJECT_Actor,LOBYTE(v120)); | |
854 v99 = v55; | |
855 v98 = (SoundID)14060; | |
856 pAudioPlayer->PlaySound(v98, v99, 0, -1, 0, 0, 0, 0); | |
857 return; | |
858 } | |
859 if ( uSpellID == 85 ) | |
860 { | |
861 if (masteryLevel == 0) | |
862 { | |
863 LOWORD(realPoints) = uSkillLevel; | |
864 v96 = 0; | |
865 } | |
866 else if (masteryLevel == 1 || masteryLevel == 2) | |
867 { | |
868 v96 = 300 * realPoints + 3840; | |
869 } | |
870 else if (masteryLevel == 3 ) | |
871 { | |
872 LOWORD(realPoints) = 3 * realPoints; | |
873 v96 = 900 * (uSkillLevel & 0x3F) + 3840; | |
874 } | |
875 else if (masteryLevel == 4 ) | |
876 { | |
877 v96 = 1200 * realPoints + 3840; | |
878 LOWORD(realPoints) = 4 * realPoints; | |
879 } | |
880 v5->pActorBuffs[13].Apply( | |
881 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v96 << 7) * 0.033333335), | |
882 masteryLevel, | |
883 realPoints, | |
884 0, | |
885 0); | |
886 pGame->pStru6Instance->_4A7E89_sparkles_on_actor_after_it_casts_buff(v5, 0xFFFFFFu); | |
887 v97 = 8 * LODWORD(v120); | |
888 LOBYTE(v97) = PID(OBJECT_Actor,LOBYTE(v120)); | |
889 v99 = v97; | |
890 v98 = (SoundID)17070; | |
891 pAudioPlayer->PlaySound(v98, v99, 0, -1, 0, 0, 0, 0); | |
892 return; | |
893 } | |
894 if ( uSpellID == 86 ) | |
895 { | |
896 if (masteryLevel == 0) | |
897 { | |
898 v94 = 0; | |
899 } | |
900 else if (masteryLevel == 1 || masteryLevel == 2) | |
901 { | |
902 v93 = 300 * realPoints; | |
903 v94 = v93 + 3840; | |
904 } | |
905 else if (masteryLevel == 3) | |
906 { | |
907 v93 = 900 * realPoints; | |
908 v94 = v93 + 3840; | |
909 } | |
910 else // if (v7 == 4) | |
911 { | |
912 v93 = 1200 * realPoints; | |
913 v94 = v93 + 3840; | |
914 } | |
915 v5->pActorBuffs[14].Apply( | |
916 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v94 << 7) * 0.033333335), | |
917 masteryLevel, | |
918 realPoints + 5, | |
919 0, | |
920 0); | |
921 pGame->pStru6Instance->_4A7E89_sparkles_on_actor_after_it_casts_buff(v5, 0xFFFFFFu); | |
922 v95 = 8 * LODWORD(v120); | |
923 LOBYTE(v95) = PID(OBJECT_Actor,LOBYTE(v120)); | |
924 v99 = v95; | |
925 v98 = (SoundID)17080; | |
926 pAudioPlayer->PlaySound(v98, v99, 0, -1, 0, 0, 0, 0); | |
927 return; | |
928 } | |
929 if ( uSpellID != 93 ) | |
930 { | |
931 if ( uSpellID != 95 ) | |
932 { | |
933 return; | |
934 } | |
935 if (masteryLevel == 0) | |
936 v68 = 0; | |
937 else if (masteryLevel == 1 || (masteryLevel == 2) || (masteryLevel == 3)) | |
938 { | |
939 v67 = 900 * realPoints; | |
940 v68 = v67 + 3840; | |
941 } | |
942 else | |
943 { | |
944 v67 = 300 * realPoints; | |
945 v68 = v67 + 3840; | |
946 } | |
947 v5->pActorBuffs[20].Apply( | |
948 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v68 << 7) * 0.033333335), | |
949 masteryLevel, | |
950 0, | |
951 0, | |
952 0); | |
953 pGame->pStru6Instance->_4A7E89_sparkles_on_actor_after_it_casts_buff(v5,0x7E7E7Eu); | |
954 v69 = 8 * LODWORD(v120); | |
955 LOBYTE(v69) = PID(OBJECT_Actor,LOBYTE(v120)); | |
956 v99 = v69; | |
957 v98 = (SoundID)18060; | |
958 pAudioPlayer->PlaySound(v98, v99, 0, -1, 0, 0, 0, 0); | |
959 return; | |
960 } | |
961 | |
962 v70 = 3; | |
963 if (masteryLevel == 2) | |
964 v108 = 5; | |
965 else if (masteryLevel == 3) | |
966 v108 = 7; | |
967 else if (masteryLevel == 4) | |
968 v108 = 9; | |
969 | |
970 spellnume = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360; | |
971 a1.uType = stru_4E3ACC[SPELL_DARK_SHARPMETAL].uType; | |
972 v116 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (v70 - 1); | |
973 v71 = 0; | |
974 for (int i = 0; i < pObjectList->uNumObjects; i++) | |
975 { | |
976 if (pObjectList->pObjects[i].uObjectID == stru_4E3ACC[SPELL_DARK_SHARPMETAL].uType) | |
977 { | |
978 v71 = i; | |
979 break; | |
980 } | |
981 } | |
982 a1.uObjectDescID = v71; | |
983 a1.stru_24.Reset(); | |
984 a1.spell_id = SPELL_DARK_SHARPMETAL; | |
985 v73 = v5->vPosition.x; | |
986 v74 = v5->vPosition.y; | |
987 a1.spell_level = uSkillLevel; | |
988 a1.vPosition.x = v73; | |
989 v75 = v5->vPosition.z + ((signed int)v5->uActorHeight >> 1); | |
990 v76 = v117; | |
991 v77 = LOWORD(v117->uYawAngle); | |
992 a1.spell_skill = 0; | |
993 a1.vPosition.y = v74; | |
994 a1.vPosition.z = v75; | |
995 a1.uFacing = v77; | |
996 a1.uSoundID = 0; | |
997 a1.uAttributes = 0; | |
998 a1.uSectorID = pIndoor->GetSector(v73, v74, v75); | |
999 a1.spell_caster_pid = PID(OBJECT_Actor, LODWORD(v120)); | |
1000 a1.uSpriteFrameID = 0; | |
1001 a1.spell_target_pid = 0; | |
1002 a1.field_60_distance_related_prolly_lod = 3; | |
1003 a1c = spellnume / -2; | |
1004 if ( spellnume / -2 > spellnume / 2 ) | |
1005 { | |
1006 v80 = spellnume / -2; | |
1007 } | |
1008 else | |
1009 { | |
1010 do | |
1011 { | |
1012 v79 = v76->uYawAngle; | |
1013 a1.uFacing = a1c + LOWORD(v76->uYawAngle); | |
1014 v80 = a1.Create( | |
1015 v79, | |
1016 v76->uPitchAngle, | |
1017 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | |
1018 0); | |
1019 a1c += v116; | |
1020 } | |
1021 while ( a1c <= spellnume / 2 ); | |
1022 } | |
1023 if ( v80 != -1 ) | |
1024 { | |
1025 v81 = 8 * v80; | |
1026 LOBYTE(v81) = v81 | 2; | |
1027 v99 = v81; | |
1028 v22 = (SoundID)word_4EE088_sound_ids[93]; | |
1029 v98 = v22; | |
1030 pAudioPlayer->PlaySound(v98, v99, 0, -1, 0, 0, 0, 0); | |
1031 return; | |
1032 } | |
1033 } | 1004 } |
1034 | 1005 |
1035 //----- (0043ABB0) -------------------------------------------------------- | 1006 //----- (0043ABB0) -------------------------------------------------------- |
1036 bool Actor::ArePeasantsOfSameFaction(Actor *a1, Actor *a2) | 1007 bool Actor::ArePeasantsOfSameFaction(Actor *a1, Actor *a2) |
1037 { | 1008 { |