Mercurial > mm7
diff mm7_6.cpp @ 822:c232f160e6f3
Named SpriteObject spell-related fields.
author | Nomad |
---|---|
date | Tue, 26 Mar 2013 17:56:24 +0200 |
parents | 9359c114f98c |
children | c1da83d8223f |
line wrap: on
line diff
--- a/mm7_6.cpp Tue Mar 26 14:55:43 2013 +0200 +++ b/mm7_6.cpp Tue Mar 26 17:56:24 2013 +0200 @@ -2466,13 +2466,13 @@ //char v9; // al@44 //int v10; // eax@45 unsigned __int16 v11; // cx@45 - signed int v12; // ecx@48 + //signed int v12; // ecx@48 //int v13; // eax@53 unsigned __int8 v14; // zf@53 //unsigned int v15; // edx@53 //signed int v16; // eax@53 Player *v17; // esi@70 - int v18; // eax@72 + //int v18; // eax@72 int v19; // eax@74 char *v20; // eax@74 signed int i; // esi@76 @@ -2504,7 +2504,7 @@ unsigned int v47; // edx@133 int v48; // eax@137 int v49; // eax@137 - int v50; // eax@141 + //int v50; // eax@141 int v51; // eax@146 __int16 v52; // ax@153 int v53; // eax@153 @@ -3299,7 +3299,6 @@ if ( HIBYTE(v11) & 1 ) { - v12 = 4; v731 = 4; } else @@ -3312,15 +3311,14 @@ { v731 = 3; } - v12 = v731; } v730 = v3->spellnum; if (v3->forced_spell_skill_level) uRequiredMana = 0; else - uRequiredMana = pSpellDatas[v3->spellnum].mana_per_skill[v12 - 1]; - sRecoveryTime = pSpellDatas[v3->spellnum].recovery_per_skill[v12 - 1]; + uRequiredMana = pSpellDatas[v3->spellnum].mana_per_skill[v731 - 1]; + sRecoveryTime = pSpellDatas[v3->spellnum].recovery_per_skill[v731 - 1]; if (LODWORD(v725) == PLAYER_SKILL_DARK && pParty->uCurrentHour == 0 && pParty->uCurrentMinute == 0 || LODWORD(v725) == PLAYER_SKILL_LIGHT && pParty->uCurrentHour == 12 && pParty->uCurrentMinute == 0) @@ -3376,10 +3374,9 @@ _this = (ItemGen *)2; sRecoveryTime = v17->GetAttackRecoveryTime(true); a1.stru_24.Reset(); - v18 = v3->spellnum; - a1.field_4C = v2; - a1.field_48 = v18; - a1.field_50 = v731; + a1.spell_level = v2; + a1.spell_id = v3->spellnum; + a1.spell_skill = v731; a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); if ( v17->WearsItem(510, 2) ) a1.uObjectDescID = pObjectList->ObjectIDByItemID(0xBD6u); @@ -3390,7 +3387,7 @@ a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; v19 = 8 * v3->uPlayerID; LOBYTE(v19) = v19 | OBJECT_Player; - a1.field_58_pid = v19; + a1.spell_caster_pid = v19; a1.field_5C = a2; a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); a1.uFacing = LOWORD(v715.uYawAngle); @@ -3418,9 +3415,9 @@ case SPELL_LASER_PROJECTILE: sRecoveryTime = pPlayer->GetAttackRecoveryTime(0); a1.stru_24.Reset(); - a1.field_48 = v3->spellnum; - a1.field_4C = v723; - a1.field_50 = v731; + a1.spell_id = v3->spellnum; + a1.spell_level = v723; + a1.spell_skill = v731; a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); a1.vPosition.x = pParty->vPosition.x; a1.vPosition.y = pParty->vPosition.y; @@ -3429,7 +3426,7 @@ a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; v22 = 8 * v3->uPlayerID; LOBYTE(v22) = v22 | OBJECT_Player; - a1.field_58_pid = v22; + a1.spell_caster_pid = v22; a1.field_5C = a2; a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); a1.uFacing = LOWORD(v715.uYawAngle); @@ -3457,7 +3454,7 @@ case SPELL_FIRE_TORCH_LIGHT: LODWORD(v733) = 3600 * v2; - switch (v12) + switch (v731) { case 1: amount = 2; break; case 2: amount = 3; break; @@ -3474,7 +3471,7 @@ goto LABEL_1056; case SPELL_FIRE_FIRE_SPIKE: - v29 = v12 - 2; + v29 = v731 - 2; if ( v29 ) { v30 = v29 - 1; @@ -3503,7 +3500,7 @@ for (uint i = 0; i < uNumSpriteObjects; ++i) { auto object = pSpriteObjects + i; - if (object->uType && object->field_48 == 7 && object->field_58_pid == 8 * (int)v3->uPlayerID | OBJECT_Player) + if (object->uType && object->spell_id == SPELL_FIRE_FIRE_SPIKE && object->spell_caster_pid == (8 * (int)v3->uPlayerID) | OBJECT_Player) ++HIDWORD(v733); /*v33 = (char *)&pSpriteObjects[0].field_48; v730 = uNumSpriteObjects; @@ -3526,9 +3523,9 @@ goto play_sound_and_continue; a1.stru_24.Reset(); - a1.field_48 = v3->spellnum; - a1.field_4C = v2; - a1.field_50 = v731; + a1.spell_id = v3->spellnum; + a1.spell_level = v2; + a1.spell_skill = v731; a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); a1.vPosition.y = pParty->vPosition.y; a1.vPosition.x = pParty->vPosition.x; @@ -3541,7 +3538,7 @@ a1.uSpriteFrameID = 0; v34 = 8 * v3->uPlayerID; LOBYTE(v34) = v34 | OBJECT_Player; - a1.field_58_pid = v34; + a1.spell_caster_pid = v34; a1.field_5C = a2; a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); a1.uFacing = LOWORD(v715.uYawAngle); @@ -3568,9 +3565,9 @@ v698 = 0; v697 = 0; a1.stru_24.Reset(); - a1.field_48 = v3->spellnum; - a1.field_4C = v2; - a1.field_50 = v731; + a1.spell_id = v3->spellnum; + a1.spell_level = v2; + a1.spell_skill = v731; a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); a1.uAttributes = 0; a1.uSectorID = 0; @@ -3580,7 +3577,7 @@ v37 *= 8; LOBYTE(v37) = v37 | OBJECT_Player; a1.uFacing = 0; - a1.field_58_pid = v37; + a1.spell_caster_pid = v37; v38 = a2 >> 3; a1.uSoundID = LOWORD(v3->field_10); v39 = a2 >> 3; @@ -3607,9 +3604,9 @@ v705 = 0; v704 = 0; a1.stru_24.Reset(); - a1.field_48 = v3->spellnum; - a1.field_4C = v2; - a1.field_50 = v731; + a1.spell_id = v3->spellnum; + a1.spell_level = v2; + a1.spell_skill = v731; a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); a1.uAttributes = 0; a1.uSectorID = 0; @@ -3620,7 +3617,7 @@ v44 *= 8; LOBYTE(v44) = v44 | OBJECT_Player; v38 = (signed int)v726; - a1.field_58_pid = v44; + a1.spell_caster_pid = v44; a1.uSoundID = LOWORD(v3->field_10); a1.vPosition.x = *(__int16 *)((char *)&pActors[0].vPosition.x + HIDWORD(v733)); v45 = *(__int16 *)((char *)&pActors[0].vPosition.y + HIDWORD(v733)); @@ -3644,9 +3641,9 @@ v692 = 0; v691 = 0; a1.stru_24.Reset(); - a1.field_48 = v3->spellnum; - a1.field_4C = v2; - a1.field_50 = v731; + a1.spell_id = v3->spellnum; + a1.spell_level = v2; + a1.spell_skill = v731; a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); a1.vPosition.x = *(short *)(HIDWORD(v733) + 142); a1.vPosition.y = *(short *)(HIDWORD(v733) + 144); @@ -3657,7 +3654,7 @@ a1.uSpriteFrameID = 0; v49 = 8 * v3->uPlayerID; LOBYTE(v49) = v49 | OBJECT_Player; - a1.field_58_pid = v49; + a1.spell_caster_pid = v49; a1.field_5C = a2; a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); a1.uFacing = LOWORD(v715.uYawAngle); @@ -3677,38 +3674,40 @@ LABEL_139: DamageMonsterFromParty(8 * v42 | 2, v47, v670); goto LABEL_1056; + + case SPELL_FIRE_FIRE_BOLT: - case 6: - case 11: - case 18: - case 26: - case 32: - case 34: - case 37: - case 57: - case 65: - case 70: - case 78: - case 97: + case SPELL_FIRE_FIREBALL: + case SPELL_FIRE_INCINERATE: + case SPELL_AIR_LIGHNING_BOLT: + case SPELL_WATER_ICE_BOLT: + case SPELL_WATER_ICE_BLAST: + case SPELL_EARTH_STUN: + case SPELL_EARTH_DEADLY_SWARM: + case SPELL_MIND_MIND_BLAST: + case SPELL_MIND_PSYCHIC_SHOCK: + case SPELL_BODY_HARM: + case SPELL_LIGHT_LIGHT_BOLT: + case SPELL_DARK_DRAGON_BREATH: if ( !pPlayer->CanCastSpell(uRequiredMana) ) goto play_sound_and_continue; a1.stru_24.Reset(); - a1.field_48 = v3->spellnum; - a1.field_4C = v2; - a1.field_50 = v731; + a1.spell_id = v3->spellnum; + a1.spell_level = v2; + a1.spell_skill = v731; a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); a1.vPosition.y = pParty->vPosition.y; a1.vPosition.x = pParty->vPosition.x; a1.uAttributes = 0; a1.vPosition.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; - a1.uSectorID = pIndoor->GetSector( - pParty->vPosition.x, - pParty->vPosition.y, - pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); + if (uCurrentlyLoadedLevelType == LEVEL_Indoor) + a1.uSectorID = pIndoor->GetSector(pParty->vPosition.x, + pParty->vPosition.y, + pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); + else a1.uSectorID = 0; + a1.uSpriteFrameID = 0; - v50 = 8 * v3->uPlayerID; - LOBYTE(v50) = v50 | OBJECT_Player; - a1.field_58_pid = v50; + a1.spell_caster_pid = (8 * v3->uPlayerID) | OBJECT_Player; a1.field_5C = a2; a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); a1.uFacing = LOWORD(v715.uYawAngle); @@ -3718,6 +3717,9 @@ if ( v3->spellnum == 18 ) LOBYTE(a1.uAttributes) |= 0x40u; goto LABEL_156; + + + case 29: case 39: case 76: @@ -3725,9 +3727,9 @@ if ( !pPlayer->CanCastSpell(uRequiredMana) ) goto play_sound_and_continue; a1.stru_24.Reset(); - a1.field_48 = v3->spellnum; - a1.field_4C = v2; - a1.field_50 = v731; + a1.spell_id = v3->spellnum; + a1.spell_level = v2; + a1.spell_skill = v731; a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); v51 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2; a1.vPosition.y = pParty->vPosition.y; @@ -3766,19 +3768,19 @@ v661 = (Actor *)v55; goto LABEL_165; case 35: - if ( v12 == 2 ) + if ( v731 == 2 ) { v57 = 300 * v2; } else { - if ( v12 == 3 ) + if ( v731 == 3 ) { amount = 4; v57 = 300 * v2; goto LABEL_174; } - if ( v12 == 4 ) + if ( v731 == 4 ) { v57 = 300 * v2; amount = 8; @@ -3836,9 +3838,9 @@ pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, 0, 0, 0); a1.stru_24.Reset(); - a1.field_48 = v3->spellnum; - a1.field_4C = v2; - a1.field_50 = v731; + a1.spell_id = v3->spellnum; + a1.spell_level = v2; + a1.spell_skill = v731; v60 = pObjectList->ObjectIDByItemID(a1.uType); v61 = a2 >> 3; goto LABEL_1086; @@ -3858,17 +3860,17 @@ a1.uSpriteFrameID = 0; v62 = 8 * v3->uPlayerID; LOBYTE(v62) = v62 | OBJECT_Player; - a1.field_58_pid = v62; + a1.spell_caster_pid = v62; a1.field_5C = a2; a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); a1.uFacing = LOWORD(v715.uYawAngle); a1.uSoundID = LOWORD(v3->field_10); - a1.field_50 = v731; - a1.field_48 = 3; - a1.field_4C = 300 * v2; + a1.spell_skill = v731; + a1.spell_id = SPELL_FIRE_PROTECTION_FROM_FIRE; + a1.spell_level = 300 * v2; goto LABEL_154; case 4: - v63 = v12 - 1; + v63 = v731 - 1; if ( !v63 ) { amount = 10; @@ -3987,7 +3989,7 @@ goto LABEL_203; case SPELL_BODY_REGENERATION: - v70 = v12 - 1; + v70 = v731 - 1; LODWORD(v733) = 3600 * v2; if ( v70 && (v71 = v70 - 1) != 0 ) { @@ -4020,7 +4022,7 @@ case SPELL_EARTH_PROTECTION_FROM_EARTH: case SPELL_MIND_PROTECTION_FROM_MIND: case SPELL_BODY_PROTECTION_FROM_BODY: - v76 = v12 - 1; + v76 = v731 - 1; LODWORD(v733) = 3600 * v2; if ( v76 ) { @@ -4090,21 +4092,21 @@ goto play_sound_and_continue; case SPELL_FIRE_HASTE: - if ( v12 <= 0 ) + if ( v731 <= 0 ) goto LABEL_254; - if ( v12 <= 2 ) + if ( v731 <= 2 ) { v91 = 60 * (v2 + 60); } else { - if ( v12 == 3 ) + if ( v731 == 3 ) { v91 = 180 * (v2 + 20); } else { - if ( v12 != 4 ) + if ( v731 != 4 ) goto LABEL_254; v91 = 240 * (v2 + 15); } @@ -4136,7 +4138,7 @@ goto play_sound_and_continue; case SPELL_SPIRIT_BLESS: - v101 = v12 - 1; + v101 = v731 - 1; if ( v101 && (v102 = v101 - 1) != 0 ) { v103 = v102 - 1; @@ -4234,9 +4236,9 @@ v701 = 0; a1.stru_24.Reset(); v119 = HIDWORD(v733); - a1.field_48 = *(int *)HIDWORD(v733); - a1.field_4C = v723; - a1.field_50 = v731; + a1.spell_id = *(int *)HIDWORD(v733); + a1.spell_level = v723; + a1.spell_skill = v731; a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); a1.uAttributes = 0; a1.uSectorID = 0; @@ -4244,7 +4246,7 @@ v120 = 8 * *(short *)(v119 + 2); LOBYTE(v120) = v120 | OBJECT_Player; a1.field_60_distance_related_prolly_lod = 0; - a1.field_58_pid = v120; + a1.spell_caster_pid = v120; a1.uFacing = 0; a1.uSoundID = *(short *)(v119 + 16); a1.vPosition.x = v112->vPosition.x; @@ -4271,7 +4273,7 @@ case SPELL_AIR_SHIELD: case SPELL_EARTH_STONESKIN: case SPELL_SPIRIT_HEROISM: - v123 = v12 - 1; + v123 = v731 - 1; if ( v123 && (v124 = v123 - 1) != 0 ) { v125 = v124 - 1; @@ -4328,7 +4330,7 @@ goto play_sound_and_continue; case SPELL_FIRE_IMMOLATION: - v138 = v12 - 2; + v138 = v731 - 2; if ( v138 && (v139 = v138 - 1) != 0 && v139 == 1 ) v140 = 600 * v2; else @@ -4348,7 +4350,7 @@ goto LABEL_1056; case 9: - v149 = v12 - 1; + v149 = v731 - 1; if ( v149 && (v150 = v149 - 1) != 0 && (v151 = v150 - 1) != 0 ) { if ( v151 == 1 ) @@ -4417,9 +4419,9 @@ stru_5C6E00->Atan2((signed __int64)v718, (signed __int64)*(float *)&v721)); } a1.stru_24.Reset(); - a1.field_48 = v3->spellnum; - a1.field_4C = v2; - a1.field_50 = v731; + a1.spell_id = v3->spellnum; + a1.spell_level = v2; + a1.spell_skill = v731; a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); a1.uAttributes = 0; a1.vPosition.x = uRequiredMana; @@ -4427,7 +4429,7 @@ a1.uSectorID = 0; a1.vPosition.z = a2 + v713; a1.uSpriteFrameID = 0; - a1.field_58_pid = 8 * v3->uPlayerID | OBJECT_Player; + a1.spell_caster_pid = 8 * v3->uPlayerID | OBJECT_Player; a1.field_5C = v730; a1.field_60_distance_related_prolly_lod = stru_50C198._427546(a2 + 2500); a1.uFacing = v687; @@ -4465,9 +4467,9 @@ v700.y = 0; v700.x = 0; a1.stru_24.Reset(); - a1.field_48 = v3->spellnum; - a1.field_4C = v2; - a1.field_50 = v731; + a1.spell_id = v3->spellnum; + a1.spell_level = v2; + a1.spell_skill = v731; a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); a1.uAttributes = 0; a1.uSectorID = 0; @@ -4477,7 +4479,7 @@ a1.uFacing = 0; v161 *= 8; LOBYTE(v161) = v161 | OBJECT_Player; - a1.field_58_pid = v161; + a1.spell_caster_pid = v161; a1.uSoundID = LOWORD(v3->field_10); a2 = 0; if ( (signed int)v726 > 0 ) @@ -4521,7 +4523,7 @@ goto LABEL_1056; case SPELL_AIR_FEATHER_FALL: - v170 = v12 - 1; + v170 = v731 - 1; if ( !v170 ) { v173 = 300 * v2; @@ -4557,7 +4559,7 @@ goto play_sound_and_continue; case SPELL_AIR_SPARKS: - v184 = v12 - 1; + v184 = v731 - 1; if ( v184 ) { v185 = v184 - 1; @@ -4588,9 +4590,9 @@ v726 = (Player *)((signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360); v732 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (amount - 1); a1.stru_24.Reset(); - a1.field_48 = v3->spellnum; - a1.field_4C = v2; - a1.field_50 = v731; + a1.spell_id = v3->spellnum; + a1.spell_level = v2; + a1.spell_skill = v731; a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); a1.vPosition.y = pParty->vPosition.y; a1.vPosition.x = pParty->vPosition.x; @@ -4603,7 +4605,7 @@ a1.uSpriteFrameID = 0; v187 = 8 * v3->uPlayerID; LOBYTE(v187) = v187 | OBJECT_Player; - a1.field_58_pid = v187; + a1.spell_caster_pid = v187; a1.field_5C = a2; a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); a1.uSoundID = LOWORD(v3->field_10); @@ -4642,7 +4644,7 @@ goto LABEL_1056; case SPELL_AIR_INVISIBILITY: - v192 = v12 - 1; + v192 = v731 - 1; if ( !v192 ) { amount = v2; @@ -4784,9 +4786,9 @@ stru_5C6E00->Atan2((signed __int64)v727, (signed __int64)*(float *)&uRequiredMana)); } a1.stru_24.Reset(); - a1.field_48 = v3->spellnum; - a1.field_4C = v2; - a1.field_50 = v731; + a1.spell_id = v3->spellnum; + a1.spell_level = v2; + a1.spell_skill = v731; a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); a1.uAttributes = 0; a1.vPosition.x = LODWORD(v718); @@ -4794,7 +4796,7 @@ a1.uSectorID = 0; a1.vPosition.z = (int)((char *)_this + LODWORD(v725)); a1.uSpriteFrameID = 0; - a1.field_58_pid = 8 * v3->uPlayerID | OBJECT_Player; + a1.spell_caster_pid = 8 * v3->uPlayerID | OBJECT_Player; a1.field_5C = v730; a1.field_60_distance_related_prolly_lod = stru_50C198._427546((int)&_this[69].uNumCharges); a1.uFacing = v685; @@ -4816,7 +4818,7 @@ while ( !v14 ); goto LABEL_1056; case 23: - v219 = v12 - 2; + v219 = v731 - 2; if ( v219 ) { v220 = v219 - 1; @@ -4846,7 +4848,7 @@ HIDWORD(v733) = (int)(char *)&pParty + 2508; break; case 24: - v224 = v12 - 2; + v224 = v731 - 2; if ( v224 ) { v225 = v224 - 1; @@ -4873,9 +4875,9 @@ { LABEL_152: a1.stru_24.Reset(); - a1.field_48 = v3->spellnum; - a1.field_50 = v731; - a1.field_4C = v2; + a1.spell_id = v3->spellnum; + a1.spell_skill = v731; + a1.spell_level = v2; a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); a1.vPosition.y = pParty->vPosition.y; v51 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3; @@ -4890,7 +4892,7 @@ a1.uSectorID = v52; v53 = 8 * v3->uPlayerID; LOBYTE(v53) = v53 | OBJECT_Player; - a1.field_58_pid = v53; + a1.spell_caster_pid = v53; a1.field_5C = a2; a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); a1.uFacing = LOWORD(v715.uYawAngle); @@ -4911,9 +4913,9 @@ { v732 = SHIDWORD(v733) / (amount - 1); a1.stru_24.Reset(); - a1.field_48 = v3->spellnum; - a1.field_4C = v2; - a1.field_50 = v731; + a1.spell_id = v3->spellnum; + a1.spell_level = v2; + a1.spell_skill = v731; a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); a1.vPosition.y = pParty->vPosition.y; a1.vPosition.x = pParty->vPosition.x; @@ -4926,7 +4928,7 @@ a1.uSpriteFrameID = 0; v226 = 8 * v3->uPlayerID; LOBYTE(v226) = v226 | OBJECT_Player; - a1.field_58_pid = v226; + a1.spell_caster_pid = v226; a1.field_5C = a2; a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); a1.uSoundID = LOWORD(v3->field_10); @@ -5459,7 +5461,7 @@ amount = 10 * v2; if ( pPlayer->sMana < (signed int)uRequiredMana ) goto play_sound_and_continue; - if ( pParty->uFlags & (PARTY_FLAGS_1_ALERT_RED | PARTY_FLAGS_1_ALERT_YELLOW) && v12 != 4 || rand() % 100 >= amount && v731 != 4 ) + if ( pParty->uFlags & (PARTY_FLAGS_1_ALERT_RED | PARTY_FLAGS_1_ALERT_YELLOW) && v731 != 4 || rand() % 100 >= amount && v731 != 4 ) { ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); @@ -5491,7 +5493,7 @@ } goto play_sound_and_continue; case 40: - v320 = v12 - 2; + v320 = v731 - 2; if ( !v320 ) goto LABEL_632; v321 = v320 - 1; @@ -5524,9 +5526,9 @@ if ( !pPlayer->CanCastSpell(uRequiredMana) ) goto play_sound_and_continue; a1.stru_24.Reset(); - a1.field_48 = v3->spellnum; - a1.field_4C = v2; - a1.field_50 = v731; + a1.spell_id = v3->spellnum; + a1.spell_level = v2; + a1.spell_skill = v731; a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); a1.vPosition.y = pParty->vPosition.y; a1.vPosition.x = pParty->vPosition.x; @@ -5539,7 +5541,7 @@ a1.uSpriteFrameID = 0; v326 = 8 * v3->uPlayerID; LOBYTE(v326) = v326 | OBJECT_Player; - a1.field_58_pid = v326; + a1.spell_caster_pid = v326; a1.field_5C = a2; a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); a1.uFacing = LOWORD(pParty->sRotationY); @@ -5561,9 +5563,9 @@ goto play_sound_and_continue; a1.uType = 4090; a1.stru_24.Reset(); - a1.field_48 = v3->spellnum; - a1.field_4C = v2; - a1.field_50 = v731; + a1.spell_id = v3->spellnum; + a1.spell_level = v2; + a1.spell_skill = v731; a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); a1.vPosition.x = pParty->vPosition.x; a1.vPosition.y = pParty->vPosition.y; @@ -5574,7 +5576,7 @@ v327 = 8 * v3->uPlayerID; LOBYTE(v327) = v327 | OBJECT_Player; a1.field_60_distance_related_prolly_lod = 0; - a1.field_58_pid = v327; + a1.spell_caster_pid = v327; a1.field_5C = a2; a1.uFacing = LOWORD(pParty->sRotationY); a1.uSoundID = LOWORD(v3->field_10); @@ -5590,7 +5592,7 @@ goto LABEL_157; case SPELL_SPIRIT_DETECT_LIFE: - v328 = v12 - 2; + v328 = v731 - 2; if ( v328 ) { v329 = v328 - 1; @@ -5621,7 +5623,7 @@ case SPELL_SPIRIT_FATE: LODWORD(v733) = 300; - v339 = v12 - 2; + v339 = v731 - 2; if ( v339 ) { v340 = v339 - 1; @@ -5670,7 +5672,7 @@ goto LABEL_1056; case 49: - v348 = v12 - 2; + v348 = v731 - 2; if ( !v348 ) goto LABEL_677; v349 = v348 - 1; @@ -5710,7 +5712,7 @@ v674 = v3->uPlayerID_2; goto LABEL_685; case SPELL_SPIRIT_PRESERVATION: - v354 = v12 - 2; + v354 = v731 - 2; if ( v354 && (v355 = v354 - 1) != 0 && v355 == 1 ) v356 = 900 * (v2 + 4); else @@ -5741,7 +5743,7 @@ while ( v357 <= &pParty->pPlayers[3] ); goto LABEL_1056; case 48: - v364 = v12 - 2; + v364 = v731 - 2; if ( !v364 || (v365 = v364 - 1) != 0 && v365 != 1 ) v366 = 60 * (v2 + 3); else @@ -5753,9 +5755,9 @@ pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFFFFFFu, 0xC0u); ++a1.uType; a1.stru_24.Reset(); - a1.field_48 = v3->spellnum; - a1.field_4C = v2; - a1.field_50 = v731; + a1.spell_id = v3->spellnum; + a1.spell_level = v2; + a1.spell_skill = v731; a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); a1.uAttributes = 0; a1.uSectorID = 0; @@ -5765,7 +5767,7 @@ a1.uFacing = 0; v368 *= 8; LOBYTE(v368) = v368 | OBJECT_Player; - a1.field_58_pid = v368; + a1.spell_caster_pid = v368; a1.uSoundID = LOWORD(v3->field_10); for ( a2 = 0; a2 < (signed int)v726; ++a2 ) { @@ -5788,7 +5790,7 @@ } goto LABEL_1056; case 53: - v371 = v12 - 2; + v371 = v731 - 2; if ( v371 && (v372 = v371 - 1) != 0 && v372 == 1 ) amount = 0; else @@ -5824,7 +5826,7 @@ v377 = &pParty->pPlayers[v3->uPlayerID_2]; goto LABEL_720; case 54: - v378 = v12 - 2; + v378 = v731 - 2; if ( v378 && (v379 = v378 - 1) != 0 && v379 == 1 ) v380 = 4 * v2; else @@ -5880,7 +5882,7 @@ goto LABEL_1056; case 55: - v392 = v12 - 1; + v392 = v731 - 1; if ( !v392 ) { v395 = 180 * v2; @@ -5952,7 +5954,7 @@ goto play_sound_and_continue; case 61: - v405 = v12 - 2; + v405 = v731 - 2; if ( !v405 ) goto LABEL_766; v406 = v405 - 1; @@ -5987,7 +5989,7 @@ v656 = 12; goto LABEL_640; case 56: - v411 = v12 - 2; + v411 = v731 - 2; if ( v411 ) { v412 = v411 - 1; @@ -6088,9 +6090,9 @@ LABEL_807: ShowStatusBarString(pTmpBuf2, 2u); a1.stru_24.Reset(); - a1.field_48 = v3->spellnum; - a1.field_4C = v2; - a1.field_50 = v731; + a1.spell_id = v3->spellnum; + a1.spell_level = v2; + a1.spell_skill = v731; a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); a1.vPosition.x = *(short *)(v730 + 142); a1.vPosition.y = *(short *)(v730 + 144); @@ -6100,7 +6102,7 @@ v657 = a1.vPosition.x; goto LABEL_1087; case 62: - v423 = v12 - 2; + v423 = v731 - 2; if ( !v423 ) goto LABEL_813; v424 = v423 - 1; @@ -6134,9 +6136,9 @@ pActors[v426].pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long; } a1.stru_24.Reset(); - a1.field_48 = v3->spellnum; - a1.field_4C = v2; - a1.field_50 = v731; + a1.spell_id = v3->spellnum; + a1.spell_level = v2; + a1.spell_skill = v731; v60 = pObjectList->ObjectIDByItemID(a1.uType); v61 = v426; goto LABEL_1086; @@ -6160,14 +6162,14 @@ v731, 0, 0, 0); } a1.stru_24.Reset(); - a1.field_48 = v3->spellnum; - a1.field_4C = v2; - a1.field_50 = v731; + a1.spell_id = v3->spellnum; + a1.spell_level = v2; + a1.spell_skill = v731; v60 = pObjectList->ObjectIDByItemID(a1.uType); v61 = v427; goto LABEL_1086; case 63: - v428 = v12 - 2; + v428 = v731 - 2; if ( v428 && (v429 = v428 - 1) != 0 && v429 == 1 ) v430 = 300 * v2; else @@ -6179,9 +6181,9 @@ pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xA0A0Au, 0xC0u); ++a1.uType; a1.stru_24.Reset(); - a1.field_48 = v3->spellnum; - a1.field_4C = v2; - a1.field_50 = v731; + a1.spell_id = v3->spellnum; + a1.spell_level = v2; + a1.spell_skill = v731; a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); a1.uAttributes = 0; a1.uSectorID = 0; @@ -6191,7 +6193,7 @@ a1.uFacing = 0; v432 *= 8; LOBYTE(v432) = v432 | OBJECT_Player; - a1.field_58_pid = v432; + a1.spell_caster_pid = v432; a1.uSoundID = LOWORD(v3->field_10); for ( a2 = 0; a2 < (signed int)v726; ++a2 ) { @@ -6216,7 +6218,7 @@ } goto LABEL_1056; case 64: - v435 = v12 - 2; + v435 = v731 - 2; if ( v435 && (v436 = v435 - 1) != 0 && v436 == 1 ) amount = 0; else @@ -6249,7 +6251,7 @@ } goto LABEL_1056; case 42: - v442 = v12 - 2; + v442 = v731 - 2; if ( !v442 ) goto LABEL_855; v443 = v442 - 1; @@ -6328,7 +6330,7 @@ } goto LABEL_1056; case 67: - v451 = v12 - 2; + v451 = v731 - 2; if ( v451 ) { v452 = v451 - 1; @@ -6374,7 +6376,7 @@ v325 = &pParty->pPlayers[v323]; goto LABEL_641; case 68: - v457 = v12 - 2; + v457 = v731 - 2; if ( v457 ) { v458 = v457 - 1; @@ -6432,7 +6434,7 @@ } goto LABEL_1056; case 72: - v464 = v12 - 2; + v464 = v731 - 2; if ( !v464 ) goto LABEL_910; v465 = v464 - 1; @@ -6530,7 +6532,7 @@ pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, v2, v2, 0); goto LABEL_1056; case 74: - v493 = v12 - 2; + v493 = v731 - 2; if ( v493 && (v494 = v493 - 1) != 0 && v494 == 1 ) amount = 0; else @@ -6603,9 +6605,9 @@ v689 = 0; v688 = 0; a1.stru_24.Reset(); - a1.field_48 = v3->spellnum; - a1.field_4C = v2; - a1.field_50 = v731; + a1.spell_id = v3->spellnum; + a1.spell_level = v2; + a1.spell_skill = v731; a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); a1.uAttributes = 0; a1.uSectorID = 0; @@ -6615,7 +6617,7 @@ a1.uFacing = 0; v506 *= 8; LOBYTE(v506) = v506 | OBJECT_Player; - a1.field_58_pid = v506; + a1.spell_caster_pid = v506; a1.uSoundID = LOWORD(v3->field_10); a2 = 0; if ( SHIDWORD(v733) > 0 ) @@ -6660,7 +6662,7 @@ } goto LABEL_1056; case 82: - v514 = v12 - 2; + v514 = v731 - 2; if ( !v514 ) goto LABEL_955; v515 = v514 - 1; @@ -6711,7 +6713,7 @@ sub_44FA4C_spawn_light_elemental(v3->uPlayerID, v731, v733); goto LABEL_1056; case 83: - v520 = v12 - 2; + v520 = v731 - 2; if ( !v520 ) goto LABEL_973; v521 = v520 - 1; @@ -6768,9 +6770,9 @@ v695 = 0; v694 = 0; a1.stru_24.Reset(); - a1.field_48 = v3->spellnum; - a1.field_4C = v2; - a1.field_50 = v731; + a1.spell_id = v3->spellnum; + a1.spell_level = v2; + a1.spell_skill = v731; a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); a1.uAttributes = 0; a1.uSectorID = 0; @@ -6780,7 +6782,7 @@ a1.uFacing = 0; v532 *= 8; LOBYTE(v532) = v532 | OBJECT_Player; - a1.field_58_pid = v532; + a1.spell_caster_pid = v532; a1.uSoundID = LOWORD(v3->field_10); a2 = 0; if ( (signed int)v726 > 0 ) @@ -6807,7 +6809,7 @@ goto LABEL_1056; case SPELL_LIGHT_DAY_OF_PROTECTION: - v538 = v12 - 2; + v538 = v731 - 2; if ( v538 && (v539 = v538 - 1) != 0 && v539 == 1 ) { amount = 5 * v2; @@ -6847,7 +6849,7 @@ pParty->pPartyBuffs[PARTY_BUFF_WIZARD_EYE].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), v731, v550, 0, 0); goto LABEL_1056; case 86: - v551 = v12 - 2; + v551 = v731 - 2; if ( !v551 ) goto LABEL_998; v552 = v551 - 1; @@ -6943,7 +6945,7 @@ ++v571->uNumDivineInterventionCastsThisDay; goto LABEL_1056; case 89: - v573 = v12 - 2; + v573 = v731 - 2; if ( v573 ) { v574 = v573 - 1; @@ -6998,9 +7000,9 @@ } ++a1.uType; a1.stru_24.Reset(); - a1.field_48 = v3->spellnum; - a1.field_4C = v2; - a1.field_50 = v731; + a1.spell_id = v3->spellnum; + a1.spell_level = v2; + a1.spell_skill = v731; a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); a1.uAttributes = 0; a1.uSectorID = 0; @@ -7011,7 +7013,7 @@ v580 *= 8; LOBYTE(v580) = v580 | OBJECT_Player; a1.uFacing = 0; - a1.field_58_pid = v580; + a1.spell_caster_pid = v580; a1.uSoundID = LOWORD(v3->field_10); a1.vPosition.x = *(short *)(v721 + 142); a1.vPosition.y = *(short *)(v721 + 144); @@ -7040,7 +7042,7 @@ *(short *)(v581 + 40) = 10 * amount; goto LABEL_1056; case 91: - v588 = v12 - 1; + v588 = v731 - 1; amount = 16; if ( v588 && (v589 = v588 - 1) != 0 && (v590 = v589 - 1) != 0 ) { @@ -7084,7 +7086,7 @@ *(char *)(v592 + 20) |= 0x80u; goto LABEL_1055; case 93: - v593 = v12 - 2; + v593 = v731 - 2; if ( !v593 ) goto LABEL_1062; v594 = v593 - 1; @@ -7105,9 +7107,9 @@ v726 = (Player *)((signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360); v732 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (amount - 1); a1.stru_24.Reset(); - a1.field_48 = v3->spellnum; - a1.field_4C = v2; - a1.field_50 = v731; + a1.spell_id = v3->spellnum; + a1.spell_level = v2; + a1.spell_skill = v731; a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); a1.vPosition.x = pParty->vPosition.x; a1.vPosition.y = pParty->vPosition.y; @@ -7120,7 +7122,7 @@ a1.uSpriteFrameID = 0; v595 = 8 * v3->uPlayerID; LOBYTE(v595) = v595 | OBJECT_Player; - a1.field_58_pid = v595; + a1.spell_caster_pid = v595; a1.field_5C = a2; a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); a1.uSoundID = LOWORD(v3->field_10); @@ -7183,9 +7185,9 @@ pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, 0, 0, 0); a1.stru_24.Reset(); - a1.field_48 = v3->spellnum; - a1.field_4C = v2; - a1.field_50 = v731; + a1.spell_id = v3->spellnum; + a1.spell_level = v2; + a1.spell_skill = v731; v60 = pObjectList->ObjectIDByItemID(a1.uType); v61 = v599; LABEL_1086: @@ -7206,7 +7208,7 @@ a1.uSpriteFrameID = 0; v604 = 8 * v3->uPlayerID; LOBYTE(v604) = v604 | OBJECT_Player; - a1.field_58_pid = v604; + a1.spell_caster_pid = v604; a1.field_5C = a2; a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); a1.uFacing = LOWORD(v715.uYawAngle); @@ -7284,15 +7286,15 @@ LODWORD(v727) = 1; goto play_sound_and_continue; case 95: - if ( v12 <= 0 ) + if ( v731 <= 0 ) goto LABEL_1119; - if ( v12 <= 3 ) + if ( v731 <= 3 ) { v614 = 300 * (v2 + 12); } else { - if ( v12 != 4 ) + if ( v731 != 4 ) goto LABEL_1119; v614 = 900 * (v2 + 4); } @@ -7335,9 +7337,9 @@ v708 = 0; v707 = 0; a1.stru_24.Reset(); - a1.field_48 = v3->spellnum; - a1.field_4C = v2; - a1.field_50 = v731; + a1.spell_id = v3->spellnum; + a1.spell_level = v2; + a1.spell_skill = v731; a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); a1.uAttributes = 0; a1.uSectorID = 0; @@ -7347,7 +7349,7 @@ a1.uFacing = 0; v624 *= 8; LOBYTE(v624) = v624 | OBJECT_Player; - a1.field_58_pid = v624; + a1.spell_caster_pid = v624; a1.uSoundID = LOWORD(v3->field_10); a2 = 0; if ( SHIDWORD(v733) > 0 ) @@ -7417,7 +7419,7 @@ pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); goto LABEL_203; } - v640 = v12 - 2; + v640 = v731 - 2; if ( !v640 || (v641 = v640 - 1) == 0 || (amount = 4, v641 != 1) ) amount = 3; if ( pPlayer->uNumArmageddonCasts >= amount || pParty->armageddon_timer > 0 ) @@ -8147,9 +8149,9 @@ v9 = v22; } v10 = 0; - a1a.field_50 = 0; - a1a.field_4C = 0; - a1a.field_48 = 0; + a1a.spell_skill = 0; + a1a.spell_level = 0; + a1a.spell_id = 0; a1a.field_54 = 0; a1a.uType = v9; if ( (signed int)pObjectList->uNumObjects <= 0 ) @@ -8177,7 +8179,7 @@ a1a.uAttributes = attributes; a1a.uSectorID = pIndoor->GetSector(v21, y, z); a1a.uSpriteFrameID = 0; - a1a.field_58_pid = 0; + a1a.spell_caster_pid = 0; a1a.field_5C = 0; if ( !(a1a.uAttributes & 0x10) ) { @@ -8253,9 +8255,9 @@ a1.stru_24.Reset(); v5 = 0; - a1.field_50 = 0; - a1.field_4C = 0; - a1.field_48 = 0; + a1.spell_skill = 0; + a1.spell_level = 0; + a1.spell_id = 0; a1.field_54 = 0; a1.uType = 800; if ( (signed int)pObjectList->uNumObjects <= 0 ) @@ -8283,7 +8285,7 @@ a1.uAttributes = 0; a1.uSectorID = pIndoor->GetSector(v3, v4, z); a1.uSpriteFrameID = 0; - a1.field_58_pid = 0; + a1.spell_caster_pid = 0; a1.field_5C = 0; v8 = a1.Create(0, 0, 0, 0); if ( v8 != -1 ) @@ -8316,9 +8318,9 @@ a1a.uType = 600; a1a.stru_24.Reset(); - a1a.field_48 = 6; - a1a.field_4C = 8; - a1a.field_50 = 3; + a1a.spell_id = SPELL_FIRE_FIREBALL; + a1a.spell_level = 8; + a1a.spell_skill = 3; v14 = 0; if ( (signed int)pObjectList->uNumObjects <= 0 ) { @@ -8352,11 +8354,11 @@ { v10 = 8 * a6 - 8; LOBYTE(v10) = v10 | OBJECT_Player; - a1a.field_58_pid = v10; + a1a.spell_caster_pid = v10; } else { - a1a.field_58_pid = 0; + a1a.spell_caster_pid = 0; } result = a1a.Create(0, 0, 0, 0); if ( result != -1 )