comparison Actor.cpp @ 1519:4c787c28ddce

Clean CastSpellInfo. (2)
author yoctozepto
date Wed, 04 Sep 2013 16:00:15 +0200
parents c3da3c2985b8
children 61458df2cb4f
comparison
equal deleted inserted replaced
1518:091c5eb46a0e 1519:4c787c28ddce
292 } 292 }
293 v1->uAttributes |= 0x800000; 293 v1->uAttributes |= 0x800000;
294 } 294 }
295 295
296 //----- (00404AC7) -------------------------------------------------------- 296 //----- (00404AC7) --------------------------------------------------------
297 void __fastcall Actor::AI_SpellAttack(unsigned int uActorID, AIDirection *pDir, int spellnum, int a4, unsigned int uSkillLevel) 297 void __fastcall Actor::AI_SpellAttack(unsigned int uActorID, AIDirection *pDir, int uSpellID, int a4, unsigned int uSkillLevel)
298 { 298 {
299 Actor *v5; // esi@1 299 Actor *v5; // esi@1
300 unsigned int v6; // edi@1 300 unsigned int v6; // edi@1
301 unsigned int v7; // eax@1 301 unsigned int v7; // eax@1
302 int v8; // edi@16 302 int v8; // edi@16
424 LODWORD(v120) = uActorID; 424 LODWORD(v120) = uActorID;
425 v5 = &pActors[uActorID]; 425 v5 = &pActors[uActorID];
426 v117 = pDir; 426 v117 = pDir;
427 v6 = uSkillLevel & 0x3F; 427 v6 = uSkillLevel & 0x3F;
428 v7 = SkillToMastery(uSkillLevel); 428 v7 = SkillToMastery(uSkillLevel);
429 if ( spellnum <= 47 ) 429 if ( uSpellID <= 47 )
430 { 430 {
431 if ( spellnum != 47 ) 431 if ( uSpellID != 47 )
432 { 432 {
433 if ( spellnum <= 18 ) 433 if ( uSpellID <= 18 )
434 { 434 {
435 if ( spellnum == 18 || spellnum == 2 ) 435 if ( uSpellID == 18 || uSpellID == 2 )
436 goto LABEL_159; 436 goto LABEL_159;
437 if ( spellnum != 5 ) 437 if ( uSpellID != 5 )
438 { 438 {
439 if ( spellnum == 6 ) 439 if ( uSpellID == 6 )
440 goto LABEL_159; 440 goto LABEL_159;
441 if ( spellnum != 9 ) 441 if ( uSpellID != 9 )
442 { 442 {
443 if ( spellnum != 11 ) 443 if ( uSpellID != 11 )
444 { 444 {
445 if ( spellnum != 15 ) 445 if ( uSpellID != 15 )
446 { 446 {
447 if ( spellnum != 17 ) 447 if ( uSpellID != 17 )
448 return; 448 return;
449 if ( (signed int)v7 <= 0 ) 449 if ( (signed int)v7 <= 0 )
450 goto LABEL_20; 450 goto LABEL_20;
451 if ( (signed int)v7 <= 2 ) 451 if ( (signed int)v7 <= 2 )
452 { 452 {
575 goto LABEL_222; 575 goto LABEL_222;
576 } 576 }
577 return; 577 return;
578 } 578 }
579 LABEL_159: 579 LABEL_159:
580 a1.uType = stru_4E3ACC[spellnum].uType; 580 a1.uType = stru_4E3ACC[uSpellID].uType;
581 v119 = 0.0; 581 v119 = 0.0;
582 if ( (signed int)pObjectList->uNumObjects <= 0 ) 582 if ( (signed int)pObjectList->uNumObjects <= 0 )
583 { 583 {
584 LABEL_191: 584 LABEL_191:
585 v82 = 0; 585 v82 = 0;
596 } 596 }
597 v82 = LOWORD(v119); 597 v82 = LOWORD(v119);
598 } 598 }
599 a1.uObjectDescID = v82; 599 a1.uObjectDescID = v82;
600 a1.stru_24.Reset(); 600 a1.stru_24.Reset();
601 a1.spell_id = spellnum; 601 a1.spell_id = uSpellID;
602 v83 = v5->vPosition.x; 602 v83 = v5->vPosition.x;
603 v84 = v5->vPosition.y; 603 v84 = v5->vPosition.y;
604 a1.spell_level = uSkillLevel; 604 a1.spell_level = uSkillLevel;
605 a1.vPosition.x = v83; 605 a1.vPosition.x = v83;
606 v85 = v5->vPosition.z + ((signed int)v5->uActorHeight >> 1); 606 v85 = v5->vPosition.z + ((signed int)v5->uActorHeight >> 1);
658 v92 = 8 * v91; 658 v92 = 8 * v91;
659 v101 = -1; 659 v101 = -1;
660 LOBYTE(v92) = v92 | 2; 660 LOBYTE(v92) = v92 | 2;
661 v100 = 0; 661 v100 = 0;
662 v99 = v92; 662 v99 = v92;
663 v22 = (SoundID)word_4EE088_sound_ids[spellnum]; 663 v22 = (SoundID)word_4EE088_sound_ids[uSpellID];
664 goto LABEL_202; 664 goto LABEL_202;
665 } 665 }
666 return; 666 return;
667 } 667 }
668 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) 668 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
842 } 842 }
843 } 843 }
844 v39 = 0; 844 v39 = 0;
845 goto LABEL_79; 845 goto LABEL_79;
846 } 846 }
847 if ( spellnum == 26 || spellnum == 29 ) 847 if ( uSpellID == 26 || uSpellID == 29 )
848 goto LABEL_159; 848 goto LABEL_159;
849 if ( spellnum != 38 ) 849 if ( uSpellID != 38 )
850 { 850 {
851 if ( spellnum == 39 || spellnum == 41 ) 851 if ( uSpellID == 39 || uSpellID == 41 )
852 goto LABEL_159; 852 goto LABEL_159;
853 if ( spellnum != 46 ) 853 if ( uSpellID != 46 )
854 return; 854 return;
855 if ( (signed int)v7 > 0 ) 855 if ( (signed int)v7 > 0 )
856 { 856 {
857 if ( (signed int)v7 <= 2 ) 857 if ( (signed int)v7 <= 2 )
858 { 858 {
969 } 969 }
970 } 970 }
971 LOWORD(v48) = 0; 971 LOWORD(v48) = 0;
972 goto LABEL_114; 972 goto LABEL_114;
973 } 973 }
974 if ( spellnum <= 80 ) 974 if ( uSpellID <= 80 )
975 { 975 {
976 if ( spellnum == 80 ) 976 if ( uSpellID == 80 )
977 { 977 {
978 v56 = pParty->pPartyBuffs; 978 v56 = pParty->pPartyBuffs;
979 do 979 do
980 { 980 {
981 v56->Reset(); 981 v56->Reset();
1017 v100 = 0; 1017 v100 = 0;
1018 v99 = v65; 1018 v99 = v65;
1019 v22 = (SoundID)word_4EE088_sound_ids[80]; 1019 v22 = (SoundID)word_4EE088_sound_ids[80];
1020 goto LABEL_202; 1020 goto LABEL_202;
1021 } 1021 }
1022 if ( spellnum != 51 ) 1022 if ( uSpellID != 51 )
1023 { 1023 {
1024 if ( spellnum == 57 || spellnum == 65 || spellnum == 70 ) 1024 if ( uSpellID == 57 || uSpellID == 65 || uSpellID == 70 )
1025 goto LABEL_159; 1025 goto LABEL_159;
1026 if ( spellnum == 73 ) 1026 if ( uSpellID == 73 )
1027 { 1027 {
1028 if ( (signed int)v7 <= 0 || (signed int)v7 > 4 ) 1028 if ( (signed int)v7 <= 0 || (signed int)v7 > 4 )
1029 v51 = 0; 1029 v51 = 0;
1030 else 1030 else
1031 v51 = 3600 * v6; 1031 v51 = 3600 * v6;
1046 v100 = 0; 1046 v100 = 0;
1047 v99 = v52; 1047 v99 = v52;
1048 v98 = (SoundID)16060; 1048 v98 = (SoundID)16060;
1049 goto LABEL_222; 1049 goto LABEL_222;
1050 } 1050 }
1051 if ( spellnum == 77 ) 1051 if ( uSpellID == 77 )
1052 { 1052 {
1053 v5->sCurrentHP += 5 * v6 + 10; 1053 v5->sCurrentHP += 5 * v6 + 10;
1054 if ( v5->sCurrentHP >= (signed int)v5->pMonsterInfo.uHP ) 1054 if ( v5->sCurrentHP >= (signed int)v5->pMonsterInfo.uHP )
1055 v5->sCurrentHP = LOWORD(v5->pMonsterInfo.uHP); 1055 v5->sCurrentHP = LOWORD(v5->pMonsterInfo.uHP);
1056 pGame->pStru6Instance->_4A7E89_sparkles_on_actor_after_it_casts_buff(v5, 0xA81376u); 1056 pGame->pStru6Instance->_4A7E89_sparkles_on_actor_after_it_casts_buff(v5, 0xA81376u);
1057 v47 = 0; 1057 v47 = 0;
1058 goto LABEL_127; 1058 goto LABEL_127;
1059 } 1059 }
1060 v49 = spellnum == 78; 1060 v49 = uSpellID == 78;
1061 LABEL_158: 1061 LABEL_158:
1062 if ( !v49 ) 1062 if ( !v49 )
1063 return; 1063 return;
1064 goto LABEL_159; 1064 goto LABEL_159;
1065 } 1065 }
1102 } 1102 }
1103 } 1103 }
1104 v54 = 0; 1104 v54 = 0;
1105 goto LABEL_142; 1105 goto LABEL_142;
1106 } 1106 }
1107 if ( spellnum == 85 ) 1107 if ( uSpellID == 85 )
1108 { 1108 {
1109 if ( (signed int)v7 > 0 ) 1109 if ( (signed int)v7 > 0 )
1110 { 1110 {
1111 if ( (signed int)v7 <= 2 ) 1111 if ( (signed int)v7 <= 2 )
1112 { 1112 {
1146 } 1146 }
1147 LOWORD(v6) = uSkillLevel; 1147 LOWORD(v6) = uSkillLevel;
1148 v96 = 0; 1148 v96 = 0;
1149 goto LABEL_221; 1149 goto LABEL_221;
1150 } 1150 }
1151 if ( spellnum == 86 ) 1151 if ( uSpellID == 86 )
1152 { 1152 {
1153 if ( (signed int)v7 > 0 ) 1153 if ( (signed int)v7 > 0 )
1154 { 1154 {
1155 if ( (signed int)v7 <= 2 ) 1155 if ( (signed int)v7 <= 2 )
1156 { 1156 {
1189 } 1189 }
1190 } 1190 }
1191 v94 = 0; 1191 v94 = 0;
1192 goto LABEL_212; 1192 goto LABEL_212;
1193 } 1193 }
1194 if ( spellnum == 90 ) 1194 if ( uSpellID == 90 )
1195 goto LABEL_159; 1195 goto LABEL_159;
1196 if ( spellnum != 93 ) 1196 if ( uSpellID != 93 )
1197 { 1197 {
1198 if ( spellnum != 95 ) 1198 if ( uSpellID != 95 )
1199 { 1199 {
1200 v49 = spellnum == 97; 1200 v49 = uSpellID == 97;
1201 goto LABEL_158; 1201 goto LABEL_158;
1202 } 1202 }
1203 if ( (signed int)v7 > 0 ) 1203 if ( (signed int)v7 > 0 )
1204 { 1204 {
1205 if ( (signed int)v7 <= 3 ) 1205 if ( (signed int)v7 <= 3 )