comparison mm7_6.cpp @ 726:9d13d2ec35a6

Слияние
author Ritor1
date Fri, 22 Mar 2013 01:29:46 +0600
parents f39d5902c85a 735dab8d3c9a
children 6daaa2f18d0d
comparison
equal deleted inserted replaced
725:7037f22cd716 726:9d13d2ec35a6
2164 //----- (00427769) -------------------------------------------------------- 2164 //----- (00427769) --------------------------------------------------------
2165 bool __fastcall sub_427769_spell(unsigned int uSpellID) 2165 bool __fastcall sub_427769_spell(unsigned int uSpellID)
2166 { 2166 {
2167 bool result; // eax@2 2167 bool result; // eax@2
2168 2168
2169 __debugbreak(); // refactor
2169 if ( *(&pSpellDatas[0].field_12 + 20 * uSpellID) & 0xC ) 2170 if ( *(&pSpellDatas[0].field_12 + 20 * uSpellID) & 0xC )
2170 result = 1; 2171 result = 1;
2171 else 2172 else
2172 result = 0; 2173 result = 0;
2173 return result; 2174 return result;
2614 int v61; // ecx@184 2615 int v61; // ecx@184
2615 int v62; // eax@186 2616 int v62; // eax@186
2616 int v63; // ecx@187 2617 int v63; // ecx@187
2617 int v64; // ecx@188 2618 int v64; // ecx@188
2618 int v65; // ecx@189 2619 int v65; // ecx@189
2619 const char *v66; // ecx@200 2620 //const char *v66; // ecx@200
2620 unsigned int v67; // edx@201 2621 //unsigned int v67; // edx@201
2621 char v68; // al@207 2622 char v68; // al@207
2622 ItemGen *v69; // esi@211 2623 ItemGen *v69; // esi@211
2623 int v70; // ecx@214 2624 int v70; // ecx@214
2624 int v71; // ecx@215 2625 int v71; // ecx@215
2625 int v72; // ecx@216 2626 int v72; // ecx@216
2738 int v185; // ecx@359 2739 int v185; // ecx@359
2739 int v186; // ecx@360 2740 int v186; // ecx@360
2740 int v187; // eax@367 2741 int v187; // eax@367
2741 int v188; // esi@369 2742 int v188; // esi@369
2742 int v189; // edi@369 2743 int v189; // edi@369
2743 const char *v190; // ecx@377 2744 //const char *v190; // ecx@377
2744 signed int v191; // edi@379 2745 signed int v191; // edi@379
2745 int v192; // ecx@382 2746 int v192; // ecx@382
2746 int v193; // ecx@383 2747 int v193; // ecx@383
2747 int v194; // ecx@384 2748 int v194; // ecx@384
2748 int v195; // eax@386 2749 int v195; // eax@386
3611 --v730; 3612 --v730;
3612 } 3613 }
3613 while ( v730 );*/ 3614 while ( v730 );*/
3614 } 3615 }
3615 if ( SHIDWORD(v733) > amount ) 3616 if ( SHIDWORD(v733) > amount )
3616 goto LABEL_200; 3617 {
3618 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
3619 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
3620 goto LABEL_203;
3621 }
3617 if ( !pPlayer->CanCastSpell(uRequiredMana) ) 3622 if ( !pPlayer->CanCastSpell(uRequiredMana) )
3618 goto play_sound_and_continue; 3623 goto play_sound_and_continue;
3619 3624
3620 a1.stru_24.Reset(); 3625 a1.stru_24.Reset();
3621 a1.field_48 = v3->spellnum; 3626 a1.field_48 = v3->spellnum;
3642 LOBYTE(a1.uAttributes) |= 4u; 3647 LOBYTE(a1.uAttributes) |= 4u;
3643 v669 = v3->uPlayerID + 1; 3648 v669 = v3->uPlayerID + 1;
3644 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; 3649 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed;
3645 v35 = pParty->sRotationX + 10; 3650 v35 = pParty->sRotationX + 10;
3646 goto LABEL_124; 3651 goto LABEL_124;
3652
3647 case 20: 3653 case 20:
3648 if ( !pPlayer->CanCastSpell(uRequiredMana) ) 3654 if ( !pPlayer->CanCastSpell(uRequiredMana) )
3649 goto play_sound_and_continue; 3655 goto play_sound_and_continue;
3650 if (!a2) 3656 if (!a2)
3651 goto LABEL_200; 3657 {
3658 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
3659 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
3660 goto LABEL_203;
3661 }
3652 if ( (a2 & 7) != OBJECT_Actor) 3662 if ( (a2 & 7) != OBJECT_Actor)
3653 goto LABEL_1056; 3663 goto LABEL_1056;
3654 v699 = 0; 3664 v699 = 0;
3655 v698 = 0; 3665 v698 = 0;
3656 v697 = 0; 3666 v697 = 0;
3751 LOWORD(v49) = LOWORD(v3->field_10); 3761 LOWORD(v49) = LOWORD(v3->field_10);
3752 LOBYTE(a1.uAttributes) |= 0x80u; 3762 LOBYTE(a1.uAttributes) |= 0x80u;
3753 a1.uSoundID = v49; 3763 a1.uSoundID = v49;
3754 v726 = (Player *)a1.Create(0, 0, 0, 0); 3764 v726 = (Player *)a1.Create(0, 0, 0, 0);
3755 if ( !MonsterStats::BelongsToSupertype(*(short *)(HIDWORD(v733) + 96), MONSTER_SUPERTYPE_UNDEAD) ) 3765 if ( !MonsterStats::BelongsToSupertype(*(short *)(HIDWORD(v733) + 96), MONSTER_SUPERTYPE_UNDEAD) )
3756 goto LABEL_200; 3766 {
3767 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
3768 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
3769 goto LABEL_203;
3770 }
3757 v47 = v730; 3771 v47 = v730;
3758 v670 = (Vec3_int_ *)&v691; 3772 v670 = (Vec3_int_ *)&v691;
3759 v42 = (signed int)v726; 3773 v42 = (signed int)v726;
3760 LABEL_139: 3774 LABEL_139:
3761 DamageMonsterFromParty(8 * v42 | 2, v47, v670); 3775 DamageMonsterFromParty(8 * v42 | 2, v47, v670);
3818 v660 = pParty->vPosition.y; 3832 v660 = pParty->vPosition.y;
3819 goto LABEL_153; 3833 goto LABEL_153;
3820 case 87: 3834 case 87:
3821 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor 3835 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor
3822 || uCurrentlyLoadedLevelType == LEVEL_Outdoor && (pParty->uCurrentHour < 5 || pParty->uCurrentHour >= 0x15) ) 3836 || uCurrentlyLoadedLevelType == LEVEL_Outdoor && (pParty->uCurrentHour < 5 || pParty->uCurrentHour >= 0x15) )
3823 goto LABEL_200; 3837 {
3838 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
3839 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
3840 goto LABEL_203;
3841 }
3824 if ( pPlayer->CanCastSpell(uRequiredMana) ) 3842 if ( pPlayer->CanCastSpell(uRequiredMana) )
3825 goto LABEL_152; 3843 goto LABEL_152;
3826 goto play_sound_and_continue; 3844 goto play_sound_and_continue;
3827 case 81: 3845 case 81:
3828 if ( !pPlayer->CanCastSpell(uRequiredMana) ) 3846 if ( !pPlayer->CanCastSpell(uRequiredMana) )
4054 } 4072 }
4055 } 4073 }
4056 } 4074 }
4057 } 4075 }
4058 } 4076 }
4059 LABEL_199: 4077
4060 dword_50C9D0 = 113; 4078 dword_50C9D0 = 113;
4061 dword_50C9D4 = 0; 4079 dword_50C9D4 = 0;
4062 dword_50C9D8 = 1; 4080 dword_50C9D8 = 1;
4063 LABEL_200: 4081
4064 v66 = pGlobalTXT_LocalizationStrings[428]; 4082 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
4065 LABEL_201:
4066 v67 = 2;
4067 LABEL_202:
4068 ShowStatusBarString(v66, v67);
4069 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); 4083 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
4070 goto LABEL_203; 4084 goto LABEL_203;
4071 4085
4072 case SPELL_BODY_REGENERATION: 4086 case SPELL_BODY_REGENERATION:
4073 v70 = v12 - 1; 4087 v70 = v12 - 1;
4441 { 4455 {
4442 _this = (ItemGen *)16; 4456 _this = (ItemGen *)16;
4443 } 4457 }
4444 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) 4458 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
4445 { 4459 {
4446 v66 = pGlobalTXT_LocalizationStrings[491]; 4460 ShowStatusBarString(pGlobalTXT_LocalizationStrings[491], 2); // Can't cast Meteor Shower indoors!
4447 goto LABEL_201; 4461 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
4462 goto LABEL_203;
4448 } 4463 }
4449 if ( !pPlayer->CanCastSpell(uRequiredMana) ) 4464 if ( !pPlayer->CanCastSpell(uRequiredMana) )
4450 goto play_sound_and_continue; 4465 goto play_sound_and_continue;
4451 LODWORD(v725) = a2 & 7; 4466 LODWORD(v725) = a2 & 7;
4452 if ( (a2 & 7) == OBJECT_Actor) 4467 if ( (a2 & 7) == OBJECT_Actor)
4531 } 4546 }
4532 while ( !v14 ); 4547 while ( !v14 );
4533 } 4548 }
4534 goto LABEL_1056; 4549 goto LABEL_1056;
4535 case 10: 4550 case 10:
4536 v67 = 2; 4551 //v67 = 2;
4537 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) 4552 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
4538 { 4553 {
4539 v66 = pGlobalTXT_LocalizationStrings[492]; 4554 ShowStatusBarString(pGlobalTXT_LocalizationStrings[492], 2); // Can't cast Inferno outdoors!
4540 goto LABEL_202; 4555 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
4556 goto LABEL_203;
4541 } 4557 }
4542 if ( !pPlayer->CanCastSpell(uRequiredMana) ) 4558 if ( !pPlayer->CanCastSpell(uRequiredMana) )
4543 goto play_sound_and_continue; 4559 goto play_sound_and_continue;
4544 v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096); 4560 v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096);
4545 v700.z = 0; 4561 v700.z = 0;
4706 } 4722 }
4707 goto LABEL_1056; 4723 goto LABEL_1056;
4708 case 16: 4724 case 16:
4709 if ( pParty->uFlags & PARTY_FLAGS_1_FALLING) 4725 if ( pParty->uFlags & PARTY_FLAGS_1_FALLING)
4710 { 4726 {
4711 v190 = pGlobalTXT_LocalizationStrings[493]; // Can't cast Jump while airborne! 4727 ShowStatusBarString(pGlobalTXT_LocalizationStrings[493], 2); // Can't cast Jump while airborne!
4712 goto LABEL_462; 4728 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
4729 goto play_sound_and_continue;
4713 } 4730 }
4714 if ( !pPlayer->CanCastSpell(uRequiredMana) ) 4731 if ( !pPlayer->CanCastSpell(uRequiredMana) )
4715 goto play_sound_and_continue; 4732 goto play_sound_and_continue;
4716 v191 = 0; 4733 v191 = 0;
4717 do 4734 do
4749 amount = 4 * v2; 4766 amount = 4 * v2;
4750 v195 = 3600 * v2; 4767 v195 = 3600 * v2;
4751 LABEL_392: 4768 LABEL_392:
4752 LODWORD(v733) = v195; 4769 LODWORD(v733) = v195;
4753 LABEL_393: 4770 LABEL_393:
4754 if ( pParty->uFlags & 0x30 ) 4771 if (pParty->uFlags & (PARTY_FLAGS_1_ALERT_RED | PARTY_FLAGS_1_ALERT_YELLOW))
4755 { 4772 {
4756 v66 = pGlobalTXT_LocalizationStrings[638]; 4773 ShowStatusBarString(pGlobalTXT_LocalizationStrings[638], 2); // There are hostile creatures nearby!
4757 goto LABEL_201; 4774 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
4775 goto LABEL_203;
4758 } 4776 }
4759 if ( pPlayer->CanCastSpell(uRequiredMana) ) 4777 if ( pPlayer->CanCastSpell(uRequiredMana) )
4760 { 4778 {
4761 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); 4779 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0);
4762 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); 4780 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1);
4767 4785
4768 pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, amount, 0, 0); 4786 pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, amount, 0, 0);
4769 LODWORD(v727) = v83; 4787 LODWORD(v727) = v83;
4770 } 4788 }
4771 goto play_sound_and_continue; 4789 goto play_sound_and_continue;
4790
4772 case 21: 4791 case 21:
4773 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) 4792 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
4774 { 4793 {
4775 v190 = pGlobalTXT_LocalizationStrings[494]; // Can not cast Fly indoors! 4794 ShowStatusBarString(pGlobalTXT_LocalizationStrings[494], 2); // Can not cast Fly indoors!
4776 LABEL_462:
4777 ShowStatusBarString(v190, 2u);
4778 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); 4795 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
4779 goto play_sound_and_continue; 4796 goto play_sound_and_continue;
4780 } 4797 }
4781 if ( !pPlayers[v3->uPlayerID + 1]->GetMaxMana() ) 4798 if ( !pPlayers[v3->uPlayerID + 1]->GetMaxMana() )
4782 { 4799 {
4783 LABEL_461: 4800 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
4784 v190 = pGlobalTXT_LocalizationStrings[428]; 4801 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
4785 goto LABEL_462; 4802 goto play_sound_and_continue;
4786 } 4803 }
4787 LODWORD(v733) = 3600 * v2; 4804 LODWORD(v733) = 3600 * v2;
4788 if ( v731 == 2 || v731 == 3 || (amount = 0, v731 != 4) ) 4805 if ( v731 == 2 || v731 == 3 || (amount = 0, v731 != 4) )
4789 amount = 1; 4806 amount = 1;
4790 if ( !pPlayer->CanCastSpell(uRequiredMana) ) 4807 if ( !pPlayer->CanCastSpell(uRequiredMana) )
4801 4818
4802 pParty->pPartyBuffs[PARTY_BUFF_FLY].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, amount, v206, v207); 4819 pParty->pPartyBuffs[PARTY_BUFF_FLY].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, amount, v206, v207);
4803 goto LABEL_1056; 4820 goto LABEL_1056;
4804 4821
4805 case 22: 4822 case 22:
4806 v67 = 2; 4823 //v67 = 2;
4807 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) 4824 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
4808 { 4825 {
4809 v66 = pGlobalTXT_LocalizationStrings[495]; 4826 ShowStatusBarString(pGlobalTXT_LocalizationStrings[495], 2); // Can't cast Starburst indoors!
4810 goto LABEL_202; 4827 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
4828 goto LABEL_203;
4811 } 4829 }
4812 if ( !pPlayer->CanCastSpell(uRequiredMana) ) 4830 if ( !pPlayer->CanCastSpell(uRequiredMana) )
4813 goto play_sound_and_continue; 4831 goto play_sound_and_continue;
4814 v208 = a2 & 7; 4832 v208 = a2 & 7;
4815 LODWORD(v725) = a2 & 7; 4833 LODWORD(v725) = a2 & 7;
5032 } 5050 }
5033 } 5051 }
5034 goto LABEL_1056; 5052 goto LABEL_1056;
5035 case 27: 5053 case 27:
5036 if ( !pPlayers[v3->uPlayerID + 1]->GetMaxMana() ) 5054 if ( !pPlayers[v3->uPlayerID + 1]->GetMaxMana() )
5037 goto LABEL_461; 5055 {
5056 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
5057 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
5058 goto play_sound_and_continue;
5059 }
5038 if ( v731 == 2 || v731 != 3 && v731 != 4 ) 5060 if ( v731 == 2 || v731 != 3 && v731 != 4 )
5039 v229 = 600 * v2; 5061 v229 = 600 * v2;
5040 else 5062 else
5041 v229 = 3600 * v2; 5063 v229 = 3600 * v2;
5042 LODWORD(v733) = v229; 5064 LODWORD(v733) = v229;
5057 v239); 5079 v239);
5058 if ( v731 == 4 ) 5080 if ( v731 == 4 )
5059 pParty->pPartyBuffs[18].uFlags = 1; 5081 pParty->pPartyBuffs[18].uFlags = 1;
5060 LODWORD(v727) = 1; 5082 LODWORD(v727) = 1;
5061 goto play_sound_and_continue; 5083 goto play_sound_and_continue;
5084
5062 case 28: 5085 case 28:
5063 if ( !pPlayer->CanCastSpell(uRequiredMana) ) 5086 if ( !pPlayer->CanCastSpell(uRequiredMana) )
5064 goto play_sound_and_continue; 5087 goto play_sound_and_continue;
5065 v240 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pInventoryItems[a2]; 5088 v240 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pInventoryItems[a2];
5066 y = v240; 5089 y = v240;
5067 if ( pItemsTable->pItems[*(int *)v240].uEquipType != 12 || v240[20] & 2 ) 5090 if ( pItemsTable->pItems[*(int *)v240].uEquipType != 12 || v240[20] & 2 )
5068 goto LABEL_199; 5091 {
5092 dword_50C9D0 = 113;
5093 dword_50C9D4 = 0;
5094 dword_50C9D8 = 1;
5095
5096 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
5097 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
5098 goto LABEL_203;
5099 }
5069 if ( v731 == 1 || v731 == 2 ) 5100 if ( v731 == 1 || v731 == 2 )
5070 { 5101 {
5071 v241 = (double)v723 * 0.0099999998 + 0.5; 5102 v241 = (double)v723 * 0.0099999998 + 0.5;
5072 } 5103 }
5073 else 5104 else
5426 if ( _this->GetValue() < 0x1C2 ) 5457 if ( _this->GetValue() < 0x1C2 )
5427 uRequiredMana = 1; 5458 uRequiredMana = 1;
5428 if ( rand() % 100 >= SHIDWORD(v733) ) 5459 if ( rand() % 100 >= SHIDWORD(v733) )
5429 uRequiredMana = 1; 5460 uRequiredMana = 1;
5430 if ( uRequiredMana != 0 ) 5461 if ( uRequiredMana != 0 )
5431 goto LABEL_199; 5462 {
5463 dword_50C9D0 = 113;
5464 dword_50C9D4 = 0;
5465 dword_50C9D8 = 1;
5466
5467 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
5468 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
5469 goto LABEL_203;
5470 }
5432 v292 = *(char *)(LODWORD(v725) + 28); 5471 v292 = *(char *)(LODWORD(v725) + 28);
5433 if ( !(v292 == 3 | v292 == 4 | v292 == 5 | v292 == 6 | v292 == 7 | v292 == 8 | v292 == 9 | v292 == 10 | v292 == 11) ) 5472 if ( !(v292 == 3 | v292 == 4 | v292 == 5 | v292 == 6 | v292 == 7 | v292 == 8 | v292 == 9 | v292 == 10 | v292 == 11) )
5434 { 5473 {
5435 v2 = v723; 5474 v2 = v723;
5436 //v1 = 0; 5475 //v1 = 0;
5437 goto LABEL_199; 5476
5477 dword_50C9D0 = 113;
5478 dword_50C9D4 = 0;
5479 dword_50C9D8 = 1;
5480
5481 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
5482 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
5483 goto LABEL_203;
5438 } 5484 }
5439 if ( rand() % 100 >= 80 ) 5485 if ( rand() % 100 >= 80 )
5440 { 5486 {
5441 v297 = pItemsTable->pSpecialEnchantments_count; 5487 v297 = pItemsTable->pSpecialEnchantments_count;
5442 v294 = _this; 5488 v294 = _this;
5504 v294->_bonus_strength = 10//pItemsTable->field_116D8[18] 5550 v294->_bonus_strength = 10//pItemsTable->field_116D8[18]
5505 + rand() % 10;//(pItemsTable->field_116D8[19] - pItemsTable->field_116D8[18] + 1); 5551 + rand() % 10;//(pItemsTable->field_116D8[19] - pItemsTable->field_116D8[18] + 1);
5506 } 5552 }
5507 v294->uAttributes |= 0x20u; 5553 v294->uAttributes |= 0x20u;
5508 goto LABEL_1055; 5554 goto LABEL_1055;
5509 case 31: 5555 case SPELL_WATER_TOWN_PORTAL:
5510 amount = 10 * v2; 5556 amount = 10 * v2;
5511 if ( pPlayer->sMana < (signed int)uRequiredMana ) 5557 if ( pPlayer->sMana < (signed int)uRequiredMana )
5512 goto play_sound_and_continue; 5558 goto play_sound_and_continue;
5513 if ( pParty->uFlags & 0x30 && v12 != 4 || rand() % 100 >= amount && v731 != 4 ) 5559 if ( pParty->uFlags & (PARTY_FLAGS_1_ALERT_RED | PARTY_FLAGS_1_ALERT_YELLOW) && v12 != 4 || rand() % 100 >= amount && v731 != 4 )
5514 goto LABEL_200; 5560 {
5515 byte_50C0C0 = LOBYTE(v3->uPlayerID); 5561 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
5516 pMessageQueue_50CBD0->AddMessage(UIMSG_C3, 0, 0); 5562 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
5563 goto LABEL_203;
5564 }
5565 town_portal_caster_id = LOBYTE(v3->uPlayerID);
5566 pMessageQueue_50CBD0->AddMessage(UIMSG_OnCastTownPortal, 0, 0);
5517 goto LABEL_1056; 5567 goto LABEL_1056;
5518 case 33: 5568 case 33:
5519 LODWORD(v733) = 604800 * v2; 5569 LODWORD(v733) = 604800 * v2;
5520 if ( !_strcmpi(pCurrentMapName, "d05.blv") ) 5570 if ( !_strcmpi(pCurrentMapName, "d05.blv") )
5521 goto LABEL_200; 5571 {
5572 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
5573 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
5574 goto LABEL_203;
5575 }
5522 v319 = uRequiredMana; 5576 v319 = uRequiredMana;
5523 if ( pPlayer->sMana >= (signed int)uRequiredMana ) 5577 if ( pPlayer->sMana >= (signed int)uRequiredMana )
5524 { 5578 {
5525 pEventTimer->Pause(); 5579 pEventTimer->Pause();
5526 pMessageQueue_50CBD0->AddMessage(UIMSG_B1, 0, 0); 5580 pMessageQueue_50CBD0->AddMessage(UIMSG_B1, 0, 0);
5593 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; 5647 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed;
5594 v654 = pParty->sRotationX; 5648 v654 = pParty->sRotationX;
5595 goto LABEL_125; 5649 goto LABEL_125;
5596 case 43: 5650 case 43:
5597 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) 5651 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
5598 goto LABEL_200; 5652 {
5653 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
5654 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
5655 goto LABEL_203;
5656 }
5599 if ( !pPlayer->CanCastSpell(uRequiredMana) ) 5657 if ( !pPlayer->CanCastSpell(uRequiredMana) )
5600 goto play_sound_and_continue; 5658 goto play_sound_and_continue;
5601 a1.uType = 4090; 5659 a1.uType = 4090;
5602 a1.stru_24.Reset(); 5660 a1.stru_24.Reset();
5603 a1.field_48 = v3->spellnum; 5661 a1.field_48 = v3->spellnum;
6739 } 6797 }
6740 while ( v726 != 0 ); 6798 while ( v726 != 0 );
6741 } 6799 }
6742 if ( SHIDWORD(v733) >= amount ) 6800 if ( SHIDWORD(v733) >= amount )
6743 { 6801 {
6744 v66 = pGlobalTXT_LocalizationStrings[648]; 6802 ShowStatusBarString(pGlobalTXT_LocalizationStrings[648], 2); // This character can't summon any more monsters!
6745 goto LABEL_201; 6803 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
6804 goto LABEL_203;
6746 } 6805 }
6747 if ( !pPlayer->CanCastSpell(uRequiredMana) ) 6806 if ( !pPlayer->CanCastSpell(uRequiredMana) )
6748 goto play_sound_and_continue; 6807 goto play_sound_and_continue;
6749 sub_44FA4C_spawn_light_elemental(v3->uPlayerID, v731, v733); 6808 sub_44FA4C_spawn_light_elemental(v3->uPlayerID, v731, v733);
6750 goto LABEL_1056; 6809 goto LABEL_1056;
6788 LODWORD(v727) = v83; 6847 LODWORD(v727) = v83;
6789 6848
6790 goto play_sound_and_continue; 6849 goto play_sound_and_continue;
6791 6850
6792 case 84: 6851 case 84:
6793 v67 = 2; 6852 //v67 = 2;
6794 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) 6853 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
6795 { 6854 {
6796 v66 = pGlobalTXT_LocalizationStrings[497]; 6855 ShowStatusBarString(pGlobalTXT_LocalizationStrings[497], 2); // Can't cast Prismatic Light outdoors!
6797 goto LABEL_202; 6856 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
6857 goto LABEL_203;
6798 } 6858 }
6799 if ( !pPlayer->CanCastSpell(uRequiredMana) ) 6859 if ( !pPlayer->CanCastSpell(uRequiredMana) )
6800 goto play_sound_and_continue; 6860 goto play_sound_and_continue;
6801 v531 = sub_46A6AC((int)dword_50BF30, 100, 4096); 6861 v531 = sub_46A6AC((int)dword_50BF30, 100, 4096);
6802 ++a1.uType; 6862 ++a1.uType;
6938 pParty->pPartyBuffs[PARTY_BUFF_HASTE].Apply((signed __int64)((double)(signed int)((int)y << 7) * 0.033333335 + (double)(signed __int64)pParty->uTimePlayed), v562, v730, 0, 0); 6998 pParty->pPartyBuffs[PARTY_BUFF_HASTE].Apply((signed __int64)((double)(signed int)((int)y << 7) * 0.033333335 + (double)(signed __int64)pParty->uTimePlayed), v562, v730, 0, 0);
6939 goto LABEL_1056; 6999 goto LABEL_1056;
6940 case 88: 7000 case 88:
6941 amount = 3; 7001 amount = 3;
6942 if ( pPlayer->uNumDivineInterventionCastsThisDay >= 3u ) 7002 if ( pPlayer->uNumDivineInterventionCastsThisDay >= 3u )
6943 goto LABEL_200; 7003 {
7004 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
7005 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
7006 goto LABEL_203;
7007 }
6944 if ( !pPlayer->CanCastSpell(uRequiredMana) ) 7008 if ( !pPlayer->CanCastSpell(uRequiredMana) )
6945 goto play_sound_and_continue; 7009 goto play_sound_and_continue;
6946 a2 = 0; 7010 a2 = 0;
6947 _this = (ItemGen *)&pPlayers[1]; 7011 _this = (ItemGen *)&pPlayers[1];
6948 do 7012 do
7015 } 7079 }
7016 v577 = (Player *)(v576 >> 3); 7080 v577 = (Player *)(v576 >> 3);
7017 v726 = v577; 7081 v726 = v577;
7018 if ( v577 == (Player *)-1 ) 7082 if ( v577 == (Player *)-1 )
7019 { 7083 {
7020 v66 = pGlobalTXT_LocalizationStrings[496]; 7084 ShowStatusBarString(pGlobalTXT_LocalizationStrings[496], 2); // No valid target exists!
7021 goto LABEL_201; 7085 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
7086 goto LABEL_203;
7022 } 7087 }
7023 v578 = (int)&pActors[(int)v577]; 7088 v578 = (int)&pActors[(int)v577];
7024 v721 = v578; 7089 v721 = v578;
7025 if ( *(short *)(v578 + 40) > 0 || (v579 = *(short *)(v578 + 176), v579 != 5) && v579 != 4 ) 7090 if ( *(short *)(v578 + 40) > 0 || (v579 = *(short *)(v578 + 176), v579 != 5) && v579 != 4 )
7026 goto LABEL_200; 7091 {
7092 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
7093 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
7094 goto LABEL_203;
7095 }
7027 ++a1.uType; 7096 ++a1.uType;
7028 a1.stru_24.Reset(); 7097 a1.stru_24.Reset();
7029 a1.field_48 = v3->spellnum; 7098 a1.field_48 = v3->spellnum;
7030 a1.field_4C = v2; 7099 a1.field_4C = v2;
7031 a1.field_50 = v731; 7100 a1.field_50 = v731;
7088 || *(char *)(HIDWORD(v733) + 20) & 2 7157 || *(char *)(HIDWORD(v733) + 20) & 2
7089 || *(int *)(HIDWORD(v733) + 12) != 0 7158 || *(int *)(HIDWORD(v733) + 12) != 0
7090 || *(int *)(HIDWORD(v733) + 4) != 0 7159 || *(int *)(HIDWORD(v733) + 4) != 0
7091 || (v591 = *(char *)(v732 + 28)) != 0 && v591 != 1 && v591 != 2 7160 || (v591 = *(char *)(v732 + 28)) != 0 && v591 != 1 && v591 != 2
7092 || pItemsTable->IsMaterialNonCommon((ItemGen *)HIDWORD(v733)) ) 7161 || pItemsTable->IsMaterialNonCommon((ItemGen *)HIDWORD(v733)) )
7093 goto LABEL_199; 7162 {
7163 dword_50C9D0 = 113;
7164 dword_50C9D4 = 0;
7165 dword_50C9D8 = 1;
7166
7167 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
7168 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
7169 goto LABEL_203;
7170 }
7094 v592 = HIDWORD(v733); 7171 v592 = HIDWORD(v733);
7095 v14 = v731 == 4; 7172 v14 = v731 == 4;
7096 *(int *)(HIDWORD(v733) + 12) = 16; 7173 *(int *)(HIDWORD(v733) + 12) = 16;
7097 if ( !v14 ) 7174 if ( !v14 )
7098 { 7175 {
7189 goto LABEL_1056; 7266 goto LABEL_1056;
7190 v730 = 836 * v599; 7267 v730 = 836 * v599;
7191 if ( !MonsterStats::BelongsToSupertype(pActors[v599].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) 7268 if ( !MonsterStats::BelongsToSupertype(pActors[v599].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) )
7192 goto play_sound_and_continue; 7269 goto play_sound_and_continue;
7193 if ( !stru_50C198.GetMagicalResistance(&pActors[v599], 0xAu) ) 7270 if ( !stru_50C198.GetMagicalResistance(&pActors[v599], 0xAu) )
7194 goto LABEL_200; 7271 {
7272 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
7273 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
7274 goto LABEL_203;
7275 }
7195 pActors[v599].pActorBuffs[9].Reset(); 7276 pActors[v599].pActorBuffs[9].Reset();
7196 pActors[v599].pActorBuffs[1].Reset(); 7277 pActors[v599].pActorBuffs[1].Reset();
7197 v732 = (int)v733 << 7; 7278 v732 = (int)v733 << 7;
7198 pActors[v599].pActorBuffs[12].Apply( 7279 pActors[v599].pActorBuffs[12].Apply(
7199 pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), 7280 pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335),
7271 } 7352 }
7272 v608 = v3->uPlayerID_2; 7353 v608 = v3->uPlayerID_2;
7273 if ( v608 != 4 && v608 != 5 7354 if ( v608 != 4 && v608 != 5
7274 || (v609 = (signed int)*(&pFontCChar + v608 + (unsigned __int8)pParty->field_709), v609 <= 0) 7355 || (v609 = (signed int)*(&pFontCChar + v608 + (unsigned __int8)pParty->field_709), v609 <= 0)
7275 || v609 >= 3 ) 7356 || v609 >= 3 )
7276 goto LABEL_200; 7357 {
7358 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
7359 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
7360 goto LABEL_203;
7361 }
7277 v610 = 76 * v609; 7362 v610 = 76 * v609;
7278 *((int *)&pParty->pPlayers[3].pInstalledBeacons[4].uBeaconTime + 19 * v609) = 0; 7363 *((int *)&pParty->pPlayers[3].pInstalledBeacons[4].uBeaconTime + 19 * v609) = 0;
7279 v611 = pIconsFrameTable->FindIcon("spell96"); 7364 v611 = pIconsFrameTable->FindIcon("spell96");
7280 *(int *)((char *)&pParty->pPlayers[3].pInstalledBeacons[4].uBeaconTime + v610 + 4) = pIconsFrameTable->GetIconAnimLength(v611); 7365 *(int *)((char *)&pParty->pPlayers[3].pInstalledBeacons[4].uBeaconTime + v610 + 4) = pIconsFrameTable->GetIconAnimLength(v611);
7281 *(int *)((char *)&pParty->pPlayers[3].pInstalledBeacons[3].field_18 + v610) = 1; 7366 *(int *)((char *)&pParty->pPlayers[3].pInstalledBeacons[3].field_18 + v610) = 1;
7423 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0, 0x40u); 7508 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0, 0x40u);
7424 goto LABEL_1056; 7509 goto LABEL_1056;
7425 case 98: 7510 case 98:
7426 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) 7511 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
7427 { 7512 {
7428 v66 = pGlobalTXT_LocalizationStrings[499]; 7513 ShowStatusBarString(pGlobalTXT_LocalizationStrings[499], 2); // Can't cast Armageddon indoors!
7429 goto LABEL_201; 7514 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
7515 goto LABEL_203;
7430 } 7516 }
7431 v640 = v12 - 2; 7517 v640 = v12 - 2;
7432 if ( !v640 || (v641 = v640 - 1) == 0 || (amount = 4, v641 != 1) ) 7518 if ( !v640 || (v641 = v640 - 1) == 0 || (amount = 4, v641 != 1) )
7433 amount = 3; 7519 amount = 3;
7434 if ( pPlayer->uNumArmageddonCasts >= amount || pParty->armageddon_timer > 0 ) 7520 if ( pPlayer->uNumArmageddonCasts >= amount || pParty->armageddon_timer > 0 )
7435 goto LABEL_200; 7521 {
7522 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed
7523 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0);
7524 goto LABEL_203;
7525 }
7436 if ( !pPlayer->CanCastSpell(uRequiredMana) ) 7526 if ( !pPlayer->CanCastSpell(uRequiredMana) )
7437 goto play_sound_and_continue; 7527 goto play_sound_and_continue;
7438 pParty->armageddon_timer = 256; 7528 pParty->armageddon_timer = 256;
7439 pParty->field_16140 = v2; 7529 pParty->field_16140 = v2;
7440 ++pPlayer->uNumArmageddonCasts; 7530 ++pPlayer->uNumArmageddonCasts;