comparison mm7_3.cpp @ 838:d061180f2b42

Merge
author Gloval
date Thu, 28 Mar 2013 00:37:58 +0400
parents bebc19f3d2af b66abf8b7d50
children 6dd2b94efce7 710cf848ad24
comparison
equal deleted inserted replaced
837:bebc19f3d2af 838:d061180f2b42
2 2
3 #include "MapInfo.h" 3 #include "MapInfo.h"
4 #include "Game.h" 4 #include "Game.h"
5 #include "GUIWindow.h" 5 #include "GUIWindow.h"
6 #include "GUIFont.h" 6 #include "GUIFont.h"
7 #include "GUIButton.h"
8 #include "GUIProgressBar.h" 7 #include "GUIProgressBar.h"
9 #include "Party.h" 8 #include "Party.h"
10 #include "AudioPlayer.h" 9 #include "AudioPlayer.h"
11 #include "Outdoor.h" 10 #include "Outdoor.h"
12 #include "IndoorCamera.h" 11 #include "IndoorCamera.h"
41 #include "stru176.h" 40 #include "stru176.h"
42 #include "stru159.h" 41 #include "stru159.h"
43 #include "stru298.h" 42 #include "stru298.h"
44 #include "texts.h" 43 #include "texts.h"
45 #include "Log.h" 44 #include "Log.h"
45
46 #include "MM7.h"
46 #include "mm7_data.h" 47 #include "mm7_data.h"
47 48
48 //----- (0046E44E) -------------------------------------------------------- 49 //----- (0046E44E) --------------------------------------------------------
49 int __thiscall _46E44E_collide_against_faces_and_portals(unsigned int b1) 50 int __thiscall _46E44E_collide_against_faces_and_portals(unsigned int b1)
50 { 51 {
1388 { 1389 {
1389 //v3 = item->uObjectDescID; 1390 //v3 = item->uObjectDescID;
1390 v4 = &pObjectList->pObjects[item->uObjectDescID]; 1391 v4 = &pObjectList->pObjects[item->uObjectDescID];
1391 if (item->AttachedToActor()) 1392 if (item->AttachedToActor())
1392 { 1393 {
1393 v5 = item->field_5C >> 3; 1394 v5 = item->spell_target_pid >> 3;
1394 *(int *)(v2 - 26) = pActors[v5].vPosition.x; 1395 *(int *)(v2 - 26) = pActors[v5].vPosition.x;
1395 *(int *)(v2 - 22) = pActors[v5].vPosition.y; 1396 *(int *)(v2 - 22) = pActors[v5].vPosition.y;
1396 *(int *)(v2 - 18) = pActors[v5].vPosition.z + pActors[v5].uActorHeight; 1397 *(int *)(v2 - 18) = pActors[v5].vPosition.z + pActors[v5].uActorHeight;
1397 if ( !item->uObjectDescID || (v6 = LOWORD(pEventTimer->uTimeElapsed) + *(short *)v2, *(short *)v2 = v6, !(v4->uFlags & 4)) ) 1398 if ( !item->uObjectDescID || (v6 = LOWORD(pEventTimer->uTimeElapsed) + *(short *)v2, *(short *)v2 = v6, !(v4->uFlags & 4)) )
1398 goto LABEL_36; 1399 goto LABEL_36;
1477 //while ( v20 < (signed int)uNumSpriteObjects ); 1478 //while ( v20 < (signed int)uNumSpriteObjects );
1478 } 1479 }
1479 } 1480 }
1480 1481
1481 //----- (0047272C) -------------------------------------------------------- 1482 //----- (0047272C) --------------------------------------------------------
1482 int _47272C_collide_agains_some_secotors_floors(int x, int y, int z, unsigned int *pSectorID, unsigned int *pFaceID) 1483 int collide_against_floor_approximate(int x, int y, int z, unsigned int *pSectorID, unsigned int *pFaceID)
1483 { 1484 {
1484 signed int v5; // ebx@1 1485 signed int v5; // ebx@1
1485 int result; // eax@1 1486 int result; // eax@1
1486 int v7; // [sp+10h] [bp-8h]@1 1487 int v7; // [sp+10h] [bp-8h]@1
1487 signed int v8; // [sp+14h] [bp-4h]@1 1488 signed int v8; // [sp+14h] [bp-4h]@1
1517 //----- (00472866) -------------------------------------------------------- 1518 //----- (00472866) --------------------------------------------------------
1518 void BLV_ProcessPartyActions() 1519 void BLV_ProcessPartyActions()
1519 { 1520 {
1520 int v1; // ebx@1 1521 int v1; // ebx@1
1521 int v2; // edi@1 1522 int v2; // edi@1
1522 int v6; // eax@18 1523 //int v6; // eax@18
1523 signed __int64 v8; // qax@27 1524 //signed __int64 v8; // qax@27
1524 int v9; // eax@27 1525 //int v9; // eax@27
1525 double v10; // st7@27 1526 double v10; // st7@27
1526 unsigned int v12; // eax@49 1527 unsigned int v12; // eax@49
1527 double v13; // st7@50 1528 double v13; // st7@50
1528 int v14; // eax@51 1529 //int v14; // eax@51
1529 signed __int64 v15; // qax@53 1530 //signed __int64 v15; // qax@53
1530 double v16; // st7@54 1531 //double v16; // st7@54
1531 int v17; // eax@62 1532 int v17; // eax@62
1532 double v18; // st7@62 1533 double v18; // st7@62
1533 int v19; // ST40_4@62 1534 int v19; // ST40_4@62
1534 int v20; // eax@65 1535 int v20; // eax@65
1535 double v21; // st7@65 1536 double v21; // st7@65
1570 int v62; // [sp-Ch] [bp-6Ch]@161 1571 int v62; // [sp-Ch] [bp-6Ch]@161
1571 int v63; // [sp-8h] [bp-68h]@75 1572 int v63; // [sp-8h] [bp-68h]@75
1572 unsigned int v64; // [sp-8h] [bp-68h]@161 1573 unsigned int v64; // [sp-8h] [bp-68h]@161
1573 int v65; // [sp-4h] [bp-64h]@75 1574 int v65; // [sp-4h] [bp-64h]@75
1574 int v66; // [sp-4h] [bp-64h]@161 1575 int v66; // [sp-4h] [bp-64h]@161
1575 int v68; // [sp+10h] [bp-50h]@45 1576 //int v68; // [sp+10h] [bp-50h]@45
1576 int v69; // [sp+10h] [bp-50h]@140 1577 int v69; // [sp+10h] [bp-50h]@140
1577 unsigned int uFaceEvent; // [sp+14h] [bp-4Ch]@1 1578 unsigned int uFaceEvent; // [sp+14h] [bp-4Ch]@1
1578 signed int v71; // [sp+18h] [bp-48h]@1 1579 //signed int v71; // [sp+18h] [bp-48h]@1
1579 signed int v72; // [sp+1Ch] [bp-44h]@1 1580 signed int v72; // [sp+1Ch] [bp-44h]@1
1580 signed int v73; // [sp+20h] [bp-40h]@100 1581 signed int v73; // [sp+20h] [bp-40h]@100
1581 int v74; // [sp+20h] [bp-40h]@140 1582 int v74; // [sp+20h] [bp-40h]@140
1582 bool bFeatherFall; // [sp+24h] [bp-3Ch]@15 1583 bool bFeatherFall; // [sp+24h] [bp-3Ch]@15
1583 unsigned int uSectorID; // [sp+28h] [bp-38h]@1 1584 unsigned int uSectorID; // [sp+28h] [bp-38h]@1
1602 new_party_y = pParty->vPosition.y; 1603 new_party_y = pParty->vPosition.y;
1603 party_z = pParty->vPosition.z; 1604 party_z = pParty->vPosition.z;
1604 uSectorID = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z); 1605 uSectorID = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z);
1605 v72 = 0; 1606 v72 = 0;
1606 v78 = 0; 1607 v78 = 0;
1607 v71 = 0;
1608 bJumping = 0; 1608 bJumping = 0;
1609 1609
1610 uFaceID = -1; 1610 uFaceID = -1;
1611 v80 = collide_against_floor(new_party_x, new_party_y, party_z + 40, &uSectorID, &uFaceID); 1611 auto floor_level = collide_against_floor(new_party_x, new_party_y, party_z + 40, &uSectorID, &uFaceID);
1612 assert(uFaceID != -1);
1613
1614 for (uint i = 0; i < pIndoor->uNumFaces; ++i)
1615 pIndoor->pFaces[i].uAttributes &= ~FACE_OUTLINED;
1616 pIndoor->pFaces[uFaceID].uAttributes |= FACE_OUTLINED;
1617 1612
1618 if ( pParty->bFlying ) 1613 if ( pParty->bFlying )
1619 { 1614 {
1620 pParty->bFlying = false; 1615 pParty->bFlying = false;
1621 if (pParty->FlyActive()) 1616 if (pParty->FlyActive())
1622 pOtherOverlayList->pOverlays[pParty->pPartyBuffs[PARTY_BUFF_FLY].uOverlayID - 1].field_E |= 1; 1617 pOtherOverlayList->pOverlays[pParty->pPartyBuffs[PARTY_BUFF_FLY].uOverlayID - 1].field_E |= 1;
1623 //stru_5E4C90._decor_events[20 * pParty->pPartyBuffs[PARTY_BUFF_FLY].uOverlayID + 119] |= 1u;// 005E4D58 pOtherOverlayList [negindexing] 1618 }
1624 } 1619
1625 if ( v80 == -30000 ) 1620 if ( floor_level == -30000 || uFaceID == -1)
1626 { 1621 {
1627 v80 = _47272C_collide_agains_some_secotors_floors(new_party_x, new_party_y, party_z + 40, &uSectorID, &uFaceID); 1622 floor_level = collide_against_floor_approximate(new_party_x, new_party_y, party_z + 40, &uSectorID, &uFaceID);
1628 if ( v80 == -30000 ) 1623 if ( floor_level == -30000 || uFaceID == -1)
1629 { 1624 {
1625 __debugbreak(); // level built with errors
1630 pParty->vPosition.x = blv_prev_party_x; 1626 pParty->vPosition.x = blv_prev_party_x;
1631 pParty->vPosition.y = blv_prev_party_z; 1627 pParty->vPosition.y = blv_prev_party_z;
1632 pParty->vPosition.z = blv_prev_party_y; 1628 pParty->vPosition.z = blv_prev_party_y;
1633 pParty->uFallStartY = blv_prev_party_y; 1629 pParty->uFallStartY = blv_prev_party_y;
1634 return; 1630 return;
1635 } 1631 }
1636 } 1632 }
1633
1634 for (uint i = 0; i < pIndoor->uNumFaces; ++i)
1635 pIndoor->pFaces[i].uAttributes &= ~FACE_OUTLINED;
1636 pIndoor->pFaces[uFaceID].uAttributes |= FACE_OUTLINED;
1637
1637 blv_prev_party_x = pParty->vPosition.x; 1638 blv_prev_party_x = pParty->vPosition.x;
1638 blv_prev_party_z = pParty->vPosition.y; 1639 blv_prev_party_z = pParty->vPosition.y;
1639 blv_prev_party_y = pParty->vPosition.z; 1640 blv_prev_party_y = pParty->vPosition.z;
1640 if (!pParty->bTurnBasedModeOn) 1641 if (!pParty->bTurnBasedModeOn)
1641 { 1642 {
1648 if ( dword_4F8580[0] > 60 ) 1649 if ( dword_4F8580[0] > 60 )
1649 dword_4F8580[0] = 1; 1650 dword_4F8580[0] = 1;
1650 } 1651 }
1651 dword_720CDC = v67; 1652 dword_720CDC = v67;
1652 } 1653 }
1654
1655 uint fall_start;
1653 if (!pParty->FeatherFallActive()) 1656 if (!pParty->FeatherFallActive())
1654 { 1657 {
1655 bFeatherFall = false; 1658 bFeatherFall = false;
1656 if (!pParty->pPlayers[0].WearsItem(536, 16) && 1659 if (!pParty->pPlayers[0].WearsItem(ITEM_ARTIFACT_LADYS_ESCORT, 16) && // grants feather fall
1657 !pParty->pPlayers[1].WearsItem(536, 16) && 1660 !pParty->pPlayers[1].WearsItem(ITEM_ARTIFACT_LADYS_ESCORT, 16) &&
1658 !pParty->pPlayers[2].WearsItem(536, 16) && 1661 !pParty->pPlayers[2].WearsItem(ITEM_ARTIFACT_LADYS_ESCORT, 16) &&
1659 !pParty->pPlayers[3].WearsItem(536, 16)) 1662 !pParty->pPlayers[3].WearsItem(ITEM_ARTIFACT_LADYS_ESCORT, 16))
1660 { 1663 {
1661 v6 = pParty->uFallStartY; 1664 fall_start = pParty->uFallStartY;
1662 } 1665 }
1663 } 1666 }
1664 else 1667 else
1665 { 1668 {
1666 v6 = v80; 1669 fall_start = floor_level;
1667 bFeatherFall = true; 1670 bFeatherFall = true;
1668 pParty->uFallStartY = v80; 1671 pParty->uFallStartY = floor_level;
1669 } 1672 }
1670 LABEL_20: 1673
1671 if ( v6 - party_z > 512 && !bFeatherFall && party_z <= v80 + 1 ) 1674
1672 { 1675 if (fall_start - party_z > 512 && !bFeatherFall && party_z <= floor_level + 1)
1676 {
1677 assert(~pParty->uFlags & PARTY_FLAGS_1_LANDING); // why land in indoor?
1673 if (pParty->uFlags & PARTY_FLAGS_1_LANDING) 1678 if (pParty->uFlags & PARTY_FLAGS_1_LANDING)
1674 {
1675 pParty->uFlags &= ~PARTY_FLAGS_1_LANDING; 1679 pParty->uFlags &= ~PARTY_FLAGS_1_LANDING;
1676 }
1677 else for (uint i = 0; i < 4; ++i) 1680 else for (uint i = 0; i < 4; ++i)
1678 { // receive falling damage 1681 { // receive falling damage
1679 auto pPlayer = pParty->pPlayers + i; 1682 auto player = pParty->pPlayers + i;
1680 1683 if (!player->HasEnchantedItemEquipped(72) && !player->WearsItem(ITEM_ARTIFACT_HERMES_SANDALS, 8))
1681 if (!pPlayer->HasEnchantedItemEquipped(72) && 1684 {
1682 !pPlayer->WearsItem(529, 8)) 1685 player->ReceiveDamage((pParty->uFallStartY - party_z) * (0.1f * player->GetMaxHealth()) / 256, 4);
1683 { 1686 v10 = (double)(20 - player->_48EA1B_get_static_effect(player->GetActualEndurance())) * flt_6BE3A4_debug_recmod1 * 2.133333333333333;
1684 v8 = (signed __int64)((double)pPlayer->GetMaxHealth() * 0.1); 1687 player->SetRecoveryTime((signed __int64)v10);
1685 pPlayer->ReceiveDamage((pParty->uFallStartY - party_z) * (signed int)v8 / 256, 4); 1688 }
1686 v9 = pPlayer->GetActualEndurance(); 1689 }
1687 v10 = (double)(20 - pPlayer->_48EA1B_get_static_effect(v9)) * flt_6BE3A4_debug_recmod1 * 2.133333333333333; 1690 }
1688 pPlayer->SetRecoveryTime((signed __int64)v10); 1691
1689 } 1692 if ( party_z > floor_level + 1 )
1690 }
1691 }
1692 if ( party_z > v80 + 1 )
1693 bJumping = 1; 1693 bJumping = 1;
1694 bFeatherFall = party_z - v80 <= 32; 1694
1695 if ( party_z - v80 <= 32 ) 1695 bool jumping_up = false;
1696
1697 if ( party_z - floor_level <= 32 )
1698 {
1696 pParty->uFallStartY = party_z; 1699 pParty->uFallStartY = party_z;
1697 if ( bWalkSound && pParty->field_6F8 > 0 ) 1700 jumping_up = true;
1698 pParty->field_6F8 -= pEventTimer->uTimeElapsed; 1701 }
1699 if ( party_z > v80 + 1 ) 1702
1700 { 1703 if (bWalkSound && pParty->walk_sound_timer)
1701 if ( bJumping ) 1704 {
1702 goto LABEL_45; 1705 if (pParty->walk_sound_timer > pEventTimer->uTimeElapsed)
1703 goto LABEL_44; 1706 pParty->walk_sound_timer -= pEventTimer->uTimeElapsed;
1704 } 1707 else pParty->walk_sound_timer = 0;
1705 party_z = v80 + 1; 1708 }
1706 pParty->uFallStartY = v80 + 1; 1709
1707 if ( bJumping ) 1710
1708 goto LABEL_45; 1711 if (party_z <= floor_level + 1)
1709 if (pParty->field_6F4_packedid != uFaceID) 1712 {
1710 { 1713 party_z = floor_level + 1;
1711 auto pFace = &pIndoor->pFaces[uFaceID]; 1714 pParty->uFallStartY = floor_level + 1;
1712 if (pFace->uAttributes & 0x04000000 ) 1715
1713 { 1716 if (!bJumping && pParty->floor_face_pid != uFaceID)
1714 uFaceEvent = pIndoor->pFaceExtras[pFace->uFaceExtraID].uEventID; 1717 {
1715 if ( bJumping ) 1718 auto pFace = &pIndoor->pFaces[uFaceID];
1716 goto LABEL_45; 1719 if (pFace->uAttributes & FACE_PRESSURE_PLATE)
1717 goto LABEL_44; 1720 uFaceEvent = pIndoor->pFaceExtras[pFace->uFaceExtraID].uEventID;
1718 } 1721 }
1719 } 1722 }
1720 LABEL_44: 1723 if (!bJumping)
1721 pParty->field_6F4_packedid = uFaceID; 1724 pParty->floor_face_pid = uFaceID;
1722 LABEL_45: 1725
1723 v68 = uFaceID; 1726 bool on_water = false;
1724 if ( pIndoor->pFaces[uFaceID].uAttributes & 0x10 ) 1727 if ( pIndoor->pFaces[uFaceID].Fluid())
1725 v71 = 1; 1728 on_water = true;
1729
1726 v81 = pParty->uWalkSpeed; 1730 v81 = pParty->uWalkSpeed;
1727 angle = pParty->sRotationY; 1731 angle = pParty->sRotationY;
1728 _view_angle = pParty->sRotationX; 1732 _view_angle = pParty->sRotationX;
1729 v82 = (unsigned __int64)(pEventTimer->dt_in_some_format 1733 v82 = (unsigned __int64)(pEventTimer->dt_in_some_format * (signed __int64)((signed int)(pParty->y_rotation_speed * stru_5C6E00->uIntegerPi)
1730 * (signed __int64)((signed int)(pParty->y_rotation_speed * stru_5C6E00->uIntegerPi)
1731 / 180)) >> 16; 1734 / 180)) >> 16;
1732 //LABEL_87: 1735 //LABEL_87:
1733 while ( pPartyActionQueue->uNumActions ) 1736 while ( pPartyActionQueue->uNumActions )
1734 { 1737 {
1735 switch ( pPartyActionQueue->Next() ) 1738 switch ( pPartyActionQueue->Next() )
1736 { 1739 {
1737 case PARTY_TurnLeft: 1740 case PARTY_TurnLeft:
1738 if ( uTurnSpeed ) 1741 if (uTurnSpeed)
1739 { 1742 angle = stru_5C6E00->uDoublePiMask & (angle + uTurnSpeed);
1740 v14 = angle + uTurnSpeed; 1743 else
1741 angle = stru_5C6E00->uDoublePiMask & v14; 1744 angle = stru_5C6E00->uDoublePiMask & (angle + (int)(v82 * fTurnSpeedMultiplier));
1742 break;
1743 }
1744 v14 = angle + (unsigned __int64)(signed __int64)(double)v82 * fTurnSpeedMultiplier;
1745 angle = stru_5C6E00->uDoublePiMask & v14;
1746 break; 1745 break;
1747 case PARTY_TurnRight: 1746 case PARTY_TurnRight:
1748 if ( uTurnSpeed ) 1747 if (uTurnSpeed)
1749 {
1750 angle = stru_5C6E00->uDoublePiMask & (angle - uTurnSpeed); 1748 angle = stru_5C6E00->uDoublePiMask & (angle - uTurnSpeed);
1751 break; 1749 else
1752 } 1750 angle = stru_5C6E00->uDoublePiMask & (angle - (int)(v82 * fTurnSpeedMultiplier));
1753 v16 = (double)v82 * fTurnSpeedMultiplier;
1754 angle = stru_5C6E00->uDoublePiMask & (angle - (signed __int64)v16);
1755 break; 1751 break;
1752
1756 case PARTY_FastTurnLeft: 1753 case PARTY_FastTurnLeft:
1757 if ( uTurnSpeed ) 1754 if (uTurnSpeed)
1758 { 1755 angle = stru_5C6E00->uDoublePiMask & (angle + uTurnSpeed);
1759 v14 = angle + uTurnSpeed;
1760 }
1761 else 1756 else
1762 { 1757 angle = stru_5C6E00->uDoublePiMask & (angle + (int)(2.0f * fTurnSpeedMultiplier * (double)v82));
1763 v14 = angle + (unsigned __int64)(signed __int64)(fTurnSpeedMultiplier + fTurnSpeedMultiplier) * (double)v82;
1764 }
1765 angle = stru_5C6E00->uDoublePiMask & v14;
1766 break; 1758 break;
1759
1767 case PARTY_FastTurnRight: 1760 case PARTY_FastTurnRight:
1768 LODWORD(v15) = uTurnSpeed; 1761 if (uTurnSpeed)
1769 if ( !uTurnSpeed ) 1762 angle = stru_5C6E00->uDoublePiMask & (angle - uTurnSpeed);
1770 { 1763 else
1771 v15 = (signed __int64)(fTurnSpeedMultiplier + fTurnSpeedMultiplier) * (double)v82; 1764 angle = stru_5C6E00->uDoublePiMask & (angle - (int)(2.0f * fTurnSpeedMultiplier * (double)v82));
1772 }
1773 angle = stru_5C6E00->uDoublePiMask & (angle - v15);
1774 break; 1765 break;
1766
1775 case PARTY_StrafeLeft: 1767 case PARTY_StrafeLeft:
1776 v2 -= (unsigned __int64)(stru_5C6E00->Sin(angle) * (signed __int64)((signed int)(signed __int64)((double)v81 * fWalkSpeedMultiplier) >> 1)) >> 16; 1768 v2 -= (unsigned __int64)(stru_5C6E00->Sin(angle) * (signed __int64)((signed int)(signed __int64)((double)v81 * fWalkSpeedMultiplier) >> 1)) >> 16;
1777 v1 += (unsigned __int64)(stru_5C6E00->Cos(angle) * (signed __int64)((signed int)(signed __int64)((double)v81 * fWalkSpeedMultiplier) >> 1)) >> 16; 1769 v1 += (unsigned __int64)(stru_5C6E00->Cos(angle) * (signed __int64)((signed int)(signed __int64)((double)v81 * fWalkSpeedMultiplier) >> 1)) >> 16;
1778 v78 = 1; 1770 v78 = 1;
1779 break; 1771 break;
1781 v2 += (unsigned __int64)(stru_5C6E00->Sin(angle) * (signed __int64)((signed int)(signed __int64)((double)v81 * fWalkSpeedMultiplier) >> 1)) >> 16; 1773 v2 += (unsigned __int64)(stru_5C6E00->Sin(angle) * (signed __int64)((signed int)(signed __int64)((double)v81 * fWalkSpeedMultiplier) >> 1)) >> 16;
1782 v1 -= (unsigned __int64)(stru_5C6E00->Cos(angle) * (signed __int64)((signed int)(signed __int64)((double)v81 * fWalkSpeedMultiplier) >> 1)) >> 16; 1774 v1 -= (unsigned __int64)(stru_5C6E00->Cos(angle) * (signed __int64)((signed int)(signed __int64)((double)v81 * fWalkSpeedMultiplier) >> 1)) >> 16;
1783 v78 = 1; 1775 v78 = 1;
1784 break; 1776 break;
1785 case PARTY_WalkForward: 1777 case PARTY_WalkForward:
1786 v2 += (unsigned __int64)(stru_5C6E00->Cos(angle) * (signed __int64)(signed int)(signed __int64)((double)v81 * fWalkSpeedMultiplier)) >> 16; 1778 v2 += (unsigned __int64)(stru_5C6E00->Cos(angle) * (signed __int64)(signed int)(signed __int64)(5 * (double)v81 * fWalkSpeedMultiplier)) >> 16;
1787 v1 += (unsigned __int64)(stru_5C6E00->Sin(angle) * (signed __int64)(signed int)(signed __int64)((double)v81 * fWalkSpeedMultiplier)) >> 16; 1779 v1 += (unsigned __int64)(stru_5C6E00->Sin(angle) * (signed __int64)(signed int)(signed __int64)(5 * (double)v81 * fWalkSpeedMultiplier)) >> 16;
1788 v78 = 1; 1780 v78 = 1;
1789 break; 1781 break;
1790 case PARTY_WalkBackward: 1782 case PARTY_WalkBackward:
1791 v2 -= (unsigned __int64)(stru_5C6E00->Cos(angle) * (signed __int64)(signed int)(signed __int64)((double)v81 * fBackwardWalkSpeedMultiplier)) >> 16; 1783 v2 -= (unsigned __int64)(stru_5C6E00->Cos(angle) * (signed __int64)(signed int)(signed __int64)((double)v81 * fBackwardWalkSpeedMultiplier)) >> 16;
1792 v1 -= (unsigned __int64)(stru_5C6E00->Sin(angle) * (signed __int64)(signed int)(signed __int64)((double)v81 * fBackwardWalkSpeedMultiplier)) >> 16; 1784 v1 -= (unsigned __int64)(stru_5C6E00->Sin(angle) * (signed __int64)(signed int)(signed __int64)((double)v81 * fBackwardWalkSpeedMultiplier)) >> 16;
1824 break; 1816 break;
1825 case PARTY_CenterView: 1817 case PARTY_CenterView:
1826 _view_angle = 0; 1818 _view_angle = 0;
1827 break; 1819 break;
1828 case PARTY_Jump: 1820 case PARTY_Jump:
1829 if ( (!bJumping || party_z <= v80 + 6 && pParty->uFallSpeed <= 0) && pParty->field_24 ) 1821 if ( (!bJumping || party_z <= floor_level + 6 && pParty->uFallSpeed <= 0) && pParty->field_24 )
1830 { 1822 {
1831 bJumping = 1; 1823 bJumping = 1;
1832 pParty->uFallSpeed = (signed __int64)((double)(pParty->field_24 << 6) * 1.5 + (double)pParty->uFallSpeed); 1824 pParty->uFallSpeed = (signed __int64)((double)(pParty->field_24 << 6) * 1.5 + (double)pParty->uFallSpeed);
1833 } 1825 }
1834 break; 1826 break;
1843 { 1835 {
1844 pParty->uFallSpeed += -2 * pEventTimer->uTimeElapsed * GetGravityStrength(); 1836 pParty->uFallSpeed += -2 * pEventTimer->uTimeElapsed * GetGravityStrength();
1845 } 1837 }
1846 else 1838 else
1847 { 1839 {
1848 if ( pIndoor->pFaces[v68].pFacePlane_old.vNormal.z < 32768 ) 1840 if ( pIndoor->pFaces[uFaceID].pFacePlane_old.vNormal.z < 32768 )
1849 { 1841 {
1850 pParty->uFallSpeed -= pEventTimer->uTimeElapsed * GetGravityStrength(); 1842 pParty->uFallSpeed -= pEventTimer->uTimeElapsed * GetGravityStrength();
1851 goto LABEL_92; 1843 goto LABEL_92;
1852 } 1844 }
1853 if (pParty->uFlags & PARTY_FLAGS_1_LANDING) 1845 if (pParty->uFlags & PARTY_FLAGS_1_LANDING)
1859 if ( pParty->uFallSpeed < -500 && !pParty->bFlying ) 1851 if ( pParty->uFallSpeed < -500 && !pParty->bFlying )
1860 { 1852 {
1861 v41 = &pPlayers[1]; 1853 v41 = &pPlayers[1];
1862 do 1854 do
1863 { 1855 {
1864 if ( !(*v41)->HasEnchantedItemEquipped(72) && !(*v41)->WearsItem(529, 8) ) 1856 if ( !(*v41)->HasEnchantedItemEquipped(72) && !(*v41)->WearsItem(ITEM_ARTIFACT_HERMES_SANDALS, 8) )
1865 (*v41)->PlayEmotion(CHARACTER_EXPRESSION_46, 0); 1857 (*v41)->PlayEmotion(CHARACTER_EXPRESSION_SCARED, 0);
1866 ++v41; 1858 ++v41;
1867 } 1859 }
1868 while ( (signed int)v41 <= (signed int)&pPlayers[4] ); 1860 while ( (signed int)v41 <= (signed int)&pPlayers[4] );
1869 } 1861 }
1870 goto LABEL_93; 1862 goto LABEL_93;
1976 if ( v2 * v2 + v1 * v1 < 400 ) 1968 if ( v2 * v2 + v1 * v1 < 400 )
1977 { 1969 {
1978 v1 = 0; 1970 v1 = 0;
1979 v2 = 0; 1971 v2 = 0;
1980 } 1972 }
1981 if ( pParty->field_6F4_packedid != v43 >> 3 && BYTE3(v44->uAttributes) & 4 ) 1973 if ( pParty->floor_face_pid != PID_ID(v43) && BYTE3(v44->uAttributes) & 4 )
1982 uFaceEvent = pIndoor->pFaceExtras[v44->uFaceExtraID].uEventID; 1974 uFaceEvent = pIndoor->pFaceExtras[v44->uFaceExtraID].uEventID;
1983 goto LABEL_152; 1975 goto LABEL_152;
1984 } 1976 }
1985 v46 = pParty->uFallSpeed * v44->pFacePlane_old.vNormal.z; 1977 v46 = pParty->uFallSpeed * v44->pFacePlane_old.vNormal.z;
1986 v47 = v45 == 4; 1978 v47 = v45 == 4;
2008 new_party_x += v52 * v69 >> 16; 2000 new_party_x += v52 * v69 >> 16;
2009 new_party_y += v52 * v80 >> 16; 2001 new_party_y += v52 * v80 >> 16;
2010 v87 += v52 * v74 >> 16; 2002 v87 += v52 * v74 >> 16;
2011 } 2003 }
2012 v43 = stru_721530.uFaceID; 2004 v43 = stru_721530.uFaceID;
2013 if ( pParty->field_6F4_packedid != v43 >> 3 && BYTE3(v44->uAttributes) & 4 ) 2005 if ( pParty->floor_face_pid != PID_ID(v43) && BYTE3(v44->uAttributes) & 4 )
2014 uFaceEvent = pIndoor->pFaceExtras[v44->uFaceExtraID].uEventID; 2006 uFaceEvent = pIndoor->pFaceExtras[v44->uFaceExtraID].uEventID;
2015 goto LABEL_152; 2007 goto LABEL_152;
2016 } 2008 }
2017 v80 = abs(v1 * v44->pFacePlane_old.vNormal.y + v46 + v2 * v48) >> 16; 2009 v80 = abs(v1 * v44->pFacePlane_old.vNormal.y + v46 + v2 * v48) >> 16;
2018 if ( stru_721530.field_64 >> 3 > v80 ) 2010 if ( stru_721530.field_64 >> 3 > v80 )
2026 v1 += v81; 2018 v1 += v81;
2027 pParty->uFallSpeed += v82; 2019 pParty->uFallSpeed += v82;
2028 if ( v2 * v2 + v1 * v1 >= 400 ) 2020 if ( v2 * v2 + v1 * v1 >= 400 )
2029 { 2021 {
2030 v43 = stru_721530.uFaceID; 2022 v43 = stru_721530.uFaceID;
2031 if ( pParty->field_6F4_packedid != v43 >> 3 && BYTE3(v44->uAttributes) & 4 ) 2023 if ( pParty->floor_face_pid != PID_ID(v43) && BYTE3(v44->uAttributes) & 4 )
2032 uFaceEvent = pIndoor->pFaceExtras[v44->uFaceExtraID].uEventID; 2024 uFaceEvent = pIndoor->pFaceExtras[v44->uFaceExtraID].uEventID;
2033 goto LABEL_152; 2025 goto LABEL_152;
2034 } 2026 }
2035 v2 = 0; 2027 v2 = 0;
2036 v1 = 0; 2028 v1 = 0;
2046 { 2038 {
2047 new_party_z = v87; 2039 new_party_z = v87;
2048 break; 2040 break;
2049 } 2041 }
2050 } 2042 }
2051 if ( bWalkSound && pParty->field_6F8 <= 0 ) 2043 if ( bWalkSound && !pParty->walk_sound_timer)
2052 { 2044 {
2053 if ( integer_sqrt((pParty->vPosition.x - new_party_x) * (pParty->vPosition.x - new_party_x) + (pParty->vPosition.y - new_party_y) 2045 if ( integer_sqrt((pParty->vPosition.x - new_party_x) * (pParty->vPosition.x - new_party_x) + (pParty->vPosition.y - new_party_y)
2054 * (pParty->vPosition.y - new_party_y) + (pParty->vPosition.z - new_party_z) 2046 * (pParty->vPosition.y - new_party_y) + (pParty->vPosition.z - new_party_z)
2055 * (pParty->vPosition.z - new_party_z)) <= 16 ) 2047 * (pParty->vPosition.z - new_party_z)) <= 16 )
2056 goto LABEL_188; 2048 goto LABEL_188;
2057 if ( v72 && (!bJumping || bFeatherFall) ) 2049 if ( v72 && (!bJumping || jumping_up) )
2058 { 2050 {
2059 v66 = 0; 2051 v66 = 0;
2060 v64 = 0; 2052 v64 = 0;
2061 v62 = 0; 2053 v62 = 0;
2062 v61 = 0; 2054 v61 = 0;
2063 v60 = -1; 2055 v60 = -1;
2064 v59 = 1; 2056 v59 = 1;
2065 v58 = 804; 2057 v58 = 804;
2066 if ( !v71 ) 2058 if ( !on_water )
2067 { 2059 {
2068 v56 = pAudioPlayer; 2060 v56 = pAudioPlayer;
2069 if ( BYTE2(pIndoor->pFaces[uFaceID].uAttributes) & 0x20 ) 2061 if ( BYTE2(pIndoor->pFaces[uFaceID].uAttributes) & 0x20 )
2070 v57 = (SoundID)50; 2062 v57 = (SoundID)50;
2071 else 2063 else
2074 } 2066 }
2075 v57 = (SoundID)63; 2067 v57 = (SoundID)63;
2076 v56 = pAudioPlayer; 2068 v56 = pAudioPlayer;
2077 goto LABEL_175; 2069 goto LABEL_175;
2078 } 2070 }
2079 if ( v78 && (!bJumping || bFeatherFall) ) 2071 if ( v78 && (!bJumping || jumping_up) )
2080 { 2072 {
2081 v66 = 0; 2073 v66 = 0;
2082 v64 = 0; 2074 v64 = 0;
2083 v62 = 0; 2075 v62 = 0;
2084 v61 = 0; 2076 v61 = 0;
2085 v60 = -1; 2077 v60 = -1;
2086 v59 = 1; 2078 v59 = 1;
2087 v58 = 804; 2079 v58 = 804;
2088 if ( v71 ) 2080 if ( on_water )
2089 { 2081 {
2090 v57 = (SoundID)102; 2082 v57 = (SoundID)102;
2091 v56 = pAudioPlayer; 2083 v56 = pAudioPlayer;
2092 goto LABEL_175; 2084 goto LABEL_175;
2093 } 2085 }
2101 } 2093 }
2102 else 2094 else
2103 { 2095 {
2104 LABEL_188: 2096 LABEL_188:
2105 pAudioPlayer->_4AA258(804); 2097 pAudioPlayer->_4AA258(804);
2106 pParty->field_6F8 = 64; 2098 pParty->walk_sound_timer = 64;
2107 } 2099 }
2108 } 2100 }
2109 if ( !bJumping || bFeatherFall ) 2101 if ( !bJumping || jumping_up )
2110 pParty->uFlags &= ~PARTY_FLAGS_1_FALLING; 2102 pParty->uFlags &= ~PARTY_FLAGS_1_FALLING;
2111 else 2103 else
2112 pParty->uFlags |= PARTY_FLAGS_1_FALLING; 2104 pParty->uFlags |= PARTY_FLAGS_1_FALLING;
2113 pParty->uFlags &= ~0x200; 2105 pParty->uFlags &= ~0x200;
2114 pParty->vPosition.x = new_party_x; 2106 pParty->vPosition.x = new_party_x;
2347 else 2339 else
2348 { 2340 {
2349 bJumping = 1; 2341 bJumping = 1;
2350 } 2342 }
2351 v101 = pZ - v111 <= 32; 2343 v101 = pZ - v111 <= 32;
2352 if ( bWalkSound && pParty->field_6F8 > 0 ) 2344 if ( bWalkSound && pParty->walk_sound_timer)
2353 pParty->field_6F8 -= pEventTimer->uTimeElapsed; 2345 {
2346 if (pParty->walk_sound_timer >= pEventTimer->uTimeElapsed)
2347 pParty->walk_sound_timer -= pEventTimer->uTimeElapsed;
2348 else pParty->walk_sound_timer = 0;
2349 }
2354 if (!bUnderwater 2350 if (!bUnderwater
2355 && SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) <= 0 2351 && SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) <= 0
2356 && (SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) < 0 || LODWORD(pParty->pPartyBuffs[7].uExpireTime) <= 0) ) 2352 && (SHIDWORD(pParty->pPartyBuffs[7].uExpireTime) < 0 || LODWORD(pParty->pPartyBuffs[7].uExpireTime) <= 0) )
2357 pParty->bFlying = false; 2353 pParty->bFlying = false;
2358 if (!bJumping) 2354 if (!bJumping)
2359 { 2355 {
2360 if ( pParty->field_6F4_packedid != (8 * v108 | OBJECT_BModel) ) 2356 if ( pParty->floor_face_pid != PID(OBJECT_BModel, v108) )
2361 { 2357 {
2362 if (v108) 2358 if (v108)
2363 { 2359 {
2364 if ( v108 >> 6 < pOutdoor->uNumBModels ) 2360 if ( v108 >> 6 < pOutdoor->uNumBModels )
2365 { 2361 {
2370 pParty->field_6F4_packedid = 8 * v108 | OBJECT_BModel; 2366 pParty->field_6F4_packedid = 8 * v108 | OBJECT_BModel;
2371 v103 = *(short *)(v7->pFacePlane.vNormal.x + 308 * v6 + 292); 2367 v103 = *(short *)(v7->pFacePlane.vNormal.x + 308 * v6 + 292);
2372 }*/ 2368 }*/
2373 if ( BYTE3(v7[v6].uAttributes) & 4 ) 2369 if ( BYTE3(v7[v6].uAttributes) & 4 )
2374 { 2370 {
2375 pParty->field_6F4_packedid = 8 * v108 | OBJECT_BModel; 2371 pParty->floor_face_pid = PID(OBJECT_BModel, v108);
2376 v103 = v7[v6].sCogTriggeredID; 2372 v103 = v7[v6].sCogTriggeredID;
2377 } 2373 }
2378 } 2374 }
2379 } 2375 }
2380 } 2376 }
2381 pParty->field_6F4_packedid = 8 * v108 | OBJECT_BModel; 2377 pParty->floor_face_pid = PID(OBJECT_BModel, v108);
2382 } 2378 }
2383 _walk_speed = pParty->uWalkSpeed; 2379 _walk_speed = pParty->uWalkSpeed;
2384 _angle_y = pParty->sRotationY; 2380 _angle_y = pParty->sRotationY;
2385 _angle_x = pParty->sRotationX; 2381 _angle_x = pParty->sRotationX;
2386 v126 = pEventTimer->dt_in_some_format; 2382 v126 = pEventTimer->dt_in_some_format;
2951 pZ = v122 + (v47->pFacePlane.vNormal.z * v55 >> 16); 2947 pZ = v122 + (v47->pFacePlane.vNormal.z * v55 >> 16);
2952 } 2948 }
2953 LABEL_220: 2949 LABEL_220:
2954 v45 = stru_721530.uFaceID; 2950 v45 = stru_721530.uFaceID;
2955 LABEL_221: 2951 LABEL_221:
2956 if ( pParty->field_6F4_packedid != v45 && BYTE3(v47->uAttributes) & 4 ) 2952 if ( pParty->floor_face_pid != v45 && BYTE3(v47->uAttributes) & 4 )
2957 { 2953 {
2958 pParty->field_6F4_packedid = v45; 2954 pParty->floor_face_pid = v45;
2959 v103 = v47->sCogTriggeredID; 2955 v103 = v47->sCogTriggeredID;
2960 } 2956 }
2961 goto LABEL_234; 2957 goto LABEL_234;
2962 } 2958 }
2963 v118 = abs(v128 * v47->pFacePlane.vNormal.y + v121 * v52 + v2 * v47->pFacePlane.vNormal.x) >> 16; 2959 v118 = abs(v128 * v47->pFacePlane.vNormal.y + v121 * v52 + v2 * v47->pFacePlane.vNormal.x) >> 16;
2986 v122 = (unsigned __int64)(58500i64 * v121) >> 16; 2982 v122 = (unsigned __int64)(58500i64 * v121) >> 16;
2987 ++v126; 2983 ++v126;
2988 v121 = (unsigned __int64)(58500i64 * v121) >> 16; 2984 v121 = (unsigned __int64)(58500i64 * v121) >> 16;
2989 } 2985 }
2990 while ( v126 < 100 ); 2986 while ( v126 < 100 );
2991 if ( bWalkSound && pParty->field_6F8 <= 0 ) 2987 if ( bWalkSound && pParty->walk_sound_timer <= 0 )
2992 { 2988 {
2993 v122 = abs(pParty->vPosition.x - pX); 2989 v122 = abs(pParty->vPosition.x - pX);
2994 v126 = abs(pParty->vPosition.y - pY); 2990 v126 = abs(pParty->vPosition.y - pY);
2995 v62 = abs(pParty->vPosition.z - pZ); 2991 v62 = abs(pParty->vPosition.z - pZ);
2996 if ( integer_sqrt(v122 * v122 + v126 * v126 + v62 * v62) < 8 ) 2992 if ( integer_sqrt(v122 * v122 + v126 * v126 + v62 * v62) < 8 )
2997 goto LABEL_344; 2993 goto LABEL_344;
2998 if ( v114 && (!bJumping || v101) ) 2994 if ( v114 && (!bJumping || v101) )
2999 { 2995 {
3000 if ( !v107 2996 if ( !v107
3001 && !(BYTE1(pOutdoor->pBModels[pParty->field_6F4_packedid >> 9].pFaces[(pParty->field_6F4_packedid >> 3) & 0x3F].uAttributes) & 0x20) ) 2997 && !(BYTE1(pOutdoor->pBModels[pParty->floor_face_pid >> 9].pFaces[(pParty->floor_face_pid >> 3) & 0x3F].uAttributes) & 0x20) )
3002 { 2998 {
3003 2999
3004 v90 = -1; 3000 v90 = -1;
3005 v89 = 1; 3001 v89 = 1;
3006 v88 = 804; 3002 v88 = 804;
3019 goto LABEL_257; 3015 goto LABEL_257;
3020 } 3016 }
3021 if ( v124 && (!bJumping || v101) ) 3017 if ( v124 && (!bJumping || v101) )
3022 { 3018 {
3023 if ( v107 3019 if ( v107
3024 || BYTE1(pOutdoor->pBModels[pParty->field_6F4_packedid >> 9].pFaces[(pParty->field_6F4_packedid >> 3) & 0x3F].uAttributes) & 0x20 ) 3020 || BYTE1(pOutdoor->pBModels[pParty->floor_face_pid >> 9].pFaces[(pParty->floor_face_pid >> 3) & 0x3F].uAttributes) & 0x20 )
3025 { 3021 {
3026 3022
3027 v90 = -1; 3023 v90 = -1;
3028 v89 = 1; 3024 v89 = 1;
3029 v88 = 804; 3025 v88 = 804;
3039 } 3035 }
3040 else 3036 else
3041 { 3037 {
3042 LABEL_344: 3038 LABEL_344:
3043 pAudioPlayer->_4AA258(804); 3039 pAudioPlayer->_4AA258(804);
3044 pParty->field_6F8 = 64; 3040 pParty->walk_sound_timer = 64;
3045 } 3041 }
3046 } 3042 }
3047 if ( !bJumping || v101 ) 3043 if ( !bJumping || v101 )
3048 pParty->uFlags &= ~PARTY_FLAGS_1_FALLING; 3044 pParty->uFlags &= ~PARTY_FLAGS_1_FALLING;
3049 else 3045 else
3173 } 3169 }
3174 } 3170 }
3175 } 3171 }
3176 goto LABEL_318; 3172 goto LABEL_318;
3177 } 3173 }
3178 if ( bWalkSound && pParty->field_6F8 <= 0 ) 3174 if ( bWalkSound && pParty->walk_sound_timer <= 0 )
3179 { 3175 {
3180 pAudioPlayer->_4AA258(804); 3176 pAudioPlayer->_4AA258(804);
3181 pParty->field_6F8 = 64; 3177 pParty->walk_sound_timer = 64;
3182 } 3178 }
3183 LABEL_318: 3179 LABEL_318:
3184 v81 = pZ; 3180 v81 = pZ;
3185 v82 = pZ; 3181 v82 = pZ;
3186 pParty->vPosition.z = pZ; 3182 pParty->vPosition.z = pZ;
12424 GUIWindow v5; // [sp+D4h] [bp-58h]@4 12420 GUIWindow v5; // [sp+D4h] [bp-58h]@4
12425 GUIFont *pFont; // [sp+128h] [bp-4h]@1 12421 GUIFont *pFont; // [sp+128h] [bp-4h]@1
12426 12422
12427 v0 = pFontArrus; 12423 v0 = pFontArrus;
12428 pFont = pFontArrus; 12424 pFont = pFontArrus;
12429 if ( ptr_F8B1E8 && !byte_5B0938[0] ) 12425 if ( current_npc_text && !byte_5B0938[0] )
12430 strcpy(byte_5B0938, ptr_F8B1E8); 12426 strcpy(byte_5B0938, current_npc_text);
12431 v5.uFrameWidth = game_viewport_width; 12427 v5.uFrameWidth = game_viewport_width;
12432 v5.uFrameZ = 452; 12428 v5.uFrameZ = 452;
12433 v1 = pFontArrus->CalcTextHeight(byte_5B0938, &v5, 12, 0) + 7; 12429 v1 = pFontArrus->CalcTextHeight(byte_5B0938, &v5, 12, 0) + 7;
12434 if ( 352 - v1 < 8 ) 12430 if ( 352 - v1 < 8 )
12435 { 12431 {
12495 pEventTimer->Pause(); 12491 pEventTimer->Pause();
12496 dword_5C3418 = v4; 12492 dword_5C3418 = v4;
12497 dword_5C341C = v3; 12493 dword_5C341C = v3;
12498 _591094_decoration = activeLevelDecoration; 12494 _591094_decoration = activeLevelDecoration;
12499 pGUIWindow2 = GUIWindow::Create(0, 0, 640u, 480u, WINDOW_GreetingNPC, a4, 0); 12495 pGUIWindow2 = GUIWindow::Create(0, 0, 640u, 480u, WINDOW_GreetingNPC, a4, 0);
12500 pGUIWindow2->CreateButton(61u, 424u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 1u, 0x31u, "", 0); 12496 pGUIWindow2->CreateButton(61u, 424u, 0x1Fu, 0x28u, 2, 94, UIMSG_SelectCharacter, 1u, 0x31u, "", 0);
12501 pGUIWindow2->CreateButton(177u, 424u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 2u, 0x32u, "", 0); 12497 pGUIWindow2->CreateButton(177u, 424u, 0x1Fu, 0x28u, 2, 94, UIMSG_SelectCharacter, 2u, 0x32u, "", 0);
12502 pGUIWindow2->CreateButton(292u, 424u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 3u, 0x33u, "", 0); 12498 pGUIWindow2->CreateButton(292u, 424u, 0x1Fu, 0x28u, 2, 94, UIMSG_SelectCharacter, 3u, 0x33u, "", 0);
12503 pGUIWindow2->CreateButton(407u, 424u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 4u, 0x34u, "", 0); 12499 pGUIWindow2->CreateButton(407u, 424u, 0x1Fu, 0x28u, 2, 94, UIMSG_SelectCharacter, 4u, 0x34u, "", 0);
12504 } 12500 }
12505 } 12501 }
12506 12502
12507 //----- (004452BB) -------------------------------------------------------- 12503 //----- (004452BB) --------------------------------------------------------
12508 void __cdecl sub_4452BB() 12504 void __cdecl sub_4452BB()
12538 12534
12539 //----- (00445350) -------------------------------------------------------- 12535 //----- (00445350) --------------------------------------------------------
12540 void __cdecl DrawDialogueUI() 12536 void __cdecl DrawDialogueUI()
12541 { 12537 {
12542 NPCData *pNPC; // ebx@2 12538 NPCData *pNPC; // ebx@2
12543 int v1; // eax@2 12539 int pGreetType; // eax@2
12544 unsigned __int16 v2; // di@2 12540 unsigned __int16 v2; // di@2
12545 //unsigned int v3; // eax@2 12541 //unsigned int v3; // eax@2
12546 char *v4; // esi@3 12542 char *v4; // esi@3
12547 //int v5; // eax@11 12543 //int v5; // eax@11
12548 //char *v6; // ecx@13 12544 //char *v6; // ecx@13
12589 12585
12590 if ( !pDialogueWindow ) 12586 if ( !pDialogueWindow )
12591 return; 12587 return;
12592 memcpy(&v51, pDialogueWindow, sizeof(v51)); 12588 memcpy(&v51, pDialogueWindow, sizeof(v51));
12593 pNPC = GetNPCData(sDialogue_SpeakingActorNPC_ID); 12589 pNPC = GetNPCData(sDialogue_SpeakingActorNPC_ID);
12594 v1 = sub_445C8B(sDialogue_SpeakingActorNPC_ID); 12590 pGreetType = GetGreetType(sDialogue_SpeakingActorNPC_ID);
12595 v51.uFrameWidth -= 10; 12591 v51.uFrameWidth -= 10;
12596 v51.uFrameZ -= 10; 12592 v51.uFrameZ -= 10;
12597 //v54 = v1; 12593 //v54 = v1;
12598 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); 12594 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
12599 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); 12595 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
12653 break; 12649 break;
12654 12650
12655 default: 12651 default:
12656 if (uDialogueType > DIALOGUE_18 && uDialogueType < DIALOGUE_23 && !byte_5B0938[0]) 12652 if (uDialogueType > DIALOGUE_18 && uDialogueType < DIALOGUE_23 && !byte_5B0938[0])
12657 { 12653 {
12658 pInString = (char *)ptr_F8B1E8; 12654 pInString = (char *)current_npc_text;
12659 } 12655 }
12660 else if (v1 == 1) 12656 else if (pGreetType == 1)//QuestNPC_greet
12661 { 12657 {
12662 if (pNPC->greet) 12658 if (pNPC->greet)
12663 { 12659 {
12664 if ((pNPC->uFlags & 3) == 2) 12660 if ((pNPC->uFlags & 3) == 2)
12665 pInString = pNPCStats->pNPCGreetings[pNPC->greet - 1].pGreeting2; 12661 pInString = pNPCStats->pNPCGreetings[pNPC->greet - 1].pGreeting2;
12666 else 12662 else
12667 pInString = pNPCStats->pNPCGreetings[pNPC->greet - 1].pGreeting1; 12663 pInString = pNPCStats->pNPCGreetings[pNPC->greet - 1].pGreeting1;
12668 } 12664 }
12669 } 12665 }
12670 else if (v1 == 2) 12666 else if (pGreetType == 2)//HiredNPC_greet
12671 { 12667 {
12672 auto prof = pNPCStats->pProfessions + pNPC->uProfession - 1; 12668 auto prof = pNPCStats->pProfessions + pNPC->uProfession - 1;
12673 12669
12674 if (pNPC->Hired()) 12670 if (pNPC->Hired())
12675 pInString = BuilDialogueString(prof->pDismissText, uActiveCharacter - 1, 0, 0, 0, 0); 12671 pInString = BuilDialogueString(prof->pDismissText, uActiveCharacter - 1, 0, 0, 0, 0);
12707 { 12703 {
12708 v14 = v52.GetControl(i); 12704 v14 = v52.GetControl(i);
12709 //v15 = v14; 12705 //v15 = v14;
12710 if ( !v14 ) 12706 if ( !v14 )
12711 break; 12707 break;
12712 v16 = v14->uControlParam; 12708 v16 = v14->msg_param;
12713 12709
12714 if ( v16 > 88 ) 12710 if ( v16 > 88 )
12715 v14->pButtonName[0] = 0; 12711 v14->pButtonName[0] = 0;
12716 else if (v16 == 88) 12712 else if (v16 == 88)
12717 strcpy(v14->pButtonName, pGlobalTXT_LocalizationStrings[581]); // Lord 12713 strcpy(v14->pButtonName, pGlobalTXT_LocalizationStrings[581]); // Lord
12735 __debugbreak(); // learn conditions of this event 12731 __debugbreak(); // learn conditions of this event
12736 auto topic = pNPCTopics[pNPC->evt_F - 1].pTopic;//(&dword_721660)[8 * v23]; 12732 auto topic = pNPCTopics[pNPC->evt_F - 1].pTopic;//(&dword_721660)[8 * v23];
12737 if (!topic) 12733 if (!topic)
12738 { 12734 {
12739 v14->pButtonName[0] = 0; 12735 v14->pButtonName[0] = 0;
12740 v14->uControlParam = 0; 12736 v14->msg_param = 0;
12741 } 12737 }
12742 else 12738 else
12743 strcpy(v14->pButtonName, topic); 12739 strcpy(v14->pButtonName, topic);
12744 } 12740 }
12745 else if (v16 == 9) 12741 else if (v16 == 9)
12749 // __debugbreak(); // learn conditions of this event Scavenger Hunt 12745 // __debugbreak(); // learn conditions of this event Scavenger Hunt
12750 auto topic = pNPCTopics[pNPC->evt_A - 1].pTopic;//(&dword_721660)[8 * v23]; 12746 auto topic = pNPCTopics[pNPC->evt_A - 1].pTopic;//(&dword_721660)[8 * v23];
12751 if (!topic) 12747 if (!topic)
12752 { 12748 {
12753 v14->pButtonName[0] = 0; 12749 v14->pButtonName[0] = 0;
12754 v14->uControlParam = 0; 12750 v14->msg_param = 0;
12755 } 12751 }
12756 else strcpy(v14->pButtonName, topic); 12752 else strcpy(v14->pButtonName, topic);
12757 } 12753 }
12758 else if (v16 == 20) 12754 else if (v16 == 20)
12759 { 12755 {
12760 //__debugbreak(); // learn conditions of this event instruments 12756 //__debugbreak(); // learn conditions of this event instruments
12761 auto topic = pNPCTopics[pNPC->evt_B - 1].pTopic;//(&dword_721660)[8 * v23]; 12757 auto topic = pNPCTopics[pNPC->evt_B - 1].pTopic;//(&dword_721660)[8 * v23];
12762 if (!topic) 12758 if (!topic)
12763 { 12759 {
12764 v14->pButtonName[0] = 0; 12760 v14->pButtonName[0] = 0;
12765 v14->uControlParam = 0; 12761 v14->msg_param = 0;
12766 } 12762 }
12767 else strcpy(v14->pButtonName, topic); 12763 else strcpy(v14->pButtonName, topic);
12768 } 12764 }
12769 else if (v16 == 21) 12765 else if (v16 == 21)
12770 { 12766 {
12771 //__debugbreak(); // learn conditions of this event 12767 //__debugbreak(); // learn conditions of this event
12772 auto topic = pNPCTopics[pNPC->evt_C - 1].pTopic;//(&dword_721660)[8 * v23]; 12768 auto topic = pNPCTopics[pNPC->evt_C - 1].pTopic;//(&dword_721660)[8 * v23];
12773 if (!topic) 12769 if (!topic)
12774 { 12770 {
12775 v14->pButtonName[0] = 0; 12771 v14->pButtonName[0] = 0;
12776 v14->uControlParam = 0; 12772 v14->msg_param = 0;
12777 } 12773 }
12778 else strcpy(v14->pButtonName, topic); 12774 else strcpy(v14->pButtonName, topic);
12779 } 12775 }
12780 else if (v16 == 22) 12776 else if (v16 == 22)
12781 { 12777 {
12782 //__debugbreak(); // learn conditions of this event 12778 //__debugbreak(); // learn conditions of this event
12783 auto topic = pNPCTopics[pNPC->evt_D - 1].pTopic;//(&dword_721660)[8 * v23]; 12779 auto topic = pNPCTopics[pNPC->evt_D - 1].pTopic;//(&dword_721660)[8 * v23];
12784 if (!topic) 12780 if (!topic)
12785 { 12781 {
12786 v14->pButtonName[0] = 0; 12782 v14->pButtonName[0] = 0;
12787 v14->uControlParam = 0; 12783 v14->msg_param = 0;
12788 } 12784 }
12789 else strcpy(v14->pButtonName, topic); 12785 else strcpy(v14->pButtonName, topic);
12790 } 12786 }
12791 else if (v16 == 23) 12787 else if (v16 == 23)
12792 { 12788 {
12793 //__debugbreak(); // learn conditions of this event 12789 //__debugbreak(); // learn conditions of this event
12794 auto topic = pNPCTopics[pNPC->evt_E - 1].pTopic;//(&dword_721660)[8 * v23]; 12790 auto topic = pNPCTopics[pNPC->evt_E - 1].pTopic;//(&dword_721660)[8 * v23];
12795 if (!topic) 12791 if (!topic)
12796 { 12792 {
12797 v14->pButtonName[0] = 0; 12793 v14->pButtonName[0] = 0;
12798 v14->uControlParam = 0; 12794 v14->msg_param = 0;
12799 } 12795 }
12800 else strcpy(v14->pButtonName, topic); 12796 else strcpy(v14->pButtonName, topic);
12801 } 12797 }
12802 else if (v16 == 13) 12798 else if (v16 == 13)
12803 { 12799 {
12889 } 12885 }
12890 pRenderer->DrawTextureIndexed(471, 445, (Texture *)(uExitCancelTextureId != -1 ? &pIcons_LOD->pTextures[uExitCancelTextureId] : 0)); 12886 pRenderer->DrawTextureIndexed(471, 445, (Texture *)(uExitCancelTextureId != -1 ? &pIcons_LOD->pTextures[uExitCancelTextureId] : 0));
12891 } 12887 }
12892 12888
12893 //----- (00445C8B) -------------------------------------------------------- 12889 //----- (00445C8B) --------------------------------------------------------
12894 int __fastcall sub_445C8B(signed int a1) 12890 int __fastcall GetGreetType(signed int SpeakingNPC_ID)
12895 { 12891 {
12896 signed int v1; // ebx@1 12892 signed int v1; // ebx@1
12897 int v3; // edi@6 12893 int v3; // edi@6
12898 int v4; // ecx@6 12894 int v4; // ecx@6
12899 int v5; // edx@6 12895 int v5; // edx@6
12900 NPCData *v6; // eax@6 12896 NPCData *v6; // eax@6
12901 char *v7; // ebp@11 12897 char *v7; // ebp@11
12902 NPCData *v8; // esi@11 12898 NPCData *v8; // esi@11
12903 12899
12904 v1 = 0; 12900 v1 = 0;
12905 if ( a1 >= 0 ) 12901 if ( SpeakingNPC_ID >= 0 )
12906 { 12902 {
12907 if ( a1 < 5000 ) 12903 if ( SpeakingNPC_ID < 5000 )
12908 return 1; 12904 return 1;//QuestNPC_greet
12909 return 2; 12905 return 2;//HiredNPC_greet
12910 } 12906 }
12911 if ( a1 >= 5000 ) 12907 if ( SpeakingNPC_ID >= 5000 )
12912 return 2; 12908 return 2;
12913 v3 = abs((int)sDialogue_SpeakingActorNPC_ID) - 1; 12909 v3 = abs((int)sDialogue_SpeakingActorNPC_ID) - 1;
12914 v4 = 0; 12910 v4 = 0;
12915 v5 = 0; 12911 v5 = 0;
12916 v6 = pParty->pHirelings; 12912 v6 = pParty->pHirelings;
12936 ++v1; 12932 ++v1;
12937 ++v8; 12933 ++v8;
12938 } 12934 }
12939 while ( v1 < (signed int)pNPCStats->uNumNewNPCs ); 12935 while ( v1 < (signed int)pNPCStats->uNumNewNPCs );
12940 } 12936 }
12941 return ((unsigned __int8)pTmpBuf[v3] < 2u) + 1; 12937 return ((unsigned __int8)pTmpBuf[v3] < 2) + 1;
12942 } 12938 }
12943 12939
12944 //----- (0044603D) -------------------------------------------------------- 12940 //----- (0044603D) --------------------------------------------------------
12945 void __cdecl sub_44603D() 12941 void __cdecl sub_44603D()
12946 { 12942 {
13601 v10 = pMapStats->GetMapInfo(pCurrentMapName); 13597 v10 = pMapStats->GetMapInfo(pCurrentMapName);
13602 if ( v10 ) 13598 if ( v10 )
13603 { 13599 {
13604 v11 = uNumActors; 13600 v11 = uNumActors;
13605 SpawnEncounter((MapInfo *)&pMapStats->pInfos[v10], &v16, 0, count, 0); 13601 SpawnEncounter((MapInfo *)&pMapStats->pInfos[v10], &v16, 0, count, 0);
13606 memcpy(&v15, Actor::GetDirectionInfo(8 * v11 | AI_OBJECT_ACTOR, 4u, &a3, 1), sizeof(v15)); 13602 memcpy(&v15, Actor::GetDirectionInfo(PID(OBJECT_Actor, v11), 4u, &a3, 1), sizeof(v15));
13607 v12 = v11; 13603 v12 = v11;
13608 if ( (signed int)v11 < (signed int)uNumActors ) 13604 if ( (signed int)v11 < (signed int)uNumActors )
13609 { 13605 {
13610 for ( pActor = &pActors[v11]; v12 < (signed int)uNumActors; ++pActor ) 13606 for ( pActor = &pActors[v11]; v12 < (signed int)uNumActors; ++pActor )
13611 { 13607 {
13617 } 13613 }
13618 } 13614 }
13619 } 13615 }
13620 13616
13621 //----- (00448DF8) -------------------------------------------------------- 13617 //----- (00448DF8) --------------------------------------------------------
13622 void __fastcall sub_448DF8_cast_spell(int spellnum, int rank, int level, int fromx, int fromy, int fromz, int tox, int toy, int toz) 13618 void __fastcall EventCastSpell(int spellnum, int uSkillLevel, int uSkill, int fromx, int fromy, int fromz, int tox, int toy, int toz)//sub_448DF8
13623 { 13619 {
13624 int v9; // esi@1 13620 int v9; // esi@1
13625 double v10; // st7@4 13621 double v10; // st7@4
13626 double v11; // st6@4 13622 double v11; // st6@4
13627 double v12; // st5@4 13623 double v12; // st5@4
13684 int a8b; // [sp+D0h] [bp+1Ch]@37 13680 int a8b; // [sp+D0h] [bp+1Ch]@37
13685 int a8c; // [sp+D0h] [bp+1Ch]@55 13681 int a8c; // [sp+D0h] [bp+1Ch]@55
13686 float toza; // [sp+D4h] [bp+20h]@6 13682 float toza; // [sp+D4h] [bp+20h]@6
13687 13683
13688 v9 = 0; 13684 v9 = 0;
13689 v59 = rank + 1; 13685 v59 = uSkillLevel + 1;
13690 //spellnum_ = spellnum; 13686 //spellnum_ = spellnum;
13691 v60 = 0; 13687 v60 = 0;
13692 if ( tox || toy || toz ) 13688 if ( tox || toy || toz )
13693 { 13689 {
13694 v10 = (double)tox - (double)fromx; 13690 v10 = (double)tox - (double)fromx;
13741 if ( v40 ) 13737 if ( v40 )
13742 { 13738 {
13743 v41 = v40 - 1; 13739 v41 = v40 - 1;
13744 if ( !v41 ) 13740 if ( !v41 )
13745 { 13741 {
13746 v42 = 14400 * level; 13742 v42 = 14400 * uSkill;
13747 v43 = 4 * level + 10; 13743 v43 = 4 * uSkill + 10;
13748 goto LABEL_114; 13744 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 0);
13745 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 1u);
13746 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 2u);
13747 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 3u);
13748 v39 = (signed __int64)((double)(v42 << 7) * 0.033333335);
13749 v37 = &pParty->pPartyBuffs[2];
13750 v36 = pParty->uTimePlayed + v39;
13751 v37->Apply(v36, a7b, v43, 0, 0);
13752 goto LABEL_139;
13749 } 13753 }
13750 if ( v41 == 1 ) 13754 if ( v41 == 1 )
13751 { 13755 {
13752 v42 = 18000 * level; 13756 v42 = 18000 * uSkill;
13753 v43 = 5 * level + 10; 13757 v43 = 5 * uSkill + 10;
13754 goto LABEL_114; 13758 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 0);
13755 } 13759 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 1u);
13756 } 13760 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 2u);
13757 v42 = 10800 * level; 13761 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 3u);
13758 v43 = 3 * level + 10; 13762 v39 = (signed __int64)((double)(v42 << 7) * 0.033333335);
13759 LABEL_114: 13763 v37 = &pParty->pPartyBuffs[2];
13764 v36 = pParty->uTimePlayed + v39;
13765 v37->Apply(v36, a7b, v43, 0, 0);
13766 goto LABEL_139;
13767 }
13768 }
13769 v42 = 10800 * uSkill;
13770 v43 = 3 * uSkill + 10;
13760 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 0); 13771 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 0);
13761 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 1u); 13772 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 1u);
13762 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 2u); 13773 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 2u);
13763 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 3u); 13774 pGame->pStru6Instance->SetPlayerBuffAnim(0x53u, 3u);
13764 v52 = 0;
13765 v50 = 0;
13766 v48 = v43;
13767 v46 = a7b;
13768 v39 = (signed __int64)((double)(v42 << 7) * 0.033333335); 13775 v39 = (signed __int64)((double)(v42 << 7) * 0.033333335);
13769 v37 = &pParty->pPartyBuffs[2]; 13776 v37 = &pParty->pPartyBuffs[2];
13770 LABEL_115:
13771 v36 = pParty->uTimePlayed + v39; 13777 v36 = pParty->uTimePlayed + v39;
13772 LABEL_116: 13778 v37->Apply(v36, a7b, v43, 0, 0);
13773 v37->Apply(v36, v46, v48, v50, v52);
13774 goto LABEL_139; 13779 goto LABEL_139;
13775 } 13780 }
13776 if ( spellnum != 58 ) 13781 if ( spellnum != 58 )
13777 { 13782 {
13778 switch ( spellnum ) 13783 switch ( spellnum )
13785 case 32: 13790 case 32:
13786 case 39: 13791 case 39:
13787 case 41: 13792 case 41:
13788 a1.stru_24.Reset(); 13793 a1.stru_24.Reset();
13789 v16 = 0; 13794 v16 = 0;
13790 a1.field_48 = spellnum; 13795 a1.spell_id = spellnum;
13791 a1.field_4C = level; 13796 a1.spell_level = uSkill;
13792 a1.field_50 = v15; 13797 a1.spell_skill = v15;
13793 if ( (signed int)pObjectList->uNumObjects <= 0 ) 13798 if ( (signed int)pObjectList->uNumObjects <= 0 )
13794 goto LABEL_34; 13799 {
13800 v18 = 0;
13801 a1.uObjectDescID = v18;
13802 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
13803 a1.vPosition.x = fromx;
13804 a1.uAttributes = 16;
13805 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
13806 a1.field_60_distance_related_prolly_lod = v55;
13807 v20 = yaw;
13808 a1.uSpriteFrameID = 0;
13809 a1.spell_caster_pid = 8000 | OBJECT_Item;
13810 a1.spell_target_pid = 0;
13811 a1.uFacing = yaw;
13812 a1.uSoundID = 0;
13813 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed;
13814 a1.Create(v20, pitch, v49, 0);
13815 goto LABEL_139;
13816 }
13795 v17 = (char *)&pObjectList->pObjects->uObjectID; 13817 v17 = (char *)&pObjectList->pObjects->uObjectID;
13796 while ( (short)a1.uType != *(short *)v17 ) 13818 while ( (short)a1.uType != *(short *)v17 )
13797 { 13819 {
13798 ++v16; 13820 ++v16;
13799 v17 += 56; 13821 v17 += 56;
13800 if ( v16 >= (signed int)pObjectList->uNumObjects ) 13822 if ( v16 >= (signed int)pObjectList->uNumObjects )
13801 goto LABEL_34; 13823 {
13824 v18 = 0;
13825 a1.uObjectDescID = v18;
13826 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
13827 a1.vPosition.x = fromx;
13828 a1.uAttributes = 16;
13829 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
13830 a1.field_60_distance_related_prolly_lod = v55;
13831 v20 = yaw;
13832 a1.uSpriteFrameID = 0;
13833 a1.spell_caster_pid = 8000 | OBJECT_Item;
13834 a1.spell_target_pid = 0;
13835 a1.uFacing = yaw;
13836 a1.uSoundID = 0;
13837 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed;
13838 a1.Create(v20, pitch, v49, 0);
13839 goto LABEL_139;
13840 }
13802 } 13841 }
13803 LABEL_20:
13804 v18 = v16; 13842 v18 = v16;
13805 goto LABEL_35; 13843 a1.uObjectDescID = v18;
13844 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
13845 a1.vPosition.x = fromx;
13846 a1.uAttributes = 16;
13847 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
13848 a1.field_60_distance_related_prolly_lod = v55;
13849 v20 = yaw;
13850 a1.uSpriteFrameID = 0;
13851 a1.spell_caster_pid = 8000 | OBJECT_Item;
13852 a1.spell_target_pid = 0;
13853 a1.uFacing = yaw;
13854 a1.uSoundID = 0;
13855 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed;
13856 a1.Create(v20, pitch, v49, 0);
13857 goto LABEL_139;
13806 case 24: 13858 case 24:
13807 switch ( v15 ) 13859 switch ( v15 )
13808 { 13860 {
13809 case 1: 13861 case 1:
13810 v60 = 1; 13862 v60 = 1;
13823 if ( v60 != 1 ) 13875 if ( v60 != 1 )
13824 { 13876 {
13825 a8b = a7c / (v60 - 1); 13877 a8b = a7c / (v60 - 1);
13826 a1.stru_24.Reset(); 13878 a1.stru_24.Reset();
13827 v21 = 0; 13879 v21 = 0;
13828 a1.field_48 = spellnum; 13880 a1.spell_id = spellnum;
13829 a1.field_4C = level; 13881 a1.spell_level = uSkill;
13830 a1.field_50 = v15; 13882 a1.spell_skill = v15;
13831 if ( (signed int)pObjectList->uNumObjects <= 0 ) 13883 if ( (signed int)pObjectList->uNumObjects <= 0 )
13832 { 13884 {
13833 LABEL_41:
13834 v23 = 0; 13885 v23 = 0;
13835 } 13886 }
13836 else 13887 else
13837 { 13888 {
13838 v22 = (char *)&pObjectList->pObjects->uObjectID; 13889 v22 = (char *)&pObjectList->pObjects->uObjectID;
13839 while ( (short)a1.uType != *(short *)v22 ) 13890 while ( (short)a1.uType != *(short *)v22 )
13840 { 13891 {
13841 ++v21; 13892 ++v21;
13842 v22 += 56; 13893 v22 += 56;
13843 if ( v21 >= (signed int)pObjectList->uNumObjects ) 13894 if ( v21 >= (signed int)pObjectList->uNumObjects )
13844 goto LABEL_41; 13895 {
13896 v23 = 0;
13897 a1.uObjectDescID = v23;
13898 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
13899 a1.vPosition.x = fromx;
13900 a1.uAttributes = 16;
13901 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
13902 a1.field_60_distance_related_prolly_lod = v55;
13903 a1.uSpriteFrameID = 0;
13904 a1.spell_caster_pid = 8000 | OBJECT_Item;
13905 a1.spell_target_pid = 4;
13906 a1.uSoundID = 0;
13907 for ( i = a7c / -2; i <= a7c / 2; i += a8b )
13908 {
13909 a1.uFacing = i + yaw;
13910 a1.Create((signed __int16)(i + (short)yaw), pitch, pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, 0);
13911 }
13912 goto LABEL_139;
13913 }
13845 } 13914 }
13846 v23 = v21; 13915 v23 = v21;
13847 } 13916 }
13848 a1.uObjectDescID = v23; 13917 a1.uObjectDescID = v23;
13849 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); 13918 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
13850 a1.vPosition.x = fromx; 13919 a1.vPosition.x = fromx;
13851 a1.uAttributes = 16; 13920 a1.uAttributes = 16;
13852 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); 13921 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
13853 a1.field_60_distance_related_prolly_lod = v55; 13922 a1.field_60_distance_related_prolly_lod = v55;
13854 a1.uSpriteFrameID = 0; 13923 a1.uSpriteFrameID = 0;
13855 a1.field_58_pid = 8000 | OBJECT_Item; 13924 a1.spell_caster_pid = 8000 | OBJECT_Item;
13856 a1.field_5C = 4; 13925 a1.spell_target_pid = 4;
13857 a1.uSoundID = 0; 13926 a1.uSoundID = 0;
13858 for ( i = a7c / -2; i <= a7c / 2; i += a8b ) 13927 for ( i = a7c / -2; i <= a7c / 2; i += a8b )
13859 { 13928 {
13860 a1.uFacing = i + yaw; 13929 a1.uFacing = i + yaw;
13861 a1.Create( 13930 a1.Create((signed __int16)(i + (short)yaw), pitch, pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, 0);
13862 (signed __int16)(i + (short)yaw),
13863 pitch,
13864 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed,
13865 0);
13866 } 13931 }
13867 goto LABEL_139; 13932 goto LABEL_139;
13868 } 13933 }
13869 a1.stru_24.Reset(); 13934 a1.stru_24.Reset();
13870 v16 = 0; 13935 v16 = 0;
13871 a1.field_48 = spellnum; 13936 a1.spell_id = spellnum;
13872 a1.field_4C = level; 13937 a1.spell_level = uSkill;
13873 a1.field_50 = v15; 13938 a1.spell_skill = v15;
13874 if ( (signed int)pObjectList->uNumObjects <= 0 ) 13939 if ( (signed int)pObjectList->uNumObjects <= 0 )
13875 goto LABEL_34; 13940 {
13941 v18 = 0;
13942 a1.uObjectDescID = v18;
13943 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
13944 a1.vPosition.x = fromx;
13945 a1.uAttributes = 16;
13946 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
13947 a1.field_60_distance_related_prolly_lod = v55;
13948 v20 = yaw;
13949 a1.uSpriteFrameID = 0;
13950 a1.spell_caster_pid = 8000 | OBJECT_Item;
13951 a1.spell_target_pid = 0;
13952 a1.uFacing = yaw;
13953 a1.uSoundID = 0;
13954 v51 = 0;
13955 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed;
13956 v47 = pitch;
13957 a1.Create(v20, v47, v49, v51);
13958 goto LABEL_139;
13959 }
13876 v19 = (char *)&pObjectList->pObjects->uObjectID; 13960 v19 = (char *)&pObjectList->pObjects->uObjectID;
13877 do 13961 do
13878 { 13962 {
13879 if ( (short)a1.uType == *(short *)v19 ) 13963 if ( (short)a1.uType == *(short *)v19 )
13880 goto LABEL_20; 13964 {
13965 v18 = v16;
13966 a1.uObjectDescID = v18;
13967 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
13968 a1.vPosition.x = fromx;
13969 a1.uAttributes = 16;
13970 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
13971 a1.field_60_distance_related_prolly_lod = v55;
13972 v20 = yaw;
13973 a1.uSpriteFrameID = 0;
13974 a1.spell_caster_pid = 8000 | OBJECT_Item;
13975 a1.spell_target_pid = 0;
13976 a1.uFacing = yaw;
13977 a1.uSoundID = 0;
13978 v51 = 0;
13979 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed;
13980 v47 = pitch;
13981 a1.Create(v20, v47, v49, v51);
13982 goto LABEL_139;
13983 }
13881 ++v16; 13984 ++v16;
13882 v19 += 56; 13985 v19 += 56;
13883 } 13986 }
13884 while ( v16 < (signed int)pObjectList->uNumObjects ); 13987 while ( v16 < (signed int)pObjectList->uNumObjects );
13885 LABEL_34:
13886 v18 = 0; 13988 v18 = 0;
13887 LABEL_35:
13888 a1.uObjectDescID = v18; 13989 a1.uObjectDescID = v18;
13889 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); 13990 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
13890 a1.vPosition.x = fromx; 13991 a1.vPosition.x = fromx;
13891 a1.uAttributes = 16; 13992 a1.uAttributes = 16;
13892 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); 13993 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
13893 a1.field_60_distance_related_prolly_lod = v55; 13994 a1.field_60_distance_related_prolly_lod = v55;
13894 v20 = yaw; 13995 v20 = yaw;
13895 a1.uSpriteFrameID = 0; 13996 a1.uSpriteFrameID = 0;
13896 a1.field_58_pid = 8000 | OBJECT_Item; 13997 a1.spell_caster_pid = 8000 | OBJECT_Item;
13897 a1.field_5C = 0; 13998 a1.spell_target_pid = 0;
13898 a1.uFacing = yaw; 13999 a1.uFacing = yaw;
13899 a1.uSoundID = 0; 14000 a1.uSoundID = 0;
13900 v51 = 0; 14001 v51 = 0;
13901 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; 14002 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed;
13902 v47 = pitch; 14003 v47 = pitch;
13903 goto LABEL_36; 14004 a1.Create(v20, v47, v49, v51);
14005 goto LABEL_139;
13904 case 15: 14006 case 15:
13905 switch ( v15 ) 14007 switch ( v15 )
13906 { 14008 {
13907 case 1: 14009 case 1:
13908 v60 = 3; 14010 v60 = 3;
13919 } 14021 }
13920 a7d = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360; 14022 a7d = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360;
13921 a8c = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (v60 - 1); 14023 a8c = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (v60 - 1);
13922 a1.stru_24.Reset(); 14024 a1.stru_24.Reset();
13923 v25 = 0; 14025 v25 = 0;
13924 a1.field_48 = spellnum; 14026 a1.spell_id = spellnum;
13925 a1.field_4C = level; 14027 a1.spell_level = uSkill;
13926 a1.field_50 = v15; 14028 a1.spell_skill = v15;
13927 if ( (signed int)pObjectList->uNumObjects <= 0 ) 14029 if ( (signed int)pObjectList->uNumObjects <= 0 )
13928 goto LABEL_59; 14030 {
14031 v27 = 0;
14032 a1.uObjectDescID = v27;
14033 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
14034 a1.vPosition.x = fromx;
14035 a1.uAttributes = 16;
14036 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
14037 a1.field_60_distance_related_prolly_lod = v55;
14038 a1.uSpriteFrameID = 0;
14039 a1.spell_caster_pid = 8000 | OBJECT_Item;
14040 a1.spell_target_pid = 4;
14041 a1.uSoundID = 0;
14042 for ( j = a7d / -2; j <= a7d / 2; j += a8c )
14043 {
14044 a1.uFacing = j + yaw;
14045 a1.Create((signed __int16)(j + (short)yaw), pitch, pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, 0);
14046 }
14047 goto LABEL_139;
14048 }
13929 v26 = (char *)&pObjectList->pObjects->uObjectID; 14049 v26 = (char *)&pObjectList->pObjects->uObjectID;
13930 while ( (short)a1.uType != *(short *)v26 ) 14050 while ( (short)a1.uType != *(short *)v26 )
13931 { 14051 {
13932 ++v25; 14052 ++v25;
13933 v26 += 56; 14053 v26 += 56;
13934 if ( v25 >= (signed int)pObjectList->uNumObjects ) 14054 if ( v25 >= (signed int)pObjectList->uNumObjects )
13935 { 14055 {
13936 LABEL_59:
13937 v27 = 0; 14056 v27 = 0;
13938 goto LABEL_60; 14057 a1.uObjectDescID = v27;
14058 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
14059 a1.vPosition.x = fromx;
14060 a1.uAttributes = 16;
14061 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
14062 a1.field_60_distance_related_prolly_lod = v55;
14063 a1.uSpriteFrameID = 0;
14064 a1.spell_caster_pid = 8000 | OBJECT_Item;
14065 a1.spell_target_pid = 4;
14066 a1.uSoundID = 0;
14067 for ( j = a7d / -2; j <= a7d / 2; j += a8c )
14068 {
14069 a1.uFacing = j + yaw;
14070 a1.Create((signed __int16)(j + (short)yaw), pitch, pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, 0);
14071 }
14072 goto LABEL_139;
13939 } 14073 }
13940 } 14074 }
13941 v27 = v25; 14075 v27 = v25;
13942 LABEL_60:
13943 a1.uObjectDescID = v27; 14076 a1.uObjectDescID = v27;
13944 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); 14077 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
13945 a1.vPosition.x = fromx; 14078 a1.vPosition.x = fromx;
13946 a1.uAttributes = 16; 14079 a1.uAttributes = 16;
13947 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); 14080 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
13948 a1.field_60_distance_related_prolly_lod = v55; 14081 a1.field_60_distance_related_prolly_lod = v55;
13949 a1.uSpriteFrameID = 0; 14082 a1.uSpriteFrameID = 0;
13950 a1.field_58_pid = 8000 | OBJECT_Item; 14083 a1.spell_caster_pid = 8000 | OBJECT_Item;
13951 a1.field_5C = 4; 14084 a1.spell_target_pid = 4;
13952 a1.uSoundID = 0; 14085 a1.uSoundID = 0;
13953 for ( j = a7d / -2; j <= a7d / 2; j += a8c ) 14086 for ( j = a7d / -2; j <= a7d / 2; j += a8c )
13954 { 14087 {
13955 a1.uFacing = j + yaw; 14088 a1.uFacing = j + yaw;
13956 a1.Create( 14089 a1.Create(
13963 case 43: 14096 case 43:
13964 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) 14097 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
13965 return; 14098 return;
13966 a1.stru_24.Reset(); 14099 a1.stru_24.Reset();
13967 v29 = 0; 14100 v29 = 0;
13968 a1.field_48 = spellnum; 14101 a1.spell_id = spellnum;
13969 a1.field_4C = level; 14102 a1.spell_level = uSkill;
13970 a1.field_50 = v15; 14103 a1.spell_skill = v15;
13971 if ( (signed int)pObjectList->uNumObjects <= 0 ) 14104 if ( (signed int)pObjectList->uNumObjects <= 0 )
13972 goto LABEL_70; 14105 {
14106 v31 = 0;
14107 a1.uObjectDescID = v31;
14108 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
14109 a1.vPosition.x = fromx;
14110 a1.uAttributes = 16;
14111 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
14112 a1.field_60_distance_related_prolly_lod = v55;
14113 a1.uSpriteFrameID = 0;
14114 a1.spell_caster_pid = 8000 | OBJECT_Item;
14115 a1.spell_target_pid = 4;
14116 a1.uSoundID = 0;
14117 v51 = 0;
14118 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed;
14119 v20 = yaw;
14120 v47 = (signed int)stru_5C6E00->uIntegerHalfPi / 2;
14121 a1.Create(v20, v47, v49, v51);
14122 goto LABEL_139;
14123 }
13973 v30 = (char *)&pObjectList->pObjects->uObjectID; 14124 v30 = (char *)&pObjectList->pObjects->uObjectID;
13974 break; 14125 break;
13975 14126
13976 case SPELL_FIRE_HASTE: 14127 case SPELL_FIRE_HASTE:
13977 if ( v15 > 0 ) 14128 if ( v15 > 0 )
13978 { 14129 {
13979 if ( v15 <= 2 ) 14130 if ( v15 <= 2 )
13980 { 14131 {
13981 v9 = 60 * (level + 60); 14132 v9 = 60 * (uSkill + 60);
13982 } 14133 }
13983 else 14134 else
13984 { 14135 {
13985 if ( v15 == 3 ) 14136 if ( v15 == 3 )
13986 { 14137 {
13987 v9 = 180 * (level + 20); 14138 v9 = 180 * (uSkill + 20);
13988 } 14139 }
13989 else 14140 else
13990 { 14141 {
13991 if ( v15 == 4 ) 14142 if ( v15 == 4 )
13992 v9 = 240 * (level + 15); 14143 v9 = 240 * (uSkill + 15);
13993 } 14144 }
13994 } 14145 }
13995 } 14146 }
13996 //levela = 1; 14147 //levela = 1;
13997 //v32 = pParty->pPlayers;//[0].pConditions[1]; 14148 //v32 = pParty->pPlayers;//[0].pConditions[1];
14018 case 51: 14169 case 51:
14019 switch ( v15 ) 14170 switch ( v15 )
14020 { 14171 {
14021 case 1: 14172 case 1:
14022 case 2: 14173 case 2:
14023 v9 = 300 * (level + 12); 14174 v9 = 300 * (uSkill + 12);
14024 break; 14175 break;
14025 case 3: 14176 case 3:
14026 v9 = 900 * (level + 4); 14177 v9 = 900 * (uSkill + 4);
14027 break; 14178 break;
14028 case 4: 14179 case 4:
14029 v9 = 3600 * (level + 1); 14180 v9 = 3600 * (uSkill + 1);
14030 break; 14181 break;
14031 } 14182 }
14032 switch ( spellnum ) 14183 switch ( spellnum )
14033 { 14184 {
14034 case 17: 14185 case 17:
14035 v60 = 0; 14186 v60 = 0;
14036 level = 14; 14187 uSkill = 14;
14037 break; 14188 break;
14038 case 38: 14189 case 38:
14039 v35 = level + 5; 14190 v35 = uSkill + 5;
14040 level = 15; 14191 uSkill = 15;
14041 v60 = v35; 14192 v60 = v35;
14042 break; 14193 break;
14043 case 51: 14194 case 51:
14044 v34 = level + 5; 14195 v34 = uSkill + 5;
14045 level = 9; 14196 uSkill = 9;
14046 v60 = v34; 14197 v60 = v34;
14047 break; 14198 break;
14048 } 14199 }
14049 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 0); 14200 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 0);
14050 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 1); 14201 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 1);
14053 v52 = 0; 14204 v52 = 0;
14054 v50 = 0; 14205 v50 = 0;
14055 v48 = v60; 14206 v48 = v60;
14056 v46 = v15; 14207 v46 = v15;
14057 v36 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(v9 << 7) * 0.033333335); 14208 v36 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(v9 << 7) * 0.033333335);
14058 v37 = &pParty->pPartyBuffs[level]; 14209 v37 = &pParty->pPartyBuffs[uSkill];
14059 goto LABEL_116; 14210 v37->Apply(v36, v46, v48, v50, v52);
14211 goto LABEL_139;;
14060 case 8: 14212 case 8:
14061 if ( v15 == 2 || v15 == 3 || v15 != 4 ) 14213 if ( v15 == 2 || v15 == 3 || v15 != 4 )
14062 v38 = 60 * level; 14214 v38 = 60 * uSkill;
14063 else 14215 else
14064 v38 = 600 * level; 14216 v38 = 600 * uSkill;
14065 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 0); 14217 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 0);
14066 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 1); 14218 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 1);
14067 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 2); 14219 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 2);
14068 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 3); 14220 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 3);
14069 v52 = 0; 14221 v52 = 0;
14070 v50 = 0; 14222 v50 = 0;
14071 v48 = level; 14223 v48 = uSkill;
14072 v46 = v15; 14224 v46 = v15;
14073 v39 = (signed __int64)((double)(v38 << 7) * 0.033333335); 14225 v39 = (signed __int64)((double)(v38 << 7) * 0.033333335);
14074 v37 = &pParty->pPartyBuffs[10]; 14226 v37 = &pParty->pPartyBuffs[10];
14075 goto LABEL_115; 14227 v36 = pParty->uTimePlayed + v39;
14228 v37->Apply(v36, v46, v48, v50, v52);
14229 goto LABEL_139;
14076 case 3: 14230 case 3:
14077 case 14: 14231 case 14:
14078 case 25: 14232 case 25:
14079 case 36: 14233 case 36:
14080 goto LABEL_117; 14234 goto LABEL_117;
14085 { 14239 {
14086 ++v29; 14240 ++v29;
14087 v30 += 56; 14241 v30 += 56;
14088 if ( v29 >= (signed int)pObjectList->uNumObjects ) 14242 if ( v29 >= (signed int)pObjectList->uNumObjects )
14089 { 14243 {
14090 LABEL_70:
14091 v31 = 0; 14244 v31 = 0;
14092 goto LABEL_71; 14245 a1.uObjectDescID = v31;
14246 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
14247 a1.vPosition.x = fromx;
14248 a1.uAttributes = 16;
14249 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
14250 a1.field_60_distance_related_prolly_lod = v55;
14251 a1.uSpriteFrameID = 0;
14252 a1.spell_caster_pid = 8000 | OBJECT_Item;
14253 a1.spell_target_pid = 4;
14254 a1.uSoundID = 0;
14255 v51 = 0;
14256 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed;
14257 v20 = yaw;
14258 v47 = (signed int)stru_5C6E00->uIntegerHalfPi / 2;
14259 a1.Create(v20, v47, v49, v51);
14260 goto LABEL_139;
14093 } 14261 }
14094 } 14262 }
14095 v31 = v29; 14263 v31 = v29;
14096 LABEL_71:
14097 a1.uObjectDescID = v31; 14264 a1.uObjectDescID = v31;
14098 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy); 14265 *(_QWORD *)&a1.vPosition.y = __PAIR__(fromz, fromy);
14099 a1.vPosition.x = fromx; 14266 a1.vPosition.x = fromx;
14100 a1.uAttributes = 16; 14267 a1.uAttributes = 16;
14101 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz); 14268 a1.uSectorID = pIndoor->GetSector(fromx, fromy, fromz);
14102 a1.field_60_distance_related_prolly_lod = v55; 14269 a1.field_60_distance_related_prolly_lod = v55;
14103 a1.uSpriteFrameID = 0; 14270 a1.uSpriteFrameID = 0;
14104 a1.field_58_pid = 8000 | OBJECT_Item; 14271 a1.spell_caster_pid = 8000 | OBJECT_Item;
14105 a1.field_5C = 4; 14272 a1.spell_target_pid = 4;
14106 a1.uSoundID = 0; 14273 a1.uSoundID = 0;
14107 v51 = 0; 14274 v51 = 0;
14108 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; 14275 v49 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed;
14109 v20 = yaw; 14276 v20 = yaw;
14110 v47 = (signed int)stru_5C6E00->uIntegerHalfPi / 2; 14277 v47 = (signed int)stru_5C6E00->uIntegerHalfPi / 2;
14111 LABEL_36:
14112 a1.Create(v20, v47, v49, v51); 14278 a1.Create(v20, v47, v49, v51);
14113 goto LABEL_139; 14279 goto LABEL_139;
14114 } 14280 }
14115 LABEL_117: 14281 LABEL_117:
14116 v44 = level; 14282 v44 = uSkill;
14117 a6_4 = 3600 * level; 14283 a6_4 = 3600 * uSkill;
14118 if ( v15 == 1 ) 14284 if ( v15 == 1 )
14119 { 14285 {
14120 LABEL_124:
14121 v60 = v44; 14286 v60 = v44;
14122 goto LABEL_125; 14287 goto LABEL_125;
14123 } 14288 }
14124 if ( v15 == 2 ) 14289 if ( v15 == 2 )
14125 { 14290 {
14126 v44 = 2 * level; 14291 v44 = 2 * uSkill;
14127 goto LABEL_124; 14292 v60 = v44;
14293 goto LABEL_125;
14128 } 14294 }
14129 if ( v15 == 3 ) 14295 if ( v15 == 3 )
14130 { 14296 {
14131 v44 = 3 * level; 14297 v44 = 3 * uSkill;
14132 goto LABEL_124; 14298 v60 = v44;
14299 goto LABEL_125;
14133 } 14300 }
14134 if ( v15 == 4 ) 14301 if ( v15 == 4 )
14135 { 14302 {
14136 v44 = 4 * level; 14303 v44 = 4 * uSkill;
14137 goto LABEL_124; 14304 v60 = v44;
14305 goto LABEL_125;
14138 } 14306 }
14139 LABEL_125: 14307 LABEL_125:
14140 switch ( spellnum ) 14308 switch ( spellnum )
14141 { 14309 {
14142 case 3: 14310 case 3:
14143 level = 6; 14311 uSkill = 6;
14144 break; 14312 break;
14145 case 14: 14313 case 14:
14146 level = 0; 14314 uSkill = 0;
14147 break; 14315 break;
14148 case 25: 14316 case 25:
14149 level = 17; 14317 uSkill = 17;
14150 break; 14318 break;
14151 case 36: 14319 case 36:
14152 level = 4; 14320 uSkill = 4;
14153 break; 14321 break;
14154 case 58: 14322 case 58:
14155 level = 12; 14323 uSkill = 12;
14156 break; 14324 break;
14157 case 69: 14325 case 69:
14158 level = 1; 14326 uSkill = 1;
14159 break; 14327 break;
14160 } 14328 }
14161 //v45 = spellnum_; 14329 //v45 = spellnum_;
14162 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 0); 14330 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 0);
14163 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 1); 14331 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 1);
14164 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 2); 14332 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 2);
14165 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 3); 14333 pGame->pStru6Instance->SetPlayerBuffAnim(spellnum, 3);
14166 pParty->pPartyBuffs[level].Apply( 14334 pParty->pPartyBuffs[uSkill].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)a6_4 * 4.2666669), v15, v60, 0, 0);
14167 pParty->uTimePlayed + (signed int)(signed __int64)((double)a6_4 * 4.2666669),
14168 v15,
14169 v60,
14170 0,
14171 0);
14172 //levela = 1; 14335 //levela = 1;
14173 LABEL_138: 14336 LABEL_138:
14174 //if ( levela ) 14337 //if ( levela )
14175 LABEL_139: 14338 LABEL_139:
14176 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[spellnum], 0, 0, fromx, fromy, 0, 0, 0); 14339 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[spellnum], 0, 0, fromx, fromy, 0, 0, 0);