Mercurial > mm7
changeset 2187:9856c2f8f918
CastSpell continue
author | Ritor1 |
---|---|
date | Tue, 28 Jan 2014 17:25:58 +0600 |
parents | 7a517c9a1d5b |
children | 0ae56373cc35 |
files | CastSpellInfo.cpp Conditions.cpp Conditions.h Indoor.cpp Monsters.cpp Monsters.h OSWindow.cpp Party.cpp Player.cpp Player.h UI/UiGame.cpp |
diffstat | 11 files changed, 690 insertions(+), 844 deletions(-) [+] |
line wrap: on
line diff
--- a/CastSpellInfo.cpp Mon Jan 27 17:33:34 2014 +0600 +++ b/CastSpellInfo.cpp Tue Jan 28 17:25:58 2014 +0600 @@ -243,7 +243,7 @@ AIDirection a3; // [sp+C94h] [bp-1F0h]@21 int v681[4]; // [sp+CB0h] [bp-1D4h]@1137 int v682[4]; // [sp+CC0h] [bp-1C4h]@731 - ItemGen v683; // [sp+CD0h] [bp-1B4h]@791 + //ItemGen v683; // [sp+CD0h] [bp-1B4h]@791 int v684; // [sp+D04h] [bp-180h]@416 unsigned __int64 v685; // [sp+D08h] [bp-17Ch]@416 unsigned __int64 v687; // [sp+D24h] [bp-160h]@327 @@ -2325,725 +2325,573 @@ { if ( !pPlayer->CanCastSpell(uRequiredMana) ) break; - if (PID_TYPE(a2) != OBJECT_Actor) + if (PID_TYPE(a2) == OBJECT_Actor) { - LODWORD(v727) = 1; - break; - } - mon_id = PID_ID(a2); - //v417 = &pActors[mon_id]; - //Actor * _v730 = v417; - if ( !(pActors[mon_id].uAttributes & 0x800000) ) - pActors[mon_id].SetRandomGoldIfTheresNoItem(); - v418 = 0; - if ( pItemsTable->pItems[pActors[mon_id].array_000234[3].uItemID].uEquipType == EQUIP_GOLD ) - v418 = pActors[mon_id].array_000234[3].uSpecEnchantmentType; - //ItemGen::ItemGen(&v683); - v683.Reset(); - //v419 = _v730->uCarriedItemID; - if (pActors[mon_id].uCarriedItemID) - v683.uItemID = pActors[mon_id].uCarriedItemID; - else - { - - //v421 = pActors[mon_id].array_000234; - //while ( !pActors[mon_id].array_000234[v420].uItemID || pActors[mon_id].array_000234[v420].GetItemEquipType() == EQUIP_GOLD ) - for ( v420 = 0; v420 < 4; ++v420 ) + mon_id = PID_ID(a2); + if ( !(pActors[mon_id].uAttributes & 0x800000) ) + pActors[mon_id].SetRandomGoldIfTheresNoItem(); + int gold_num = 0; + if ( pItemsTable->pItems[pActors[mon_id].array_000234[3].uItemID].uEquipType == EQUIP_GOLD ) + gold_num = pActors[mon_id].array_000234[3].uSpecEnchantmentType; + ItemGen item; + item.Reset(); + if (pActors[mon_id].uCarriedItemID) + item.uItemID = pActors[mon_id].uCarriedItemID; + else { - if ( pActors[mon_id].array_000234[v420].uItemID > 0 && pItemsTable->pItems[pActors[mon_id].array_000234[v420].uItemID].uEquipType != EQUIP_GOLD ) + for ( uint i = 0; i < 4; ++i ) { - memcpy(&v683, &pActors[mon_id].array_000234[v420], sizeof(v683)); - spell_level = v723; + if ( pActors[mon_id].array_000234[i].uItemID > 0 && pItemsTable->pItems[pActors[mon_id].array_000234[i].uItemID].uEquipType != EQUIP_GOLD ) + { + memcpy(&item, &pActors[mon_id].array_000234[i], sizeof(item)); + spell_level = v723; + } } } - //if ( v420 < 4 ) - //{ - //memcpy(&v683, &pActors[mon_id].array_000234[v420], sizeof(v683)); - //spell_level = v723; - //v1 = 0; - //} - } -// LABEL_799: - if ( v418 != 0 ) - { - //v675 = _v733; - if (v683.uItemID) + if ( gold_num > 0 ) { - //v422 = v683.GetDisplayName(); - sprintf(pTmpBuf2.data(), "(%s), and %d gold", v683.GetDisplayName(), v418); + if (item.uItemID) + sprintf(pTmpBuf2.data(), "(%s), and %d gold", item.GetDisplayName(), gold_num); + else + sprintf(pTmpBuf2.data(), "%d gold", gold_num); } else { - //v664 = "%d gold"; - sprintf(pTmpBuf2.data(), "%d gold", v418); + if (item.uItemID) + sprintf(pTmpBuf2.data(), "(%s)", item.GetDisplayName()); + else + { + strcpy(pTmpBuf2.data(), "nothing"); + ShowStatusBarString(pTmpBuf2.data(), 2); + } } + ShowStatusBarString(pTmpBuf2.data(), 2); + pSpellSprite.stru_24.Reset(); + pSpellSprite.spell_id = pCastSpell->uSpellID; + pSpellSprite.spell_level = spell_level; + pSpellSprite.spell_skill = skill_level; + pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType); + pSpellSprite.vPosition.x = pActors[mon_id].vPosition.x; + pSpellSprite.vPosition.y = pActors[mon_id].vPosition.y; + pSpellSprite.vPosition.z = pActors[mon_id].uActorHeight; + pSpellSprite.uAttributes = 0; + pSpellSprite.uSectorID = pIndoor->GetSector(pSpellSprite.vPosition.x, pSpellSprite.vPosition.y, pSpellSprite.vPosition.z); + pSpellSprite.uSpriteFrameID = 0; + pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID); + pSpellSprite.spell_target_pid = a2; + pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); + pSpellSprite.uFacing = LOWORD(v715.uYawAngle); + LOBYTE(pSpellSprite.uAttributes) |= 0x80; + pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id); + pSpellSprite.Create(0, 0, 0, pCastSpell->uPlayerID + 1); } - else + LODWORD(v727) = 1; + break; + } + case SPELL_MIND_BERSERK://Берсерк + { + switch (skill_level) { - if (v683.uItemID) + case 1: amount = 300 * spell_level; break; + case 2: amount = 300 * spell_level; break; + case 3: amount = 600 * spell_level; break; + case 4: amount = 3600; break; + default: + assert(false); + } + if ( !pPlayer->CanCastSpell(uRequiredMana) ) + break; + mon_id = PID_ID(a2); + if (PID_TYPE(a2) == OBJECT_Actor) + { + //v730 = 836 * mon_id; + if ( stru_50C198.GetMagicalResistance(&pActors[mon_id], 7) ) { - //const char *_v675 = v683.GetDisplayName(); - //v664 = "(%s)"; - sprintf(pTmpBuf2.data(), "(%s)", v683.GetDisplayName()); + pActors[mon_id].pActorBuffs[ACTOR_BUFF_CHARM].Reset(); + pActors[mon_id].pActorBuffs[ACTOR_BUFF_ENSLAVED].Reset(); + pActors[mon_id].pActorBuffs[ACTOR_BUFF_BERSERK].Apply(pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), skill_level, 0, 0, 0); + pActors[mon_id].pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long; } - else + pSpellSprite.stru_24.Reset(); + pSpellSprite.spell_id = pCastSpell->uSpellID; + pSpellSprite.spell_level = spell_level; + pSpellSprite.spell_skill = skill_level; + pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType); + pSpellSprite.vPosition.x = pActors[mon_id].vPosition.x; + pSpellSprite.vPosition.y = pActors[mon_id].vPosition.y; + pSpellSprite.vPosition.z = pActors[mon_id].vPosition.z + pActors[mon_id].uActorHeight; + pSpellSprite.uAttributes = 0; + pSpellSprite.uSectorID = pIndoor->GetSector(pActors[mon_id].vPosition.x, pActors[mon_id].vPosition.y, pSpellSprite.vPosition.z); + pSpellSprite.uSpriteFrameID = 0; + pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID); + pSpellSprite.spell_target_pid = a2; + pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); + pSpellSprite.uFacing = LOWORD(v715.uYawAngle); + LOBYTE(pSpellSprite.uAttributes) |= 0x80; + pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id); + pSpellSprite.Create(0, 0, 0, pCastSpell->uPlayerID + 1); + } + LODWORD(v727) = 1; + break; + } + case SPELL_MIND_ENSLAVE://Порабощение + { + if ( !pPlayer->CanCastSpell(uRequiredMana) ) + break; + amount = 600 * spell_level; + if (PID_TYPE(a2) == OBJECT_Actor) + { + mon_id = PID_ID(a2); + //v730 = 836 * mon_id; + if ( MonsterStats::BelongsToSupertype(pActors[mon_id].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) + break; + if ( stru_50C198.GetMagicalResistance(&pActors[mon_id], 7) ) { - strcpy(pTmpBuf2.data(), "nothing"); - ShowStatusBarString(pTmpBuf2.data(), 2); + pActors[mon_id].pActorBuffs[ACTOR_BUFF_BERSERK].Reset(); + pActors[mon_id].pActorBuffs[ACTOR_BUFF_CHARM].Reset(); + pActors[mon_id].pActorBuffs[ACTOR_BUFF_ENSLAVED].Apply(pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), + skill_level, 0, 0, 0); } + pSpellSprite.stru_24.Reset(); + pSpellSprite.spell_id = pCastSpell->uSpellID; + pSpellSprite.spell_level = spell_level; + pSpellSprite.spell_skill = skill_level; + pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType); + pSpellSprite.vPosition.x = pActors[mon_id].vPosition.x; + pSpellSprite.vPosition.y = pActors[mon_id].vPosition.y; + pSpellSprite.vPosition.z = pActors[mon_id].vPosition.z + pActors[mon_id].uActorHeight; + pSpellSprite.uAttributes = 0; + pSpellSprite.uSectorID = pIndoor->GetSector(pActors[mon_id].vPosition.x, pActors[mon_id].vPosition.y, pSpellSprite.vPosition.z); + pSpellSprite.uSpriteFrameID = 0; + pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID); + pSpellSprite.spell_target_pid = a2; + pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); + pSpellSprite.uFacing = LOWORD(v715.uYawAngle); + LOBYTE(pSpellSprite.uAttributes) |= 0x80; + pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id); + pSpellSprite.Create(0, 0, 0, pCastSpell->uPlayerID + 1); } - ShowStatusBarString(pTmpBuf2.data(), 2); + LODWORD(v727) = 1; + break; + } + case SPELL_MIND_MASS_FEAR://Массовый страх + { + if ( skill_level == 4 ) + amount = 300 * spell_level; + else + amount = 180 * spell_level; + if ( !pPlayer->CanCastSpell(uRequiredMana) ) + break; + int mon_num = pRenderer->_46А6АС_GetActorsInViewport(4096); + pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xA0A0A, 192); + ++pSpellSprite.uType; pSpellSprite.stru_24.Reset(); pSpellSprite.spell_id = pCastSpell->uSpellID; pSpellSprite.spell_level = spell_level; pSpellSprite.spell_skill = skill_level; pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType); - pSpellSprite.vPosition.x = pActors[mon_id].vPosition.x; - pSpellSprite.vPosition.y = pActors[mon_id].vPosition.y; - pSpellSprite.vPosition.z = pActors[mon_id].uActorHeight; pSpellSprite.uAttributes = 0; - pSpellSprite.uSectorID = pIndoor->GetSector(pSpellSprite.vPosition.x, pSpellSprite.vPosition.y, pSpellSprite.vPosition.z); + pSpellSprite.uSectorID = 0; pSpellSprite.uSpriteFrameID = 0; + pSpellSprite.field_60_distance_related_prolly_lod = 0; + pSpellSprite.uFacing = 0; pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID); - pSpellSprite.spell_target_pid = a2; - pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); - pSpellSprite.uFacing = LOWORD(v715.uYawAngle); - LOBYTE(pSpellSprite.uAttributes) |= 0x80; pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id); - pSpellSprite.Create(0, 0, 0, pCastSpell->uPlayerID + 1); + for ( a2 = 0; a2 < mon_num; ++a2 ) + { + if ( MonsterStats::BelongsToSupertype(pActors[_50BF30_actors_in_viewport_ids[a2]].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) + break; + pSpellSprite.vPosition.x = pActors[_50BF30_actors_in_viewport_ids[a2]].vPosition.x; + pSpellSprite.vPosition.y = pActors[_50BF30_actors_in_viewport_ids[a2]].vPosition.y; + pSpellSprite.vPosition.z = pActors[_50BF30_actors_in_viewport_ids[a2]].vPosition.z - (unsigned int)(signed __int64)((double)pActors[_50BF30_actors_in_viewport_ids[a2]].uActorHeight * -0.8); + pSpellSprite.spell_target_pid = PID(OBJECT_Actor, _50BF30_actors_in_viewport_ids[a2]); + pSpellSprite.Create(0, 0, 0, 0); + if ( stru_50C198.GetMagicalResistance(&pActors[_50BF30_actors_in_viewport_ids[a2]], 7) ) + { + pActors[_50BF30_actors_in_viewport_ids[a2]].pActorBuffs[ACTOR_BUFF_AFRAID].Apply(pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), + skill_level, 0, 0, 0); + } + } + LODWORD(v727) = 1; + break; + } + case SPELL_MIND_CURE_INSANITY://Лечение Безумия + { + if ( skill_level == 4 ) + amount = 0; + else + amount = 86400 * spell_level; + if ( !pPlayer->CanCastSpell(uRequiredMana) ) + break; + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2); + if ( pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Insane] ) + { + if ( !(pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Weak]) ) + pParty->pPlayers[pCastSpell->uPlayerID_2].PlaySound(SPEECH_25, 0); + if ( skill_level == 4 ) + pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Insane] = 0; + else + pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan(Condition_Insane, + (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335)); + pParty->pPlayers[pCastSpell->uPlayerID_2].SetCondition(Condition_Weak, 0); + } + LODWORD(v727) = 1; + break; + } + case SPELL_EARTH_TELEKINESIS://Телекинез + { + switch (skill_level) + { + case 1: amount = 2 * spell_level; break; + case 2: amount = 2 * spell_level; break; + case 3: amount = 3 * spell_level; break; + case 4: amount = 4 * spell_level; break; + default: + assert(false); + } + if ( !pPlayer->CanCastSpell(uRequiredMana) ) + break; + int obj_id = PID_ID(a2); + if (PID_TYPE(a2) == OBJECT_Item) + { + if ( pItemsTable->pItems[pSpriteObjects[obj_id].stru_24.uItemID].uEquipType == EQUIP_GOLD ) + { + pParty->PartyFindsGold(pSpriteObjects[obj_id].stru_24.uSpecEnchantmentType, 0); + viewparams->bRedrawGameUI = true; + } + else + { + sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[471], pItemsTable->pItems[pSpriteObjects[obj_id].stru_24.uItemID].pUnidentifiedName);//Вы нашли ^Pv[%s]! + ShowStatusBarString(pTmpBuf2.data(), 2); + if ( !pParty->AddItemToParty(&pSpriteObjects[obj_id].stru_24) ) + pParty->SetHoldingItem(&pSpriteObjects[obj_id].stru_24); + } + SpriteObject::OnInteraction(obj_id); + } + if (PID_TYPE(a2) == OBJECT_Actor) + pActors[obj_id].LootActor(); + if (PID_TYPE(a2) == OBJECT_Decoration) + { + OpenedTelekinesis = true; + if ( pLevelDecorations[obj_id].uEventID ) + EventProcessor(pLevelDecorations[obj_id].uEventID, a2, 1); + if ( pLevelDecorations[pSpriteObjects[obj_id].stru_24.uItemID].IsInteractive() ) + { + activeLevelDecoration = &pLevelDecorations[obj_id]; + EventProcessor(stru_5E4C90_MapPersistVars._decor_events[pLevelDecorations[obj_id]._idx_in_stru123 - 75] + 380, 0, 1); + activeLevelDecoration = NULL; + } + } + if (PID_TYPE(a2) == OBJECT_BModel) + { + OpenedTelekinesis = true; + if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) + v448 = pIndoor->pFaceExtras[pIndoor->pFaces[obj_id].uFaceExtraID].uEventID; + else + v448 = pOutdoor->pBModels[a2 >> 9].pFaces[obj_id & 0x3F].sCogTriggeredID; + EventProcessor(v448, a2, 1); + } + LODWORD(v727) = 1; + break; + } + case SPELL_BODY_CURE_WEAKNESS://Лечить Слабость + { + switch (skill_level) + { + case 1: amount = 180 * spell_level; break;//3 минуты * количество очков навыка + case 2: amount = 3600 * spell_level; break;//1 час * количество очков навыка + case 3: amount = 86400 * spell_level; break; + case 4: amount = 0; break; + default: + assert(false); + } + if ( !pPlayer->CanCastSpell(uRequiredMana) ) + break; + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2); + if ( pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Weak] ) + { + if ( skill_level == 4 ) + { + pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Weak] = 0; + LODWORD(v727) = 1; + break; + } + pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan(Condition_Weak, + (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335)); + } + LODWORD(v727) = 1; + break; + } + case SPELL_BODY_FIRST_AID://Первая помощь + { + switch (skill_level) + { + case 1: amount = 2 * spell_level + 5; break; + case 2: amount = 3 * spell_level + 5; break; + case 3: amount = 4 * spell_level + 5; break; + case 4: amount = 5 * spell_level + 5; break; + default: + assert(false); + } + if ( !pPlayer->CanCastSpell(uRequiredMana) ) + break; + if ( !pCastSpell->spell_target_pid ) + { + pParty->pPlayers[pCastSpell->uPlayerID_2].Heal(amount); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2); + } + if (PID_TYPE(pCastSpell->spell_target_pid) == OBJECT_Actor) + { + mon_id = PID_ID(pCastSpell->spell_target_pid); + if ( pActors[mon_id].uAIState != Dead && pActors[mon_id].uAIState != Dying && pActors[mon_id].uAIState != Disabled + && pActors[mon_id].uAIState != Removed ) + { + pActors[mon_id].sCurrentHP += amount; + if ( pActors[mon_id].sCurrentHP > pActors[mon_id].pMonsterInfo.uHP ) + pActors[mon_id].sCurrentHP = pActors[mon_id].pMonsterInfo.uHP; + } + } + LODWORD(v727) = 1; + break; + } + case SPELL_BODY_CURE_POISON://Лечение Отравления(Противоядие) + { + switch (skill_level) + { + case 1: amount = 3600 * spell_level; break; + case 2: amount = 3600 * spell_level; break; + case 3: amount = 86400 * spell_level; break; + case 4: amount = 0; break; + default: + assert(false); + } + if ( !pPlayer->CanCastSpell(uRequiredMana) ) + break; + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2); + if ( pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Poison_Weak] + || pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Poison_Medium] + || pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Poison_Severe] ) + { + if ( skill_level == 4 ) + { + pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Poison_Weak] = 0; + pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Poison_Medium] = 0; + pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Poison_Severe] = 0; + LODWORD(v727) = 1; + break; + } + pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan(Condition_Poison_Weak, (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335)); + pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan(Condition_Poison_Medium, (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335)); + pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan(Condition_Poison_Severe, (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335)); + } LODWORD(v727) = 1; break; } - case SPELL_MIND_BERSERK: - { - switch (skill_level) - { - case 1: amount = 300 * spell_level; break; - case 2: amount = 300 * spell_level; break; - case 3: amount = 600 * spell_level; break; - case 4: amount = 3600; break; - default: - assert(false); - } - if ( !pPlayer->CanCastSpell(uRequiredMana) ) - break; - v426 = PID_ID(a2); - if (PID_TYPE(a2) != OBJECT_Actor) - { - LODWORD(v727) = 1; - break; - } - v730 = 836 * v426; - if ( stru_50C198.GetMagicalResistance(&pActors[v426], 7u) ) - { - pActors[v426].pActorBuffs[ACTOR_BUFF_CHARM].Reset(); - pActors[v426].pActorBuffs[ACTOR_BUFF_ENSLAVED].Reset(); - pActors[v426].pActorBuffs[ACTOR_BUFF_BERSERK].Apply( - pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), - skill_level, 0, 0, 0); - pActors[v426].pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long; - } - pSpellSprite.stru_24.Reset(); - pSpellSprite.spell_id = pCastSpell->uSpellID; - pSpellSprite.spell_level = spell_level; - pSpellSprite.spell_skill = skill_level; - v60 = pObjectList->ObjectIDByItemID(pSpellSprite.uType); - v61 = v426; - pSpellSprite.uObjectDescID = v60; - pSpellSprite.vPosition.x = pActors[v61].vPosition.x; - pSpellSprite.vPosition.y = pActors[v61].vPosition.y; - pSpellSprite.vPosition.z = pActors[v61].vPosition.z + pActors[v61].uActorHeight; - pSpellSprite.uAttributes = 0; - pSpellSprite.uSectorID = pIndoor->GetSector(pActors[v61].vPosition.x, pActors[v61].vPosition.y, pSpellSprite.vPosition.z); - pSpellSprite.uSpriteFrameID = 0; - pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID); - pSpellSprite.spell_target_pid = a2; - pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); - pSpellSprite.uFacing = LOWORD(v715.uYawAngle); - LOBYTE(pSpellSprite.uAttributes) |= 0x80u; - pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id); - pSpellSprite.Create(0, 0, 0, pCastSpell->uPlayerID + 1); - LODWORD(v727) = 1; - break; - } - case SPELL_MIND_ENSLAVE: - { - if ( !pPlayer->CanCastSpell(uRequiredMana) ) - break; - amount = 600 * spell_level; - if (PID_TYPE(a2) != OBJECT_Actor) - { - LODWORD(v727) = 1; - break; - } - v730 = 836 * PID_ID(a2); - if ( MonsterStats::BelongsToSupertype(pActors[PID_ID(a2)].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) - break; - if ( stru_50C198.GetMagicalResistance(&pActors[PID_ID(a2)], 7u) ) - { - pActors[PID_ID(a2)].pActorBuffs[ACTOR_BUFF_BERSERK].Reset(); - pActors[PID_ID(a2)].pActorBuffs[ACTOR_BUFF_CHARM].Reset(); - pActors[PID_ID(a2)].pActorBuffs[ACTOR_BUFF_ENSLAVED].Apply(pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), - skill_level, 0, 0, 0); - } - pSpellSprite.stru_24.Reset(); - pSpellSprite.spell_id = pCastSpell->uSpellID; - pSpellSprite.spell_level = spell_level; - pSpellSprite.spell_skill = skill_level; - v60 = pObjectList->ObjectIDByItemID(pSpellSprite.uType); - v61 = PID_ID(a2); - pSpellSprite.uObjectDescID = v60; - pSpellSprite.vPosition.x = pActors[v61].vPosition.x; - pSpellSprite.vPosition.y = pActors[v61].vPosition.y; - pSpellSprite.vPosition.z = pActors[v61].vPosition.z + pActors[v61].uActorHeight; - pSpellSprite.uAttributes = 0; - pSpellSprite.uSectorID = pIndoor->GetSector(pActors[v61].vPosition.x, pActors[v61].vPosition.y, pSpellSprite.vPosition.z); - pSpellSprite.uSpriteFrameID = 0; - pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID); - pSpellSprite.spell_target_pid = a2; - pSpellSprite.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); - pSpellSprite.uFacing = LOWORD(v715.uYawAngle); - LOBYTE(pSpellSprite.uAttributes) |= 0x80u; - pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id); - pSpellSprite.Create(0, 0, 0, pCastSpell->uPlayerID + 1); - LODWORD(v727) = 1; - break; - } - case SPELL_MIND_MASS_FEAR: - { - if ( skill_level == 4 ) - amount = 300 * spell_level; - else - amount = 180 * spell_level; - if ( !pPlayer->CanCastSpell(uRequiredMana) ) - break; - int _v726 = pRenderer->_46А6АС_GetActorsInViewport(4096); - pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xA0A0Au, 192); - ++pSpellSprite.uType; - pSpellSprite.stru_24.Reset(); - pSpellSprite.spell_id = pCastSpell->uSpellID; - pSpellSprite.spell_level = spell_level; - pSpellSprite.spell_skill = skill_level; - pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType); - pSpellSprite.uAttributes = 0; - pSpellSprite.uSectorID = 0; - pSpellSprite.uSpriteFrameID = 0; - pSpellSprite.field_60_distance_related_prolly_lod = 0; - pSpellSprite.uFacing = 0; - pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID); - pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id); - for ( a2 = 0; a2 < (signed int)_v726; ++a2 ) - { - v433 = &pActors[_50BF30_actors_in_viewport_ids[a2]]; - if ( MonsterStats::BelongsToSupertype(v433->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) - break; - pSpellSprite.vPosition.x = v433->vPosition.x; - pSpellSprite.vPosition.y = v433->vPosition.y; - pSpellSprite.vPosition.z = v433->vPosition.z - (unsigned int)(signed __int64)((double)v433->uActorHeight * -0.8); - - pSpellSprite.spell_target_pid = PID(OBJECT_Actor, _50BF30_actors_in_viewport_ids[a2]); - pSpellSprite.Create(0, 0, 0, 0); - if ( stru_50C198.GetMagicalResistance(v433, 7u) ) - { - v433->pActorBuffs[ACTOR_BUFF_AFRAID].Apply(pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), - skill_level, 0, 0, 0); - } - } - LODWORD(v727) = 1; - break; - } - case SPELL_MIND_CURE_INSANITY: - { - v435 = skill_level - 2; - if ( skill_level == 4 ) - amount = 0; - else - amount = 86400 * spell_level; - if ( !pPlayer->CanCastSpell(uRequiredMana) ) - break; - - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2); - v440 = pCastSpell->uPlayerID_2; - if ( HIDWORD(pParty->pPlayers[v440].pConditions[5]) | LODWORD(pParty->pPlayers[v440].pConditions[5]) ) - { - if ( !(HIDWORD(pParty->pPlayers[v440].pConditions[1]) | LODWORD(pParty->pPlayers[v440].pConditions[1])) ) - pParty->pPlayers[v440].PlaySound(SPEECH_25, 0); - if ( skill_level == 4 ) - { - v441 = pCastSpell->uPlayerID_2; - LODWORD(pParty->pPlayers[v441].pConditions[5]) = 0; - HIDWORD(pParty->pPlayers[v441].pConditions[5]) = 0; - } - else - { - pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan(5u, - (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335)); - } - v377 = &pParty->pPlayers[pCastSpell->uPlayerID_2]; - v377->SetCondition(1, 0); - } - LODWORD(v727) = 1; - break; - } - case SPELL_EARTH_TELEKINESIS: - { - switch (skill_level) - { - case 1: amount = 2 * spell_level; break; - case 2: amount = 2 * spell_level; break; - case 3: amount = 3 * spell_level; break; - case 4: amount = 4 * spell_level; break; - default: - assert(false); - } - if ( !pPlayer->CanCastSpell(uRequiredMana) ) - break; - v445 = PID_ID(a2); - if (PID_TYPE(a2) == OBJECT_Item) - { - v449 = (char *)&pSpriteObjects[v445].stru_24; - v450 = *(int *)v449; - if ( pItemsTable->pItems[v450].uEquipType == 18 ) - { - pParty->PartyFindsGold(*((int *)v449 + 3), 0); - viewparams->bRedrawGameUI = 1; - } - else - { - sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[471], pItemsTable->pItems[v450].pUnidentifiedName); - ShowStatusBarString(pTmpBuf2.data(), 2u); - if ( !pParty->AddItemToParty(&pSpriteObjects[v445].stru_24) ) - pParty->SetHoldingItem(&pSpriteObjects[v445].stru_24); - } - SpriteObject::OnInteraction(v445); - } - else - { - if (PID_TYPE(a2) == OBJECT_Actor) - { - pActors[v445].LootActor(); - } - else - { - if (PID_TYPE(a2) != OBJECT_Decoration) - { - if (PID_TYPE(a2) != OBJECT_BModel) - { - LODWORD(v727) = 1; - break; - } - OpenedTelekinesis = true; - if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) - v448 = pIndoor->pFaceExtras[pIndoor->pFaces[v445].uFaceExtraID].uEventID; - else - v448 = pOutdoor->pBModels[a2 >> 9].pFaces[v445 & 0x3F].sCogTriggeredID; - EventProcessor(v448, a2, 1); - LODWORD(v727) = 1; - break; - } - OpenedTelekinesis = true; - if ( pLevelDecorations[v445].uEventID ) - { - EventProcessor(v448, a2, 1); - LODWORD(v727) = 1; - break; - } - if ( pLevelDecorations[v445].IsInteractive() ) - { - activeLevelDecoration = &pLevelDecorations[v445]; - EventProcessor(stru_5E4C90_MapPersistVars._decor_events[pLevelDecorations[v445]._idx_in_stru123 - 75] + 380, 0, 1); - activeLevelDecoration = NULL; - } - } - } - LODWORD(v727) = 1; - break; - } - case SPELL_BODY_CURE_WEAKNESS: - { - switch (skill_level) - { - case 1: amount = 180 * spell_level; break; - case 2: amount = 3600 * spell_level; break; - case 3: amount = 86400 * spell_level; break; - case 4: amount = 0; break; - default: - assert(false); - } - if ( !pPlayer->CanCastSpell(uRequiredMana) ) - break; - - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2); - v323 = pCastSpell->uPlayerID_2; - v324 = (char *)&pParty->pPlayers[v323].pConditions[1]; - if ( !pParty->pPlayers[v323].pConditions[1] ) - { - LODWORD(v727) = 1; - break; - } - if ( skill_level == 4 ) - { - *(int *)v324 = 0; - *((int *)v324 + 1) = 0; - LODWORD(v727) = 1; - break; - } - v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); - v656 = 1; - v325 = &pParty->pPlayers[v323]; - v325->DiscardConditionIfLastsLongerThan(v656, v663); - LODWORD(v727) = 1; - break; - } - case SPELL_BODY_FIRST_AID: - { - switch (skill_level) - { - case 1: amount = 2 * spell_level + 5; break; - case 2: amount = 3 * spell_level + 5; break; - case 3: amount = 4 * spell_level + 5; break; - case 4: amount = 5 * spell_level + 5; break; - default: - assert(false); - } - if ( !pPlayer->CanCastSpell(uRequiredMana) ) - break; - v460 = pCastSpell->spell_target_pid; - if (!v460) - { - pParty->pPlayers[pCastSpell->uPlayerID_2].Heal(amount); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2); - } - else - { - if (PID_TYPE(v460) == OBJECT_Actor) - { - v461 = &pActors[PID_ID(v460)]; - v462 = v461->uAIState; - v463 = v461->pMonsterInfo.uHP; - if ( v462 != 5 ) - { - if ( v462 != 4 ) - { - if ( v462 != 19 ) - { - if ( v462 != 11 ) - { - v461->sCurrentHP += amount; - if ( v461->sCurrentHP > v463 ) - v461->sCurrentHP = v463; - } - } - } - } - } - } - LODWORD(v727) = 1; - break; - } - case SPELL_BODY_CURE_POISON: - { - switch (skill_level) - { - case 1: amount = 3600 * spell_level; break; - case 2: amount = 3600 * spell_level; break; - case 3: amount = 86400 * spell_level; break; - case 4: amount = 0; break; - default: - assert(false); - } - if ( !pPlayer->CanCastSpell(uRequiredMana) ) - break; - - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2); - v470 = pCastSpell->uPlayerID_2; - if ( !(HIDWORD(pParty->pPlayers[v470].pConditions[6]) | LODWORD(pParty->pPlayers[v470].pConditions[6])) - && !(HIDWORD(pParty->pPlayers[v470].pConditions[8]) | LODWORD(pParty->pPlayers[v470].pConditions[8])) - && !(HIDWORD(pParty->pPlayers[v470].pConditions[10]) | LODWORD(pParty->pPlayers[v470].pConditions[10])) ) - { - LODWORD(v727) = 1; - break; - } - if ( skill_level == 4 ) - { - LODWORD(pParty->pPlayers[v470].pConditions[6]) = 0; - HIDWORD(pParty->pPlayers[v470].pConditions[6]) = 0; - v471 = pCastSpell->uPlayerID_2; - LODWORD(pParty->pPlayers[v471].pConditions[8]) = 0; - HIDWORD(pParty->pPlayers[v471].pConditions[8]) = 0; - v472 = pCastSpell->uPlayerID_2; - LODWORD(pParty->pPlayers[v472].pConditions[10]) = 0; - HIDWORD(pParty->pPlayers[v472].pConditions[10]) = 0; - LODWORD(v727) = 1; - break; - } - *(float *)&a2 = (double)(amount << 7) * 0.033333335; - pParty->pPlayers[v470].DiscardConditionIfLastsLongerThan( - 6u, - (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); - pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan( - 8u, - (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); - v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2); - v656 = 10; - v325 = &pParty->pPlayers[pCastSpell->uPlayerID_2]; - v325->DiscardConditionIfLastsLongerThan(v656, v663); - LODWORD(v727) = 1; - break; - } - case SPELL_BODY_PROTECTION_FROM_MAGIC: - { - amount = spell_level; - LODWORD(v733) = 3600 * spell_level; - if ( !pPlayer->CanCastSpell(uRequiredMana) ) - break; - - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3); - - pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), skill_level, spell_level, 0, 0); - LODWORD(v727) = 1; - break; - } - case SPELL_BODY_HAMMERHANDS: - { - LODWORD(v733) = 3600 * spell_level; - amount = spell_level; - if ( !pPlayer->CanCastSpell(uRequiredMana) ) - break; - if ( skill_level == 4 ) - { - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3); - v732 = (int)v733 << 7; - v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); - pParty->pPlayers[0].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + v717, 4u, spell_level, spell_level, 0); - pParty->pPlayers[1].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + v717, 4u, spell_level, spell_level, 0); - pParty->pPlayers[2].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + v717, 4u, spell_level, spell_level, 0); - - pParty->pPlayers[3].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + v717, 4, spell_level, spell_level, 0); - LODWORD(v727) = 1; - break; - } - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2); - - pParty->pPlayers[pCastSpell->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), skill_level, spell_level, spell_level, 0); - LODWORD(v727) = 1; - break; - } - case SPELL_BODY_CURE_DISEASE: - { - if ( skill_level == 4 ) - amount = 0; - else - amount = 86400 * spell_level; - if ( !pPlayer->CanCastSpell(uRequiredMana) ) - break; - - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2); - v498 = pCastSpell->uPlayerID_2; - if ( !(HIDWORD(pParty->pPlayers[v498].pConditions[7]) | LODWORD(pParty->pPlayers[v498].pConditions[7])) - && !(HIDWORD(pParty->pPlayers[v498].pConditions[9]) | LODWORD(pParty->pPlayers[v498].pConditions[9])) - && !(HIDWORD(pParty->pPlayers[v498].pConditions[11]) | LODWORD(pParty->pPlayers[v498].pConditions[11])) ) - { - LODWORD(v727) = 1; - break; - } - if ( skill_level == 4 ) - { - LODWORD(pParty->pPlayers[v498].pConditions[7]) = 0; - HIDWORD(pParty->pPlayers[v498].pConditions[7]) = 0; - v499 = pCastSpell->uPlayerID_2; - LODWORD(pParty->pPlayers[v499].pConditions[9]) = 0; - HIDWORD(pParty->pPlayers[v499].pConditions[9]) = 0; - v500 = pCastSpell->uPlayerID_2; - LODWORD(pParty->pPlayers[v500].pConditions[11]) = 0; - HIDWORD(pParty->pPlayers[v500].pConditions[11]) = 0; - } - else - { - *(float *)&a2 = (double)(amount << 7) * 0.033333335; - pParty->pPlayers[v498].DiscardConditionIfLastsLongerThan( - 7u, - (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); - pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan( - 9u, - (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); - v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2); - v656 = 11; - v325 = &pParty->pPlayers[pCastSpell->uPlayerID_2]; - v325->DiscardConditionIfLastsLongerThan(v656, v663); - } - LODWORD(v727) = 1; - break; - } - case SPELL_BODY_POWER_CURE: - { - amount = 5 * spell_level + 10; - if ( !pPlayer->CanCastSpell(uRequiredMana) ) - break; - v501 = pParty->pPlayers.data(); - int v1 = 0; - do - { - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, v1); - v501->Heal(amount); - ++v501; - ++v1; - } - while ( (signed int)v501 < (signed int)pParty->pHirelings.data() ); - LODWORD(v727) = 1; - break; - } - case SPELL_LIGHT_DISPEL_MAGIC: - { - sRecoveryTime -= spell_level; - if ( !pPlayer->CanCastSpell(uRequiredMana) ) - break; - - pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xAFF0A, 192); - v505 = pRenderer->_46А6АС_GetActorsInViewport(4096); - ++pSpellSprite.uType; - //signed int _v733 = v505; - v688.x = 0; - v688.y = 0; - v688.z = 0; - pSpellSprite.stru_24.Reset(); - pSpellSprite.spell_id = pCastSpell->uSpellID; - pSpellSprite.spell_level = spell_level; - pSpellSprite.spell_skill = skill_level; - pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType); - pSpellSprite.uAttributes = 0; - pSpellSprite.uSectorID = 0; - pSpellSprite.uSpriteFrameID = 0; - pSpellSprite.field_60_distance_related_prolly_lod = 0; - pSpellSprite.uFacing = 0; - pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID); - pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id); - a2 = 0; - for ( a2 = 0; a2 < v505; ++a2 ) - { - v507 = _50BF30_actors_in_viewport_ids[a2]; - pSpellSprite.vPosition.x = pActors[v507].vPosition.x; - pSpellSprite.vPosition.y = pActors[v507].vPosition.y; - pSpellSprite.vPosition.z = pActors[v507].vPosition.z - (unsigned int)(signed __int64)((double)pActors[v507].uActorHeight * -0.8); - pSpellSprite.spell_target_pid = PID(OBJECT_Actor, _50BF30_actors_in_viewport_ids[a2]); - v509 = pSpellSprite.Create(0, 0, 0, 0); - DamageMonsterFromParty(PID(OBJECT_Item, v509), _50BF30_actors_in_viewport_ids[a2], &v688); - } - for ( a2 = 0; a2 < v505; ++a2 ) - { - pActor = &pActors[_50BF30_actors_in_viewport_ids[a2]]; - pSpellSprite.vPosition.x = pActor->vPosition.x; - pSpellSprite.vPosition.y = pActor->vPosition.y; - pSpellSprite.vPosition.z = pActor->vPosition.z - (unsigned int)(signed __int64)((double)pActor->uActorHeight * -0.8); - pSpellSprite.spell_target_pid = PID(OBJECT_Actor, _50BF30_actors_in_viewport_ids[a2]); - pSpellSprite.Create(0, 0, 0, 0); - for (int i = 0; i < 22; ++i) - { - pActor->pActorBuffs[i].Reset(); - } - } - LODWORD(v727) = 1; - break; - } - case SPELL_LIGHT_SUMMON_ELEMENTAL: - { - switch (skill_level) - { - case 1: v733 = 300 * spell_level; amount = 1; break; - case 2: v733 = 300 * spell_level; amount = 1; break; - case 3: v733 = 900 * spell_level; amount = 3; break; - case 4: v733 = 900 * spell_level; amount = 5; break; - default: - assert(false); - } - //v733 = __PAIR__(0, v516); - signed int _v733 = 0; - if ( (signed int)uNumActors > 0 ) - { - v518 = pActors.data();//[0].uAIState; - size_t _v726 = uNumActors; - do - { - v519 = v518->uAIState; - if ( v518->uAIState != 5 && v519 != 11 && v519 != 19 && PID(OBJECT_Player, pCastSpell->uPlayerID) == v518->uSummonerID ) - ++_v733; - ++v518; - --_v726; - } - while ( _v726 != 0 ); - } - if ( _v733 >= amount ) - { - ShowStatusBarString(pGlobalTXT_LocalizationStrings[648], 2); // This character can't summon any more monsters! - pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); - pCastSpell->uSpellID = 0; - continue; - } - if ( !pPlayer->CanCastSpell(uRequiredMana) ) - break; - sub_44FA4C_spawn_light_elemental(pCastSpell->uPlayerID, skill_level, v733); - LODWORD(v727) = 1; - break; - } - case SPELL_LIGHT_DAY_OF_THE_GODS: - { - switch (skill_level) - { - case 1: LODWORD(v733) = 10800 * spell_level; amount = 3 * spell_level + 10; break; - case 2: LODWORD(v733) = 10800 * spell_level; amount = 3 * spell_level + 10; break; - case 3: LODWORD(v733) = 14400 * spell_level; amount = 4 * spell_level + 10; break; - case 4: LODWORD(v733) = 18000 * spell_level; amount = 5 * spell_level + 10; break; - default: - assert(false); - } - if ( !pPlayer->CanCastSpell(uRequiredMana) ) - break; - - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2); - pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3); - - pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), skill_level, amount, 0, 0); - LODWORD(v727) = 1; - break; - } - case SPELL_LIGHT_PRISMATIC_LIGHT: - { - //v67 = 2; - if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) - { - ShowStatusBarString(pGlobalTXT_LocalizationStrings[497], 2); // Can't cast Prismatic Light outdoors! - pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); - pCastSpell->uSpellID = 0; - continue; - } - if ( !pPlayer->CanCastSpell(uRequiredMana) ) - break; - v531 = pRenderer->_46А6АС_GetActorsInViewport(4096); - ++pSpellSprite.uType; - v694.x = 0; - v694.y = 0; - v694.z = 0; - pSpellSprite.stru_24.Reset(); - pSpellSprite.spell_id = pCastSpell->uSpellID; - pSpellSprite.spell_level = spell_level; - pSpellSprite.spell_skill = skill_level; - pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType); - pSpellSprite.uAttributes = 0; - pSpellSprite.uSectorID = 0; - pSpellSprite.uSpriteFrameID = 0; - pSpellSprite.field_60_distance_related_prolly_lod = 0; - pSpellSprite.uFacing = 0; - pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID); - pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id); - a2 = 0; + case SPELL_BODY_PROTECTION_FROM_MAGIC://Защита от магии + { + if ( !pPlayer->CanCastSpell(uRequiredMana) ) + break; + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3); + pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].Apply(pParty->uTimePlayed + + (signed __int64)((double)(signed int)((int)(3600 * spell_level) << 7) * 0.033333335), skill_level, spell_level, 0, 0); + LODWORD(v727) = 1; + break; + } + case SPELL_BODY_HAMMERHANDS://Руки-Молоты + { + if ( !pPlayer->CanCastSpell(uRequiredMana) ) + break; + if ( skill_level == 4 ) + { + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3); + for ( uint pl_id = 0; pl_id < 4; pl_id++) + pParty->pPlayers[pl_id].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + + (signed int)(signed __int64)((double)(signed int)((int)(3600 * spell_level) << 7) * 0.033333335), 4, spell_level, spell_level, 0); + LODWORD(v727) = 1; + break; + } + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2); + pParty->pPlayers[pCastSpell->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + + (signed int)(signed __int64)((double)(signed int)((int)(3600 * spell_level) << 7) * 0.033333335), skill_level, spell_level, spell_level, 0); + LODWORD(v727) = 1; + break; + } + case SPELL_BODY_CURE_DISEASE://Лечить Болезнь + { + if ( skill_level == 4 ) + amount = 0; + else + amount = 86400 * spell_level; + if ( !pPlayer->CanCastSpell(uRequiredMana) ) + break; + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pCastSpell->uPlayerID_2); + if ( pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Disease_Weak] + || pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Disease_Medium] + || pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Disease_Severe] ) + { + if ( skill_level == 4 ) + { + pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Disease_Weak] = 0; + pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Disease_Medium] = 0; + pParty->pPlayers[pCastSpell->uPlayerID_2].pConditions[Condition_Disease_Severe] = 0; + } + pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan(Condition_Disease_Weak, + (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335)); + pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan(Condition_Disease_Medium, + (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335)); + pParty->pPlayers[pCastSpell->uPlayerID_2].DiscardConditionIfLastsLongerThan(Condition_Disease_Severe, + (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335)); + } + LODWORD(v727) = 1; + break; + } + case SPELL_BODY_POWER_CURE://Исцеление + { + if ( !pPlayer->CanCastSpell(uRequiredMana) ) + break; + for ( uint pl_id = 0; pl_id < 4; ++pl_id ) + { + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, pl_id); + pParty->pPlayers[pl_id].Heal(5 * spell_level + 10); + } + LODWORD(v727) = 1; + break; + } + case SPELL_LIGHT_DISPEL_MAGIC://Снятие чар + { + sRecoveryTime -= spell_level; + if ( !pPlayer->CanCastSpell(uRequiredMana) ) + break; + pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xAFF0A, 192); + int mon_num = pRenderer->_46А6АС_GetActorsInViewport(4096); + ++pSpellSprite.uType; + v688.x = 0; + v688.y = 0; + v688.z = 0; + pSpellSprite.stru_24.Reset(); + pSpellSprite.spell_id = pCastSpell->uSpellID; + pSpellSprite.spell_level = spell_level; + pSpellSprite.spell_skill = skill_level; + pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType); + pSpellSprite.uAttributes = 0; + pSpellSprite.uSectorID = 0; + pSpellSprite.uSpriteFrameID = 0; + pSpellSprite.field_60_distance_related_prolly_lod = 0; + pSpellSprite.uFacing = 0; + pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID); + pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id); + for ( a2 = 0; a2 < mon_num; ++a2 ) + { + pSpellSprite.vPosition.x = pActors[_50BF30_actors_in_viewport_ids[a2]].vPosition.x; + pSpellSprite.vPosition.y = pActors[_50BF30_actors_in_viewport_ids[a2]].vPosition.y; + pSpellSprite.vPosition.z = pActors[_50BF30_actors_in_viewport_ids[a2]].vPosition.z - + (unsigned int)(signed __int64)((double)pActors[_50BF30_actors_in_viewport_ids[a2]].uActorHeight * -0.8); + pSpellSprite.spell_target_pid = PID(OBJECT_Actor, _50BF30_actors_in_viewport_ids[a2]); + DamageMonsterFromParty(PID(OBJECT_Item, pSpellSprite.Create(0, 0, 0, 0)), _50BF30_actors_in_viewport_ids[a2], &v688); + } + for ( a2 = 0; a2 < mon_num; ++a2 ) + { + pSpellSprite.vPosition.x = pActors[_50BF30_actors_in_viewport_ids[a2]].vPosition.x; + pSpellSprite.vPosition.y = pActors[_50BF30_actors_in_viewport_ids[a2]].vPosition.y; + pSpellSprite.vPosition.z = pActors[_50BF30_actors_in_viewport_ids[a2]].vPosition.z - + (unsigned int)(signed __int64)((double)pActors[_50BF30_actors_in_viewport_ids[a2]].uActorHeight * -0.8); + pSpellSprite.spell_target_pid = PID(OBJECT_Actor, _50BF30_actors_in_viewport_ids[a2]); + pSpellSprite.Create(0, 0, 0, 0); + for (int i = 0; i < 22; ++i) + pActors[_50BF30_actors_in_viewport_ids[a2]].pActorBuffs[i].Reset(); + } + LODWORD(v727) = 1; + break; + } + case SPELL_LIGHT_SUMMON_ELEMENTAL://Элементал + { + switch (skill_level) + { + case 1: v733 = 300 * spell_level; amount = 1; break; + case 2: v733 = 300 * spell_level; amount = 1; break; + case 3: v733 = 900 * spell_level; amount = 3; break; + case 4: v733 = 900 * spell_level; amount = 5; break; + default: + assert(false); + } + int mon_num = 0; + for ( uint mon_id = 0; mon_id < uNumActors; mon_id++ ) + { + if ( pActors[mon_id].uAIState != Dead && pActors[mon_id].uAIState != Removed && pActors[mon_id].uAIState != Disabled + && PID(OBJECT_Player, pCastSpell->uPlayerID) == pActors[mon_id].uSummonerID ) + ++mon_num; + } + if ( mon_num >= amount ) + { + ShowStatusBarString(pGlobalTXT_LocalizationStrings[648], 2); // This character can't summon any more monsters! + pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); + pCastSpell->uSpellID = 0; + continue; + } + if ( !pPlayer->CanCastSpell(uRequiredMana) ) + break; + sub_44FA4C_spawn_light_elemental(pCastSpell->uPlayerID, skill_level, v733); + LODWORD(v727) = 1; + break; + } + case SPELL_LIGHT_DAY_OF_THE_GODS://День богов + { + switch (skill_level) + { + case 1: duration = 10800 * spell_level; amount = 3 * spell_level + 10; break; + case 2: duration = 10800 * spell_level; amount = 3 * spell_level + 10; break; + case 3: duration = 14400 * spell_level; amount = 4 * spell_level + 10; break; + case 4: duration = 18000 * spell_level; amount = 5 * spell_level + 10; break; + default: + assert(false); + } + if ( !pPlayer->CanCastSpell(uRequiredMana) ) + break; + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 0); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 1); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 2); + pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, 3); + pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS].Apply(pParty->uTimePlayed + + (signed __int64)((double)(signed int)((int)duration << 7) * 0.033333335), skill_level, amount, 0, 0); + LODWORD(v727) = 1; + break; + } + case SPELL_LIGHT_PRISMATIC_LIGHT://Свет призмы + { + //v67 = 2; + if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) + { + ShowStatusBarString(pGlobalTXT_LocalizationStrings[497], 2); // Can't cast Prismatic Light outdoors! + pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); + pCastSpell->uSpellID = 0; + continue; + } + if ( !pPlayer->CanCastSpell(uRequiredMana) ) + break; + v531 = pRenderer->_46А6АС_GetActorsInViewport(4096); + ++pSpellSprite.uType; + v694.x = 0; + v694.y = 0; + v694.z = 0; + pSpellSprite.stru_24.Reset(); + pSpellSprite.spell_id = pCastSpell->uSpellID; + pSpellSprite.spell_level = spell_level; + pSpellSprite.spell_skill = skill_level; + pSpellSprite.uObjectDescID = pObjectList->ObjectIDByItemID(pSpellSprite.uType); + pSpellSprite.uAttributes = 0; + pSpellSprite.uSectorID = 0; + pSpellSprite.uSpriteFrameID = 0; + pSpellSprite.field_60_distance_related_prolly_lod = 0; + pSpellSprite.uFacing = 0; + pSpellSprite.spell_caster_pid = PID(OBJECT_Player, pCastSpell->uPlayerID); + pSpellSprite.uSoundID = LOWORD(pCastSpell->sound_id); + a2 = 0; if ( (signed int)v531 > 0 ) { do
--- a/Conditions.cpp Mon Jan 27 17:33:34 2014 +0600 +++ b/Conditions.cpp Tue Jan 28 17:25:58 2014 +0600 @@ -10,12 +10,12 @@ ConditionProcessor(Condition_Fear, false, false, 0), ConditionProcessor(Condition_Drunk, false, false, 0), ConditionProcessor(Condition_Insane, false, false, 19, ITEM_ARTIFACT_YORUBA, EQUIP_ARMOUR, ITEM_ARTIFACT_CLOAK_OF_THE_SHEEP, EQUIP_CLOAK), - ConditionProcessor(Condition_Poison1, true, false, 21, ITEM_ARTIFACT_YORUBA, EQUIP_ARMOUR, ITEM_ARTIFACT_CLOAK_OF_THE_SHEEP, EQUIP_CLOAK), - ConditionProcessor(Condition_Disease1, true, false, 18, ITEM_ARTIFACT_YORUBA, EQUIP_ARMOUR, ITEM_ARTIFACT_CLOAK_OF_THE_SHEEP, EQUIP_CLOAK), - ConditionProcessor(Condition_Poison2, true, false, 21, ITEM_ARTIFACT_YORUBA, EQUIP_ARMOUR, ITEM_ARTIFACT_CLOAK_OF_THE_SHEEP, EQUIP_CLOAK), - ConditionProcessor(Condition_Disease2, true, false, 18, ITEM_ARTIFACT_YORUBA, EQUIP_ARMOUR, ITEM_ARTIFACT_CLOAK_OF_THE_SHEEP, EQUIP_CLOAK), - ConditionProcessor(Condition_Poison3, true, false, 21, ITEM_ARTIFACT_YORUBA, EQUIP_ARMOUR, ITEM_ARTIFACT_CLOAK_OF_THE_SHEEP, EQUIP_CLOAK), - ConditionProcessor(Condition_Disease3, true, false, 18, ITEM_ARTIFACT_YORUBA, EQUIP_ARMOUR, ITEM_ARTIFACT_CLOAK_OF_THE_SHEEP, EQUIP_CLOAK), + ConditionProcessor(Condition_Poison_Weak, true, false, 21, ITEM_ARTIFACT_YORUBA, EQUIP_ARMOUR, ITEM_ARTIFACT_CLOAK_OF_THE_SHEEP, EQUIP_CLOAK), + ConditionProcessor(Condition_Disease_Weak, true, false, 18, ITEM_ARTIFACT_YORUBA, EQUIP_ARMOUR, ITEM_ARTIFACT_CLOAK_OF_THE_SHEEP, EQUIP_CLOAK), + ConditionProcessor(Condition_Poison_Medium, true, false, 21, ITEM_ARTIFACT_YORUBA, EQUIP_ARMOUR, ITEM_ARTIFACT_CLOAK_OF_THE_SHEEP, EQUIP_CLOAK), + ConditionProcessor(Condition_Disease_Medium, true, false, 18, ITEM_ARTIFACT_YORUBA, EQUIP_ARMOUR, ITEM_ARTIFACT_CLOAK_OF_THE_SHEEP, EQUIP_CLOAK), + ConditionProcessor(Condition_Poison_Severe, true, false, 21, ITEM_ARTIFACT_YORUBA, EQUIP_ARMOUR, ITEM_ARTIFACT_CLOAK_OF_THE_SHEEP, EQUIP_CLOAK), + ConditionProcessor(Condition_Disease_Severe, true, false, 18, ITEM_ARTIFACT_YORUBA, EQUIP_ARMOUR, ITEM_ARTIFACT_CLOAK_OF_THE_SHEEP, EQUIP_CLOAK), ConditionProcessor(Condition_Paralyzed, false, false, 20, ITEM_ARTIFACT_YORUBA, EQUIP_ARMOUR, ITEM_ARTIFACT_CLOAK_OF_THE_SHEEP, EQUIP_CLOAK, ITEM_ARTIFACT_GHOULSBANE, EQIUP_ANY), ConditionProcessor(Condition_Unconcious,false, false, 0), ConditionProcessor(Condition_Dead, true, true, 0),
--- a/Conditions.h Mon Jan 27 17:33:34 2014 +0600 +++ b/Conditions.h Tue Jan 28 17:25:58 2014 +0600 @@ -9,12 +9,12 @@ Condition_Fear = 3, Condition_Drunk = 4, Condition_Insane = 5, - Condition_Poison1 = 6, - Condition_Disease1 = 7, - Condition_Poison2 = 8, - Condition_Disease2 = 9, - Condition_Poison3 = 10, - Condition_Disease3 = 11, + Condition_Poison_Weak = 6, + Condition_Disease_Weak = 7, + Condition_Poison_Medium = 8, + Condition_Disease_Medium = 9, + Condition_Poison_Severe = 10, + Condition_Disease_Severe = 11, Condition_Paralyzed = 12, Condition_Unconcious = 13, Condition_Dead = 14,
--- a/Indoor.cpp Mon Jan 27 17:33:34 2014 +0600 +++ b/Indoor.cpp Tue Jan 28 17:25:58 2014 +0600 @@ -3087,7 +3087,7 @@ pActors[actor_id].uYawAngle = stru_5C6E00->Atan2(pActors[actor_id].vVelocity.x, pActors[actor_id].vVelocity.y); } } - if ( pIndoor->pFaces[v37].uAttributes & 8000000 ) + if ( pIndoor->pFaces[v37].uAttributes & 0x8000000 ) EventProcessor(pIndoor->pFaceExtras[ pIndoor->pFaces[v37].uFaceExtraID].uEventID, 0, 1); } pActors[actor_id].vVelocity.x = fixpoint_mul(58500, pActors[actor_id].vVelocity.x);
--- a/Monsters.cpp Mon Jan 27 17:33:34 2014 +0600 +++ b/Monsters.cpp Tue Jan 28 17:25:58 2014 +0600 @@ -275,17 +275,17 @@ return 4; else if ( strstr(spec_att_str, "insane") ) return 5; - else if ( strstr(spec_att_str, "poison1") ) + else if ( strstr(spec_att_str, "poison weak") ) return 6; - else if ( strstr(spec_att_str, "poison2") ) + else if ( strstr(spec_att_str, "poison medium") ) return 7; - else if ( strstr(spec_att_str, "poison3") ) + else if ( strstr(spec_att_str, "poison severe") ) return 8; - else if ( strstr(spec_att_str, "disease1") ) + else if ( strstr(spec_att_str, "disease weak") ) return 9; - else if ( strstr(spec_att_str, "disease2") ) + else if ( strstr(spec_att_str, "disease medium") ) return 10; - else if ( strstr(spec_att_str, "disease3") ) + else if ( strstr(spec_att_str, "disease severe") ) return 11; else if ( strstr(spec_att_str, "paralyze") ) return 12;
--- a/Monsters.h Mon Jan 27 17:33:34 2014 +0600 +++ b/Monsters.h Tue Jan 28 17:25:58 2014 +0600 @@ -90,12 +90,12 @@ SPECIAL_ATTACK_SLEEP = 3, SPECIAL_ATTACK_DRUNK = 4, SPECIAL_ATTACK_INSANE = 5, - SPECIAL_ATTACK_POISON1 = 6, - SPECIAL_ATTACK_POISON2 = 7, - SPECIAL_ATTACK_POISON3 = 8, - SPECIAL_ATTACK_DISEASE1 = 9, - SPECIAL_ATTACK_DISEASE2 = 10, - SPECIAL_ATTACK_DISEASE3 = 11, + SPECIAL_ATTACK_POISON_WEAK = 6, + SPECIAL_ATTACK_POISON_MEDIUM = 7, + SPECIAL_ATTACK_POISON_SEVERE = 8, + SPECIAL_ATTACK_DISEASE_WEAK = 9, + SPECIAL_ATTACK_DISEASE_MEDIUM = 10, + SPECIAL_ATTACK_DISEASE_SEVERE = 11, SPECIAL_ATTACK_PARALYZED = 12, SPECIAL_ATTACK_UNCONSCIOUS = 13, SPECIAL_ATTACK_DEAD = 14,
--- a/OSWindow.cpp Mon Jan 27 17:33:34 2014 +0600 +++ b/OSWindow.cpp Tue Jan 28 17:25:58 2014 +0600 @@ -559,17 +559,17 @@ AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40044, L"Afraid"); AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40043, L"Asleep"); AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40037, L"Curse"); - AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40036, L"Disease1"); - AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40035, L"Disease2"); - AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40034, L"Disease3"); + AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40036, L"Disease Weak"); + AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40035, L"Disease Medium"); + AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40034, L"Disease Severe"); AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40041, L"Dead"); AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40039, L"Drunk"); AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40042, L"Eradicated"); AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40038, L"Insane"); AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40045, L"Paralyzed"); - AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40033, L"Poison1"); - AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40032, L"Poison2"); - AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40031, L"Poison3"); + AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40033, L"Poison Weak"); + AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40032, L"Poison Medium"); + AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40031, L"Poison Severe"); AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40029, L"&Stone"); AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40040, L"Unconscious"); AppendMenuW(debug_party_setconditions, MF_ENABLED | MF_STRING, 40030, L"Weak"); @@ -712,12 +712,12 @@ case 40029: pPlayers[uActiveCharacter]->SetPertified(pParty->uTimePlayed); break; case 40030: pPlayers[uActiveCharacter]->SetWeak(pParty->uTimePlayed); break; - case 40031: pPlayers[uActiveCharacter]->SetPoison3(pParty->uTimePlayed); break; - case 40032: pPlayers[uActiveCharacter]->SetPoison2(pParty->uTimePlayed); break; - case 40033: pPlayers[uActiveCharacter]->SetPoison1(pParty->uTimePlayed); break; - case 40034: pPlayers[uActiveCharacter]->SetDisease3(pParty->uTimePlayed); break; - case 40035: pPlayers[uActiveCharacter]->SetDisease2(pParty->uTimePlayed); break; - case 40036: pPlayers[uActiveCharacter]->SetDisease1(pParty->uTimePlayed); break; + case 40031: pPlayers[uActiveCharacter]->SetPoisonSevere(pParty->uTimePlayed); break; + case 40032: pPlayers[uActiveCharacter]->SetPoisonMedium(pParty->uTimePlayed); break; + case 40033: pPlayers[uActiveCharacter]->SetPoisonWeak(pParty->uTimePlayed); break; + case 40034: pPlayers[uActiveCharacter]->SetDiseaseSevere(pParty->uTimePlayed); break; + case 40035: pPlayers[uActiveCharacter]->SetDiseaseMedium(pParty->uTimePlayed); break; + case 40036: pPlayers[uActiveCharacter]->SetDiseaseWeak(pParty->uTimePlayed); break; case 40037: pPlayers[uActiveCharacter]->SetCursed(pParty->uTimePlayed); break; case 40038: pPlayers[uActiveCharacter]->SetInsane(pParty->uTimePlayed); break; case 40039: pPlayers[uActiveCharacter]->SetDrunk(pParty->uTimePlayed); break;
--- a/Party.cpp Mon Jan 27 17:33:34 2014 +0600 +++ b/Party.cpp Tue Jan 28 17:25:58 2014 +0600 @@ -691,12 +691,12 @@ case Condition_Fear: player->expression = CHARACTER_EXPRESSION_FEAR; break; case Condition_Drunk: player->expression = CHARACTER_EXPRESSION_DRUNK; break; case Condition_Insane: player->expression = CHARACTER_EXPRESSION_INSANE; break; - case Condition_Poison1: - case Condition_Poison2: - case Condition_Poison3: player->expression = CHARACTER_EXPRESSION_POISONED; break; - case Condition_Disease1: - case Condition_Disease2: - case Condition_Disease3: player->expression = CHARACTER_EXPRESSION_DISEASED; break; + case Condition_Poison_Weak: + case Condition_Poison_Medium: + case Condition_Poison_Severe: player->expression = CHARACTER_EXPRESSION_POISONED; break; + case Condition_Disease_Weak: + case Condition_Disease_Medium: + case Condition_Disease_Severe: player->expression = CHARACTER_EXPRESSION_DISEASED; break; case Condition_Paralyzed: player->expression = CHARACTER_EXPRESSION_PARALYZED; break; case Condition_Unconcious: player->expression = CHARACTER_EXPRESSION_UNCONCIOUS; break; default: @@ -774,17 +774,17 @@ pPlayer->sMana = 0; pPlayer->sHealth /= 2; } - else if ( pPlayer->pConditions[Condition_Poison3] || pPlayer->pConditions[Condition_Disease3] ) + else if ( pPlayer->pConditions[Condition_Poison_Severe] || pPlayer->pConditions[Condition_Disease_Severe] ) { pPlayer->sHealth /= 4; pPlayer->sMana /= 4; } - else if ( pPlayer->pConditions[Condition_Poison2] || pPlayer->pConditions[Condition_Disease2] ) + else if ( pPlayer->pConditions[Condition_Poison_Medium] || pPlayer->pConditions[Condition_Disease_Medium] ) { pPlayer->sHealth /= 3; pPlayer->sMana /= 3; } - else if ( pPlayer->pConditions[Condition_Poison1] || pPlayer->pConditions[Condition_Disease1] ) + else if ( pPlayer->pConditions[Condition_Poison_Weak] || pPlayer->pConditions[Condition_Disease_Weak] ) { pPlayer->sHealth /= 2; pPlayer->sMana /= 2;
--- a/Player.cpp Mon Jan 27 17:33:34 2014 +0600 +++ b/Player.cpp Tue Jan 28 17:25:58 2014 +0600 @@ -682,12 +682,12 @@ case Condition_Fear: PlaySound(SPEECH_26, 0); break; case Condition_Drunk: PlaySound(SPEECH_31, 0); break; case Condition_Insane: PlaySound(SPEECH_29, 0); break; - case Condition_Poison1: - case Condition_Poison2: - case Condition_Poison3: PlaySound(SPEECH_27, 0); break; - case Condition_Disease1: - case Condition_Disease2: - case Condition_Disease3: PlaySound(SPEECH_28, 0);break; + case Condition_Poison_Weak: + case Condition_Poison_Medium: + case Condition_Poison_Severe: PlaySound(SPEECH_27, 0); break; + case Condition_Disease_Weak: + case Condition_Disease_Medium: + case Condition_Disease_Severe: PlaySound(SPEECH_28, 0);break; case Condition_Paralyzed: break; //nosound case Condition_Unconcious: PlaySound(SPEECH_32, 0); @@ -741,7 +741,7 @@ ++players_before; } - pConditions[uConditionIdx] = 1; + pConditions[uConditionIdx] = pParty->uTimePlayed; remainig_player = 0; players_after = 0; @@ -754,9 +754,7 @@ } } if (( players_before == 2 ) && ( players_after == 1 )) - { - pPlayers[remainig_player]->PlaySound(SPEECH_107, 0); - } + pPlayers[remainig_player]->PlaySound(SPEECH_107, 0);//скорее всего обнадёжывающий возглас последнего return; } @@ -2200,9 +2198,9 @@ case SPECIAL_ATTACK_WEAK: case SPECIAL_ATTACK_SLEEP: case SPECIAL_ATTACK_DRUNK: - case SPECIAL_ATTACK_DISEASE1: - case SPECIAL_ATTACK_DISEASE2: - case SPECIAL_ATTACK_DISEASE3: + case SPECIAL_ATTACK_DISEASE_WEAK: + case SPECIAL_ATTACK_DISEASE_MEDIUM: + case SPECIAL_ATTACK_DISEASE_SEVERE: case SPECIAL_ATTACK_UNCONSCIOUS: case SPECIAL_ATTACK_AGING: v6 = GetActualEndurance(); @@ -2216,9 +2214,9 @@ case SPECIAL_ATTACK_PETRIFIED: v11 = GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_EARTH); break; - case SPECIAL_ATTACK_POISON1: - case SPECIAL_ATTACK_POISON2: - case SPECIAL_ATTACK_POISON3: + case SPECIAL_ATTACK_POISON_WEAK: + case SPECIAL_ATTACK_POISON_MEDIUM: + case SPECIAL_ATTACK_POISON_SEVERE: case SPECIAL_ATTACK_DEAD: case SPECIAL_ATTACK_ERADICATED: v11 = GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_BODY); @@ -2342,38 +2340,38 @@ pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); return 1; break; - case SPECIAL_ATTACK_POISON1: - SetCondition(Condition_Poison1, 1); + case SPECIAL_ATTACK_POISON_WEAK: + SetCondition(Condition_Poison_Weak, 1); pAudioPlayer->PlaySound((SoundID)222, 0, 0, -1, 0, 0, 0, 0); pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); return 1; break; - case SPECIAL_ATTACK_POISON2: - SetCondition(Condition_Poison2, 1); + case SPECIAL_ATTACK_POISON_MEDIUM: + SetCondition(Condition_Poison_Medium, 1); pAudioPlayer->PlaySound((SoundID)222, 0, 0, -1, 0, 0, 0, 0); pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); return 1; break; - case SPECIAL_ATTACK_POISON3: - SetCondition(Condition_Poison3, 1); + case SPECIAL_ATTACK_POISON_SEVERE: + SetCondition(Condition_Poison_Severe, 1); pAudioPlayer->PlaySound((SoundID)222, 0, 0, -1, 0, 0, 0, 0); pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); return 1; break; - case SPECIAL_ATTACK_DISEASE1: - SetCondition(Condition_Disease1, 1); + case SPECIAL_ATTACK_DISEASE_WEAK: + SetCondition(Condition_Disease_Weak, 1); pAudioPlayer->PlaySound((SoundID)222, 0, 0, -1, 0, 0, 0, 0); pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); return 1; break; - case SPECIAL_ATTACK_DISEASE2: - SetCondition(Condition_Disease2, 1); + case SPECIAL_ATTACK_DISEASE_MEDIUM: + SetCondition(Condition_Disease_Medium, 1); pAudioPlayer->PlaySound((SoundID)222, 0, 0, -1, 0, 0, 0, 0); pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); return 1; break; - case SPECIAL_ATTACK_DISEASE3: - SetCondition(Condition_Disease3, 1); + case SPECIAL_ATTACK_DISEASE_SEVERE: + SetCondition(Condition_Disease_Severe, 1); pAudioPlayer->PlaySound((SoundID)222, 0, 0, -1, 0, 0, 0, 0); pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); return 1; @@ -4234,9 +4232,9 @@ } //----- (004908A8) -------------------------------------------------------- -bool Player::DiscardConditionIfLastsLongerThan(unsigned int uCondition, unsigned __int64 uTime) -{ - if ( pConditions[uCondition] && (uTime < (unsigned long long)pConditions[uCondition]) ) +bool Player::DiscardConditionIfLastsLongerThan(unsigned int uCondition, signed __int64 uTime) +{ + if ( pConditions[uCondition] && (uTime < (signed long long)pConditions[uCondition]) ) { pConditions[uCondition] = 0i64; return true; @@ -4284,7 +4282,7 @@ { if ( pParty->pPickedItem.uItemID == 160 ) { - playerAffected->SetCondition(Condition_Poison1, 1); + playerAffected->SetCondition(Condition_Poison_Weak, 1); } else if ( pParty->pPickedItem.uItemID == 161 ) { @@ -4335,7 +4333,7 @@ switch ( pParty->pPickedItem.uItemID ) { case 221: //Catalyst - playerAffected->SetCondition(Condition_Poison1, 1); + playerAffected->SetCondition(Condition_Poison_Weak, 1); break; case 222: //Cure Wounds v25 = pParty->pPickedItem.uEnchantmentType + 10; @@ -4356,15 +4354,15 @@ playerAffected->PlaySound(SPEECH_36, 0); break; case 225: //Cure Disease - playerAffected->pConditions[Condition_Disease3] = 0i64; - playerAffected->pConditions[Condition_Disease2] = 0i64; - playerAffected->pConditions[Condition_Disease1] = 0i64; + playerAffected->pConditions[Condition_Disease_Severe] = 0i64; + playerAffected->pConditions[Condition_Disease_Medium] = 0i64; + playerAffected->pConditions[Condition_Disease_Weak] = 0i64; playerAffected->PlaySound(SPEECH_36, 0); break; case 226: //Cure Poison - playerAffected->pConditions[Condition_Poison3] = 0i64; - playerAffected->pConditions[Condition_Poison2] = 0i64; - playerAffected->pConditions[Condition_Poison1] = 0i64; + playerAffected->pConditions[Condition_Poison_Severe] = 0i64; + playerAffected->pConditions[Condition_Poison_Medium] = 0i64; + playerAffected->pConditions[Condition_Poison_Weak] = 0i64; playerAffected->PlaySound(SPEECH_36, 0); break; case 227: //Awaken @@ -4686,7 +4684,7 @@ { v66 = aCharacterConditionNames[playerAffected->GetMajorConditionIdx()]; sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[382], v66);//"That player is %s" - ShowStatusBarString(pTmpBuf.data(), 2u); + ShowStatusBarString(pTmpBuf.data(), 2); pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); return; } @@ -4707,11 +4705,11 @@ { v22 = pParty->pPickedItem.GetDisplayName(); sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[381], v22); //"You don't have the skill to learn %s" - ShowStatusBarString(pTmpBuf.data(), 2u); + ShowStatusBarString(pTmpBuf.data(), 2); playerAffected->PlaySound((PlayerSpeech)20, 0); return; } - // v72 = 1; + playerAffected->spellbook.bHaveSpell[pParty->pPickedItem.uItemID-400] = 1; playerAffected->PlaySound(SPEECH_21, 0); v73 = 0; @@ -5174,17 +5172,17 @@ case VAR_Insane: return pConditions[Condition_Insane] > 0; case VAR_PoisonedGreen: - return pConditions[Condition_Poison1] > 0; + return pConditions[Condition_Poison_Weak] > 0; case VAR_DiseasedGreen: - return pConditions[Condition_Disease1] > 0; + return pConditions[Condition_Disease_Weak] > 0; case VAR_PoisonedYellow: - return pConditions[Condition_Poison2] > 0; + return pConditions[Condition_Poison_Medium] > 0; case VAR_DiseasedYellow: - return pConditions[Condition_Disease2] > 0; + return pConditions[Condition_Disease_Medium] > 0; case VAR_PoisonedRed: - return pConditions[Condition_Poison3] > 0; + return pConditions[Condition_Poison_Severe] > 0; case VAR_DiseasedRed: - return pConditions[Condition_Disease3] > 0; + return pConditions[Condition_Disease_Severe] > 0; case VAR_Paralyzed: return pConditions[Condition_Paralyzed] > 0; case VAR_Unconsious: @@ -5667,27 +5665,27 @@ PlayAwardSound_Anim(); return; case VAR_PoisonedGreen: - this->SetCondition(Condition_Poison1, 1); + this->SetCondition(Condition_Poison_Weak, 1); PlayAwardSound_Anim(); return; case VAR_DiseasedGreen: - this->SetCondition(Condition_Disease1, 1); + this->SetCondition(Condition_Disease_Weak, 1); PlayAwardSound_Anim(); return; case VAR_PoisonedYellow: - this->SetCondition(Condition_Poison2, 1); + this->SetCondition(Condition_Poison_Medium, 1); PlayAwardSound_Anim(); return; case VAR_DiseasedYellow: - this->SetCondition(Condition_Disease2, 1); + this->SetCondition(Condition_Disease_Medium, 1); PlayAwardSound_Anim(); return; case VAR_PoisonedRed: - this->SetCondition(Condition_Poison3, 1); + this->SetCondition(Condition_Poison_Severe, 1); PlayAwardSound_Anim(); return; case VAR_DiseasedRed: - this->SetCondition(Condition_Disease3, 1); + this->SetCondition(Condition_Disease_Severe, 1); PlayAwardSound_Anim(); return; case VAR_Paralyzed: @@ -6263,27 +6261,27 @@ PlayAwardSound_Anim97(); return; case VAR_PoisonedGreen: - this->SetCondition(Condition_Poison1, 1); + this->SetCondition(Condition_Poison_Weak, 1); PlayAwardSound_Anim97(); return; case VAR_DiseasedGreen: - this->SetCondition(Condition_Disease1, 1); + this->SetCondition(Condition_Disease_Weak, 1); PlayAwardSound_Anim97(); return; case VAR_PoisonedYellow: - this->SetCondition(Condition_Poison2, 1); + this->SetCondition(Condition_Poison_Medium, 1); PlayAwardSound_Anim97(); return; case VAR_DiseasedYellow: - this->SetCondition(Condition_Disease2, 1); + this->SetCondition(Condition_Disease_Medium, 1); PlayAwardSound_Anim97(); return; case VAR_PoisonedRed: - this->SetCondition(Condition_Poison3, 1); + this->SetCondition(Condition_Poison_Severe, 1); PlayAwardSound_Anim97(); return; case VAR_DiseasedRed: - this->SetCondition(Condition_Disease3, 1); + this->SetCondition(Condition_Disease_Severe, 1); PlayAwardSound_Anim97(); return; case VAR_Paralyzed: @@ -6944,27 +6942,27 @@ PlayAwardSound_Anim98(); return; case VAR_PoisonedGreen: - this->pConditions[Condition_Poison1] = 0; + this->pConditions[Condition_Poison_Weak] = 0; PlayAwardSound_Anim98(); return; case VAR_DiseasedGreen: - this->pConditions[Condition_Disease1] = 0; + this->pConditions[Condition_Disease_Weak] = 0; PlayAwardSound_Anim98(); return; case VAR_PoisonedYellow: - this->pConditions[Condition_Poison2] = 0; + this->pConditions[Condition_Poison_Medium] = 0; PlayAwardSound_Anim98(); return; case VAR_DiseasedYellow: - this->pConditions[Condition_Disease2] = 0; + this->pConditions[Condition_Disease_Medium] = 0; PlayAwardSound_Anim98(); return; case VAR_PoisonedRed: - this->pConditions[Condition_Poison3] = 0; + this->pConditions[Condition_Poison_Severe] = 0; PlayAwardSound_Anim98(); return; case VAR_DiseasedRed: - this->pConditions[Condition_Disease3] = 0; + this->pConditions[Condition_Disease_Severe] = 0; PlayAwardSound_Anim98(); return; case VAR_Paralyzed: @@ -7748,34 +7746,34 @@ pConditions[Condition_Insane] = state; } -void Player::SetPoison1( unsigned long long state ) -{ - pConditions[Condition_Poison1] = state; -} - -void Player::SetDisease1( unsigned long long state ) -{ - pConditions[Condition_Disease1] = state; -} - -void Player::SetPoison2( unsigned long long state ) -{ - pConditions[Condition_Poison2] = state; -} - -void Player::SetDisease2( unsigned long long state ) -{ - pConditions[Condition_Disease2] = state; -} - -void Player::SetPoison3( unsigned long long state ) -{ - pConditions[Condition_Poison3] = state; -} - -void Player::SetDisease3( unsigned long long state ) -{ - pConditions[Condition_Disease3] = state; +void Player::SetPoisonWeak( unsigned long long state ) +{ + pConditions[Condition_Poison_Weak] = state; +} + +void Player::SetDiseaseWeak( unsigned long long state ) +{ + pConditions[Condition_Disease_Weak] = state; +} + +void Player::SetPoisonMedium( unsigned long long state ) +{ + pConditions[Condition_Poison_Medium] = state; +} + +void Player::SetDiseaseMedium( unsigned long long state ) +{ + pConditions[Condition_Disease_Medium] = state; +} + +void Player::SetPoisonSevere( unsigned long long state ) +{ + pConditions[Condition_Poison_Severe] = state; +} + +void Player::SetDiseaseSevere( unsigned long long state ) +{ + pConditions[Condition_Disease_Severe] = state; } void Player::SetParalyzed( unsigned long long state )
--- a/Player.h Mon Jan 27 17:33:34 2014 +0600 +++ b/Player.h Tue Jan 28 17:25:58 2014 +0600 @@ -552,7 +552,7 @@ void IncreaseAttribute(int eAttribute); void Player::Zero(); unsigned int GetStatColor(int uStat); - bool DiscardConditionIfLastsLongerThan(unsigned int uCondition, unsigned __int64 uTime); + bool DiscardConditionIfLastsLongerThan(unsigned int uCondition, signed __int64 uTime); int SelectPhrasesTransaction(ItemGen *pItem, int building_type, int BuildID_2Events, int a5); int GetBodybuilding(); int GetMeditation(); @@ -632,12 +632,12 @@ void SetAfraid(unsigned long long state); void SetDrunk(unsigned long long state); void SetInsane(unsigned long long state); - void SetPoison1(unsigned long long state); - void SetDisease1(unsigned long long state); - void SetPoison2(unsigned long long state); - void SetDisease2(unsigned long long state); - void SetPoison3(unsigned long long state); - void SetDisease3(unsigned long long state); + void SetPoisonWeak(unsigned long long state); + void SetDiseaseWeak(unsigned long long state); + void SetPoisonMedium(unsigned long long state); + void SetDiseaseMedium(unsigned long long state); + void SetPoisonSevere(unsigned long long state); + void SetDiseaseSevere(unsigned long long state); void SetParalyzed(unsigned long long state); void SetUnconcious(unsigned long long state); void SetDead(unsigned long long state);
--- a/UI/UiGame.cpp Mon Jan 27 17:33:34 2014 +0600 +++ b/UI/UiGame.cpp Tue Jan 28 17:25:58 2014 +0600 @@ -2259,19 +2259,19 @@ case Condition_Fear: case Condition_Drunk: case Condition_Insane: - case Condition_Poison1: - case Condition_Disease1: + case Condition_Poison_Weak: + case Condition_Disease_Weak: return ui_character_condition_light_color; case Condition_Sleep: - case Condition_Poison2: - case Condition_Disease2: + case Condition_Poison_Medium: + case Condition_Disease_Medium: case Condition_Paralyzed: case Condition_Unconcious: return ui_character_condition_moderate_color; - case Condition_Poison3: - case Condition_Disease3: + case Condition_Poison_Severe: + case Condition_Disease_Severe: case Condition_Dead: case Condition_Pertified: case Condition_Eradicated: