# HG changeset patch # User Grumpy7 # Date 1396387215 -7200 # Node ID 5e4d90305d0621f84259abd404f410fc9eeb1f38 # Parent c889e521af1fc7cec7833f3f461a18080ba09810 EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch diff -r c889e521af1f -r 5e4d90305d06 Spells.cpp --- a/Spells.cpp Tue Apr 01 22:19:57 2014 +0200 +++ b/Spells.cpp Tue Apr 01 23:20:15 2014 +0200 @@ -455,581 +455,362 @@ //SpriteObject::SpriteObject(&a1); a1.uType = stru_4E3ACC[uSpellID].uType; - if ( uSpellID > 58 ) + switch ( uSpellID ) { - if ( uSpellID == SPELL_BODY_PROTECTION_FROM_BODY ) - goto LABEL_117; - if ( uSpellID != SPELL_LIGHT_DAY_OF_THE_GODS ) - return; - switch (skillMasteryPlusOne) - { - case 2: - v42 = 10800 * uSkill; - v43 = 3 * uSkill + 10; - break; - case 3: - v42 = 18000 * uSkill; - v43 = 5 * uSkill + 10; - break; - case 4: - v42 = 14400 * uSkill; - v43 = 4 * uSkill + 10; - break; - } - pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 0); - pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 1u); - pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 2u); - pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 3u); - v39 = (signed __int64)((double)(v42 << 7) * 0.033333335); - v37 = &pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS]; - v36 = pParty->uTimePlayed + v39; - v37->Apply(v36, skillMasteryPlusOne, v43, 0, 0); - pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); - return; - } - if ( uSpellID != 58 ) - { - switch ( uSpellID ) - { - case SPELL_FIRE_FIRE_BOLT: - case SPELL_FIRE_FIREBALL: - case SPELL_AIR_LIGHNING_BOLT: - case SPELL_WATER_ICE_BOLT: - case SPELL_WATER_ACID_BURST: - case SPELL_WATER_ICE_BLAST: - case SPELL_EARTH_BLADES: - case SPELL_EARTH_ROCK_BLAST: - a1.stru_24.Reset(); - v16 = 0; - a1.spell_id = uSpellID; - a1.spell_level = uSkill; - a1.spell_skill = skillMasteryPlusOne; - if ( (signed int)pObjectList->uNumObjects <= 0 ) + case SPELL_FIRE_FIRE_BOLT: + case SPELL_FIRE_FIREBALL: + case SPELL_AIR_LIGHNING_BOLT: + case SPELL_WATER_ICE_BOLT: + case SPELL_WATER_ACID_BURST: + case SPELL_WATER_ICE_BLAST: + case SPELL_EARTH_BLADES: + case SPELL_EARTH_ROCK_BLAST: + a1.stru_24.Reset(); + v16 = 0; + a1.spell_id = uSpellID; + a1.spell_level = uSkill; + a1.spell_skill = skillMasteryPlusOne; + while (v16 < pObjectList->uNumObjects) + { + if ( a1.uType == pObjectList->pObjects[v16].uObjectID) { - //v18 = 0; - a1.uObjectDescID = 0; - *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); - a1.vPosition.x = fromx; - a1.uAttributes = 16; - a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); - a1.field_60_distance_related_prolly_lod = v55; - //v20 = yaw; - a1.uSpriteFrameID = 0; - a1.spell_caster_pid = 8000 | OBJECT_Item; - a1.spell_target_pid = 0; - a1.uFacing = yaw; - a1.uSoundID = 0; - v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; - a1.Create(yaw, pitch, v49, 0); - pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); - return; - } - v17 = (char *)&pObjectList->pObjects->uObjectID; - while ( (short)a1.uType != *(short *)v17 ) - { - ++v16; - v17 += 56; - if ( v16 >= (signed int)pObjectList->uNumObjects ) - { - //v18 = 0; - a1.uObjectDescID = 0; - *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); - a1.vPosition.x = fromx; - a1.uAttributes = 16; - a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); - a1.field_60_distance_related_prolly_lod = v55; - //v20 = yaw; - a1.uSpriteFrameID = 0; - a1.spell_caster_pid = 8000 | OBJECT_Item; - a1.spell_target_pid = 0; - a1.uFacing = yaw; - a1.uSoundID = 0; - v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; - a1.Create(yaw, pitch, v49, 0); - pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); - return; - } - } - v18 = v16; - a1.uObjectDescID = v18; - *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); - a1.vPosition.x = fromx; - a1.uAttributes = 16; - a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); - a1.field_60_distance_related_prolly_lod = v55; - //v20 = yaw; - a1.uSpriteFrameID = 0; - a1.spell_caster_pid = 8000 | OBJECT_Item; - a1.spell_target_pid = 0; - a1.uFacing = yaw; - a1.uSoundID = 0; - v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; - a1.Create(yaw, pitch, v49, 0); - pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); - return; - case SPELL_WATER_POISON_SPRAY: - switch ( skillMasteryPlusOne ) - { - case 1: - v60 = 1; - break; - case 2: - v60 = 3; - break; - case 3: - v60 = 5; - break; - case 4: - v60 = 7; - break; + break; } - a7c = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360; - if ( v60 != 1 ) + v16++; + } + a1.uObjectDescID = v16; + *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); + a1.vPosition.x = fromx; + a1.uAttributes = 16; + a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); + a1.field_60_distance_related_prolly_lod = v55; + //v20 = yaw; + a1.uSpriteFrameID = 0; + a1.spell_caster_pid = 8000 | OBJECT_Item; + a1.spell_target_pid = 0; + a1.uFacing = yaw; + a1.uSoundID = 0; + v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; + a1.Create(yaw, pitch, v49, 0); + pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); + return; + case SPELL_WATER_POISON_SPRAY: + switch ( skillMasteryPlusOne ) + { + case 1: + v60 = 1; + break; + case 2: + v60 = 3; + break; + case 3: + v60 = 5; + break; + case 4: + v60 = 7; + break; + } + a1.stru_24.Reset(); + a1.spell_id = uSpellID; + a1.spell_level = uSkill; + a1.spell_skill = skillMasteryPlusOne; + v16 = 0; + while (v16 < pObjectList->uNumObjects) + { + if ( a1.uType == pObjectList->pObjects[v16].uObjectID) { - a8b = a7c / (v60 - 1); - a1.stru_24.Reset(); - v21 = 0; - a1.spell_id = uSpellID; - a1.spell_level = uSkill; - a1.spell_skill = skillMasteryPlusOne; - if ( (signed int)pObjectList->uNumObjects <= 0 ) - v23 = 0; - else - { - v22 = (char *)&pObjectList->pObjects->uObjectID; - while ( (short)a1.uType != *(short *)v22 ) - { - ++v21; - v22 += 56; - if ( v21 >= (signed int)pObjectList->uNumObjects ) - { - v23 = 0; - a1.uObjectDescID = v23; - *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); - a1.vPosition.x = fromx; - a1.uAttributes = 16; - a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); - a1.field_60_distance_related_prolly_lod = v55; - a1.uSpriteFrameID = 0; - a1.spell_caster_pid = 8000 | OBJECT_Item; - a1.spell_target_pid = 4; - a1.uSoundID = 0; - for ( i = a7c / -2; i <= a7c / 2; i += a8b ) - { - a1.uFacing = i + yaw; - a1.Create((signed __int16)(i + (short)yaw), pitch, pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, 0); - } - pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); - return; - } - } - v23 = v21; - } - a1.uObjectDescID = v23; - *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); - a1.vPosition.x = fromx; - a1.uAttributes = 16; - a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); - a1.field_60_distance_related_prolly_lod = v55; - a1.uSpriteFrameID = 0; - a1.spell_caster_pid = 8000 | OBJECT_Item; - a1.spell_target_pid = 4; - a1.uSoundID = 0; - for ( i = a7c / -2; i <= a7c / 2; i += a8b ) - { - a1.uFacing = i + yaw; - a1.Create((signed __int16)(i + (short)yaw), pitch, pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, 0); - } - pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); - return; + break; } - a1.stru_24.Reset(); - a1.spell_id = uSpellID; - a1.spell_level = uSkill; - a1.spell_skill = skillMasteryPlusOne; - if ( (signed int)pObjectList->uNumObjects <= 0 ) - { - //v18 = 0; - a1.uObjectDescID = 0; - *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); - a1.vPosition.x = fromx; - a1.uAttributes = 16; - a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); - a1.field_60_distance_related_prolly_lod = v55; - //v20 = yaw; - a1.uSpriteFrameID = 0; - a1.spell_caster_pid = 8000 | OBJECT_Item; - a1.spell_target_pid = 0; - a1.uFacing = yaw; - a1.uSoundID = 0; - //v51 = 0; - v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; - //v47 = pitch; - a1.Create(yaw, pitch, v49, 0); - pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); - return; - } - //v19 = (char *)&pObjectList->pObjects->uObjectID; - for ( v16 = 0; v16 < (signed int)pObjectList->uNumObjects; ++v16 ) - { - if ( (short)a1.uType == pObjectList->pObjects[v16].uObjectID ) - { - //v18 = v16; - a1.uObjectDescID = v16; - *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); - a1.vPosition.x = fromx; - a1.uAttributes = 16; - a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); - a1.field_60_distance_related_prolly_lod = v55; - //v20 = yaw; - a1.uSpriteFrameID = 0; - a1.spell_caster_pid = 8000 | OBJECT_Item; - a1.spell_target_pid = 0; - a1.uFacing = yaw; - a1.uSoundID = 0; - //v51 = 0; - v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; - //v47 = pitch; - a1.Create(yaw, pitch, v49, 0); - pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); - return; - } - //v19 += 56; - } - //v18 = 0; - a1.uObjectDescID = 0; - *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); - a1.vPosition.x = fromx; - a1.uAttributes = 16; - a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); - a1.field_60_distance_related_prolly_lod = v55; - //v20 = yaw; - a1.uSpriteFrameID = 0; - a1.spell_caster_pid = 8000 | OBJECT_Item; - a1.spell_target_pid = 0; - a1.uFacing = yaw; - a1.uSoundID = 0; - //v51 = 0; + v16++; + } + a1.uObjectDescID = v16; + *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); + a1.vPosition.x = fromx; + a1.uAttributes = 16; + a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); + a1.field_60_distance_related_prolly_lod = v55; + //v20 = yaw; + a1.uSpriteFrameID = 0; + a1.spell_caster_pid = 8000 | OBJECT_Item; + a1.spell_target_pid = 0; + a1.uFacing = yaw; + a1.uSoundID = 0; + //v51 = 0; + if ( v60 == 1 ) + { v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; //v47 = pitch; a1.Create(yaw, pitch, v49, 0); - pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); - return; - case SPELL_AIR_SPARKS: - switch ( skillMasteryPlusOne ) - { - case 1: - v60 = 3; - break; - case 2: - v60 = 5; - break; - case 3: - v60 = 7; - break; - case 4: - v60 = 9; - break; - } - a7d = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360; - a8c = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (v60 - 1); - a1.stru_24.Reset(); - v25 = 0; - a1.spell_id = uSpellID; - a1.spell_level = uSkill; - a1.spell_skill = skillMasteryPlusOne; - if ( (signed int)pObjectList->uNumObjects <= 0 ) + } + else + { + a7c = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360; + a8b = a7c / (v60 - 1); + for ( i = a7c / -2; i <= a7c / 2; i += a8b ) { - //v27 = 0; - a1.uObjectDescID = 0; - *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); - a1.vPosition.x = fromx; - a1.uAttributes = 16; - a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); - a1.field_60_distance_related_prolly_lod = v55; - a1.uSpriteFrameID = 0; - a1.spell_caster_pid = 8000 | OBJECT_Item; - a1.spell_target_pid = 4; - a1.uSoundID = 0; - for ( j = a7d / -2; j <= a7d / 2; j += a8c ) - { - a1.uFacing = j + yaw; - a1.Create((signed __int16)(j + (short)yaw), pitch, pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, 0); - } - pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); - return; - } - v26 = (char *)&pObjectList->pObjects->uObjectID; - while ( (short)a1.uType != *(short *)v26 ) - { - ++v25; - v26 += 56; - if ( v25 >= (signed int)pObjectList->uNumObjects ) - { - v27 = 0; - a1.uObjectDescID = v27; - *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); - a1.vPosition.x = fromx; - a1.uAttributes = 16; - a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); - a1.field_60_distance_related_prolly_lod = v55; - a1.uSpriteFrameID = 0; - a1.spell_caster_pid = 8000 | OBJECT_Item; - a1.spell_target_pid = 4; - a1.uSoundID = 0; - for ( j = a7d / -2; j <= a7d / 2; j += a8c ) - { - a1.uFacing = j + yaw; - a1.Create((signed __int16)(j + (short)yaw), pitch, pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, 0); - } - pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); - return; - } + a1.uFacing = i + yaw; + a1.Create((signed __int16)(i + (short)yaw), pitch, pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, 0); } - v27 = v25; - a1.uObjectDescID = v27; - *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); - a1.vPosition.x = fromx; - a1.uAttributes = 16; - a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); - a1.field_60_distance_related_prolly_lod = v55; - a1.uSpriteFrameID = 0; - a1.spell_caster_pid = 8000 | OBJECT_Item; - a1.spell_target_pid = 4; - a1.uSoundID = 0; - for ( j = a7d / -2; j <= a7d / 2; j += a8c ) - { - a1.uFacing = j + yaw; - a1.Create((signed __int16)(j + (short)yaw), pitch, - pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, 0); - } - pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); - return; - case SPELL_EARTH_DEATH_BLOSSOM: - if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) - return; - a1.stru_24.Reset(); - v29 = 0; - a1.spell_id = uSpellID; - a1.spell_level = uSkill; - a1.spell_skill = skillMasteryPlusOne; - if ( (signed int)pObjectList->uNumObjects <= 0 ) + } + pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); + return; + case SPELL_AIR_SPARKS: + switch ( skillMasteryPlusOne ) + { + case 1: + v60 = 3; + break; + case 2: + v60 = 5; + break; + case 3: + v60 = 7; + break; + case 4: + v60 = 9; + break; + } + a7d = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360; + a8c = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (v60 - 1); + a1.stru_24.Reset(); + v25 = 0; + a1.spell_id = uSpellID; + a1.spell_level = uSkill; + a1.spell_skill = skillMasteryPlusOne; + while (v25 < pObjectList->uNumObjects) + { + if ( a1.uType == pObjectList->pObjects[v25].uObjectID) { - //v31 = 0; - a1.uObjectDescID = 0; - *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); - a1.vPosition.x = fromx; - a1.uAttributes = 16; - a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); - a1.field_60_distance_related_prolly_lod = v55; - a1.uSpriteFrameID = 0; - a1.spell_caster_pid = 8000 | OBJECT_Item; - a1.spell_target_pid = 4; - a1.uSoundID = 0; - //v51 = 0; - v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; - //v20 = yaw; - v47 = (signed int)stru_5C6E00->uIntegerHalfPi / 2; - a1.Create(yaw, v47, v49, 0); - pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); - return; + break; } - v30 = (char *)&pObjectList->pObjects->uObjectID; - break; - - case SPELL_FIRE_HASTE: - if ( skillMasteryPlusOne > 0 ) - { - if ( skillMasteryPlusOne <= 2 ) - v9 = 60 * (uSkill + 60); - else if ( skillMasteryPlusOne == 3 ) - v9 = 180 * (uSkill + 20); - else if ( skillMasteryPlusOne == 4 ) - v9 = 240 * (uSkill + 15); - } - //levela = 1; - //v32 = pParty->pPlayers;//[0].pConditions[1]; - //do - for (uint i = 0; i < 4; ++i) - if (pParty->pPlayers[i].IsWeak()) - return; - //while ( v32 <= &pParty->pPlayers[3] ); - //if ( !levela ) - // return; - pParty->pPartyBuffs[PARTY_BUFF_HASTE].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(v9 * 128) * 0.033333335), - skillMasteryPlusOne, 0, 0, 0); - //v33 = spellnum_; - pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0); - pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1); - pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2); - pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3); - pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);//звук алтаря + v25++; + } + a1.uObjectDescID = v25; + *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); + a1.vPosition.x = fromx; + a1.uAttributes = 16; + a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); + a1.field_60_distance_related_prolly_lod = v55; + a1.uSpriteFrameID = 0; + a1.spell_caster_pid = 8000 | OBJECT_Item; + a1.spell_target_pid = 4; + a1.uSoundID = 0; + for ( j = a7d / -2; j <= a7d / 2; j += a8c ) + { + a1.uFacing = j + yaw; + a1.Create((signed __int16)(j + (short)yaw), pitch, pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, 0); + } + pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); + return; + case SPELL_EARTH_DEATH_BLOSSOM: + if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) return; - case SPELL_AIR_SHIELD: - case SPELL_EARTH_STONESKIN: - case SPELL_SPIRIT_HEROISM: - switch ( skillMasteryPlusOne ) + a1.stru_24.Reset(); + v29 = 0; + a1.spell_id = uSpellID; + a1.spell_level = uSkill; + a1.spell_skill = skillMasteryPlusOne; + while (v31 < pObjectList->uNumObjects) + { + if ( a1.uType == pObjectList->pObjects[v31].uObjectID) { - case 1: - case 2: - v9 = 300 * (uSkill + 12); - break; - case 3: - v9 = 900 * (uSkill + 4); - break; - case 4: - v9 = 3600 * (uSkill + 1); - break; - } - switch ( uSpellID ) - { - case SPELL_AIR_SHIELD: - v60 = 0; - uSkill = 14; - break; - case SPELL_EARTH_STONESKIN: - v60 = uSkill + 5; - uSkill = 15; - break; - case SPELL_SPIRIT_HEROISM: - v60 = uSkill + 5; - uSkill = 9; - break; + break; } - pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0); - pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1); - pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2); - pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3); - //v52 = 0; - //v50 = 0; - //v48 = v60; - //v46 = v15; - v36 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(v9 << 7) * 0.033333335); - //v37 = &pParty->pPartyBuffs[uSkill]; - pParty->pPartyBuffs[uSkill].Apply(v36, skillMasteryPlusOne, v60, 0, 0); - pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); - return; - case SPELL_FIRE_IMMOLATION: - if (skillMasteryPlusOne == 4) - v38 = 600 * uSkill; - else - v38 = 60 * uSkill; - pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0); - pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1); - pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2); - pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3); - v52 = 0; - v50 = 0; - v48 = uSkill; - v46 = skillMasteryPlusOne; - v39 = (signed __int64)((double)(v38 << 7) * 0.033333335); - v37 = &pParty->pPartyBuffs[PARTY_BUFF_IMMOLATION]; - v36 = pParty->uTimePlayed + v39; - v37->Apply(v36, v46, v48, v50, v52); - pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); - return; - case SPELL_FIRE_PROTECTION_FROM_FIRE: - case SPELL_AIR_PROTECTION_FROM_AIR: - case SPELL_WATER_PROTECTION_FROM_WATER: - case SPELL_EARTH_PROTECTION_FROM_EARTH: - goto LABEL_117; - default: - return; - } - while ( (short)a1.uType != *(short *)v30 ) - { - ++v29; - v30 += 56; - if ( v29 >= (signed int)pObjectList->uNumObjects ) + v31++; + } + a1.uObjectDescID = v31; + *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); + a1.vPosition.x = fromx; + a1.uAttributes = 16; + a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); + a1.field_60_distance_related_prolly_lod = v55; + a1.uSpriteFrameID = 0; + a1.spell_caster_pid = 8000 | OBJECT_Item; + a1.spell_target_pid = 4; + a1.uSoundID = 0; + //v51 = 0; + v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; + //v20 = yaw; + v47 = (signed int)stru_5C6E00->uIntegerHalfPi / 2; + a1.Create(yaw, v47, v49, 0); + pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); + return; + + case SPELL_FIRE_HASTE: + if ( skillMasteryPlusOne > 0 ) + { + if ( skillMasteryPlusOne <= 2 ) + v9 = 60 * (uSkill + 60); + else if ( skillMasteryPlusOne == 3 ) + v9 = 180 * (uSkill + 20); + else if ( skillMasteryPlusOne == 4 ) + v9 = 240 * (uSkill + 15); + } + //levela = 1; + //v32 = pParty->pPlayers;//[0].pConditions[1]; + //do + for (uint i = 0; i < 4; ++i) + if (pParty->pPlayers[i].IsWeak()) + return; + //while ( v32 <= &pParty->pPlayers[3] ); + //if ( !levela ) + // return; + pParty->pPartyBuffs[PARTY_BUFF_HASTE].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(v9 * 128) * 0.033333335), + skillMasteryPlusOne, 0, 0, 0); + //v33 = spellnum_; + pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0); + pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1); + pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2); + pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3); + pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);//звук алтаря + return; + case SPELL_AIR_SHIELD: + case SPELL_EARTH_STONESKIN: + case SPELL_SPIRIT_HEROISM: + switch ( skillMasteryPlusOne ) + { + case 1: + case 2: + v9 = 300 * (uSkill + 12); + break; + case 3: + v9 = 900 * (uSkill + 4); + break; + case 4: + v9 = 3600 * (uSkill + 1); + break; + } + switch ( uSpellID ) { - //v31 = 0; - a1.uObjectDescID = 0; - *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); - a1.vPosition.x = fromx; - a1.uAttributes = 16; - a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); - a1.field_60_distance_related_prolly_lod = v55; - a1.uSpriteFrameID = 0; - a1.spell_caster_pid = 8000 | OBJECT_Item; - a1.spell_target_pid = 4; - a1.uSoundID = 0; - //v51 = 0; - v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; - //v20 = yaw; - v47 = (signed int)stru_5C6E00->uIntegerHalfPi / 2; - a1.Create(yaw, v47, v49, 0); - pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); - return; + case SPELL_AIR_SHIELD: + v60 = 0; + uSkill = 14; + break; + case SPELL_EARTH_STONESKIN: + v60 = uSkill + 5; + uSkill = 15; + break; + case SPELL_SPIRIT_HEROISM: + v60 = uSkill + 5; + uSkill = 9; + break; } - } - v31 = v29; - a1.uObjectDescID = v31; - *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); - a1.vPosition.x = fromx; - a1.uAttributes = 16; - a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); - a1.field_60_distance_related_prolly_lod = v55; - a1.uSpriteFrameID = 0; - a1.spell_caster_pid = 8000 | OBJECT_Item; - a1.spell_target_pid = 4; - a1.uSoundID = 0; - //v51 = 0; - v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; - //v20 = yaw; - v47 = (signed int)stru_5C6E00->uIntegerHalfPi / 2; - a1.Create(yaw, v47, v49, 0); - pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); - return; + pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0); + pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1); + pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2); + pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3); + //v52 = 0; + //v50 = 0; + //v48 = v60; + //v46 = v15; + v36 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(v9 << 7) * 0.033333335); + //v37 = &pParty->pPartyBuffs[uSkill]; + pParty->pPartyBuffs[uSkill].Apply(v36, skillMasteryPlusOne, v60, 0, 0); + pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); + return; + case SPELL_FIRE_IMMOLATION: + if (skillMasteryPlusOne == 4) + v38 = 600 * uSkill; + else + v38 = 60 * uSkill; + pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0); + pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1); + pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2); + pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3); + v52 = 0; + v50 = 0; + v48 = uSkill; + v46 = skillMasteryPlusOne; + v39 = (signed __int64)((double)(v38 << 7) * 0.033333335); + v37 = &pParty->pPartyBuffs[PARTY_BUFF_IMMOLATION]; + v36 = pParty->uTimePlayed + v39; + v37->Apply(v36, v46, v48, v50, v52); + pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); + return; + case SPELL_FIRE_PROTECTION_FROM_FIRE: + case SPELL_AIR_PROTECTION_FROM_AIR: + case SPELL_WATER_PROTECTION_FROM_WATER: + case SPELL_EARTH_PROTECTION_FROM_EARTH: + case SPELL_MIND_PROTECTION_FROM_MIND: + case SPELL_BODY_PROTECTION_FROM_BODY: + a6_4 = 3600 * uSkill; + switch (skillMasteryPlusOne) + { + case 1: + v60 = uSkill; + break; + case 2: + v60 = 2 * uSkill; + break; + case 3: + v60 = 3 * uSkill; + break; + case 4: + v60 = 4 * uSkill; + break; + } + switch ( uSpellID ) + { + case SPELL_FIRE_PROTECTION_FROM_FIRE: + uSkill = PARTY_BUFF_RESIST_FIRE; + break; + case SPELL_AIR_PROTECTION_FROM_AIR: + uSkill = PARTY_BUFF_RESIST_AIR; + break; + case SPELL_WATER_PROTECTION_FROM_WATER: + uSkill = PARTY_BUFF_RESIST_WATER; + break; + case SPELL_EARTH_PROTECTION_FROM_EARTH: + uSkill = PARTY_BUFF_RESIST_EARTH; + break; + case SPELL_MIND_PROTECTION_FROM_MIND: + uSkill = PARTY_BUFF_RESIST_MIND; + break; + case SPELL_BODY_PROTECTION_FROM_BODY: + uSkill = PARTY_BUFF_RESIST_BODY; + break; + } + //v45 = spellnum_; + pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0); + pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1); + pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2); + pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3); + pParty->pPartyBuffs[uSkill].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)a6_4 * 4.2666669), skillMasteryPlusOne, v60, 0, 0); + //levela = 1; + //LABEL_138: + //if ( levela ) + //LABEL_139: + pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); + return; + case SPELL_LIGHT_DAY_OF_THE_GODS : + switch (skillMasteryPlusOne) + { + case 2: + v42 = 10800 * uSkill; + v43 = 3 * uSkill + 10; + break; + case 3: + v42 = 18000 * uSkill; + v43 = 5 * uSkill + 10; + break; + case 4: + v42 = 14400 * uSkill; + v43 = 4 * uSkill + 10; + break; + } + pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0); + pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1); + pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2); + pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3); + v39 = (signed __int64)((double)(v42 << 7) * 0.033333335); + v37 = &pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS]; + v36 = pParty->uTimePlayed + v39; + v37->Apply(v36, skillMasteryPlusOne, v43, 0, 0); + pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); + return; + default: + return; } -LABEL_117: - a6_4 = 3600 * uSkill; - switch (skillMasteryPlusOne) - { - case 1: - v60 = uSkill; - break; - case 2: - v60 = 2 * uSkill; - break; - case 3: - v60 = 3 * uSkill; - break; - case 4: - v60 = 4 * uSkill; - break; - } - switch ( uSpellID ) - { - case SPELL_FIRE_PROTECTION_FROM_FIRE: - uSkill = PARTY_BUFF_RESIST_FIRE; - break; - case SPELL_AIR_PROTECTION_FROM_AIR: - uSkill = PARTY_BUFF_RESIST_AIR; - break; - case SPELL_WATER_PROTECTION_FROM_WATER: - uSkill = PARTY_BUFF_RESIST_WATER; - break; - case SPELL_EARTH_PROTECTION_FROM_EARTH: - uSkill = PARTY_BUFF_RESIST_EARTH; - break; - case SPELL_MIND_PROTECTION_FROM_MIND: - uSkill = PARTY_BUFF_RESIST_MIND; - break; - case SPELL_BODY_PROTECTION_FROM_BODY: - uSkill = PARTY_BUFF_RESIST_BODY; - break; - } - //v45 = spellnum_; - pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0); - pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1); - pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2); - pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3); - pParty->pPartyBuffs[uSkill].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)a6_4 * 4.2666669), skillMasteryPlusOne, v60, 0, 0); - //levela = 1; -//LABEL_138: - //if ( levela ) -//LABEL_139: - pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0); } //----- (00427769) -------------------------------------------------------- bool sub_427769_isSpellQuickCastableOnShiftClick(unsigned int uSpellID)