comparison Events.cpp @ 533:f0eff7c35a2b

m
author Ritor1
date Fri, 01 Mar 2013 22:03:57 +0600
parents 968f4053da7f
children 1d876589a030
comparison
equal deleted inserted replaced
512:968f4053da7f 533:f0eff7c35a2b
886 if ( pParty->pPickedItem.uItemID == pValue ) 886 if ( pParty->pPickedItem.uItemID == pValue )
887 { 887 {
888 pMouse->RemoveHoldingItem(); 888 pMouse->RemoveHoldingItem();
889 ++curr_seq_num; 889 ++curr_seq_num;
890 v4 = v124; 890 v4 = v124;
891
892 //v6 = v123;
893 //v7 = "";
894 break; 891 break;
895 } 892 }
896 v65 = 0; 893 v65 = 0;
897 v66 = pPlayers[uActiveCharacter]; 894 v66 = pPlayers[uActiveCharacter];
898 v67 = (int)v66->pInventoryIndices; 895 v67 = (int)v66->pInventoryIndices;
901 if ( (int)&v66->pInventoryItems[v67] == pValue ) 898 if ( (int)&v66->pInventoryItems[v67] == pValue )
902 { 899 {
903 v66->RemoveItemAtInventoryIndex(v65); 900 v66->RemoveItemAtInventoryIndex(v65);
904 ++curr_seq_num; 901 ++curr_seq_num;
905 v4 = v124; 902 v4 = v124;
906
907 //v6 = v123;
908 //v7 = "";
909 break; 903 break;
910 } 904 }
911 ++v65; 905 ++v65;
912 v67 += 4; 906 v67 += 4;
913 } 907 }
914 while ( (signed int)v65 < 126 ); 908 while ( (signed int)v65 < 126 );
915 v68 = 0; 909 v68 = 0;
916 v69 = (int)&v66->pEquipment; 910 v69 = (int)&v66->pEquipment;
917 do 911 do
918 { 912 {
919 if ( *(int *)v69 && (int)&v66->pInventoryItems[v69] == pValue ) 913 if ( *(int *)v69 && (int)&v66->pInventoryItems[v69] == pValue )
914 {
915 *(&v66->pEquipment.uOffHand + v68) = 0;
916 ++curr_seq_num;
917 v4 = v124;
918 break;
919 }
920 ++v68;
921 v69 += 4;
922 }
923 while ( v68 < 16 );
924 pPlayer = pPlayers[1];
925 while ( 1 )
926 {
927 v70 = pPlayer;
928 if ( !v64 )
929 {
930 v71 = 0;
931 v72 = (int)v70->pInventoryIndices;
932 do
920 { 933 {
921 *(&v66->pEquipment.uOffHand + v68) = 0; 934 if ( (int)&v70->pInventoryItems[v72] == pValue )
922 ++curr_seq_num; 935 {
923 v4 = v124; 936 v70->RemoveItemAtInventoryIndex(v71);
924 937 goto LABEL_169;
925 //v6 = v123; 938 }
926 //v7 = ""; 939 ++v71;
927 break; 940 v72 += 4;
928 } 941 }
929 ++v68; 942 while ( (signed int)v71 < 126 );
930 v69 += 4; 943 v73 = 0;
931 } 944 v74 = (int)&v70->pEquipment;
932 while ( v68 < 16 ); 945 while ( !*(int *)v74 || (int)&v70->pInventoryItems[v74] != pValue )
933 pPlayer = pPlayers[1];
934 while ( 1 )
935 { 946 {
936 v70 = pPlayer; 947 ++v73;
937 if ( !v64 ) 948 v74 += 4;
938 { 949 if ( v73 >= 16 )
939 v71 = 0; 950 goto LABEL_170;
940 v72 = (int)v70->pInventoryIndices; 951 }
941 do 952 *(&v70->pEquipment.uOffHand + v73) = 0;
942 {
943 if ( (int)&v70->pInventoryItems[v72] == pValue )
944 {
945 v70->RemoveItemAtInventoryIndex(v71);
946 goto LABEL_169;
947 }
948 ++v71;
949 v72 += 4;
950 }
951 while ( (signed int)v71 < 126 );
952 v73 = 0;
953 v74 = (int)&v70->pEquipment;
954 while ( !*(int *)v74 || (int)&v70->pInventoryItems[v74] != pValue )
955 {
956 ++v73;
957 v74 += 4;
958 if ( v73 >= 16 )
959 goto LABEL_170;
960 }
961 *(&v70->pEquipment.uOffHand + v73) = 0;
962 LABEL_169: 953 LABEL_169:
963 v64 = 1; 954 v64 = 1;
964 } 955 }
965 LABEL_170: 956 LABEL_170:
966 pPlayer += 4; 957 pPlayer += 4;
967 if ( pPlayer > pPlayers[4] ) 958 if ( pPlayer > pPlayers[4] )
968 { 959 {
969 //++curr_seq_num; 960 //++curr_seq_num;
970 v4 = v124; 961 v4 = v124;
971 962 break;
972 //v6 = v123; 963 }
973 //v7 = ""; 964 }
974 break; 965 }
975 }
976 }
977 }
978 if ( player_choose <= 3 ) 966 if ( player_choose <= 3 )
979 { 967 {
980 pPlayer = &pParty->pPlayers[player_choose]; 968 pPlayer = &pParty->pPlayers[player_choose];
981 pPlayer->SubtractVariable((enum VariableType)EVT_WORD(_evt->v5), pValue); 969 pPlayer->SubtractVariable((enum VariableType)EVT_WORD(_evt->v5), pValue);
982 ++curr_seq_num; 970 ++curr_seq_num;
1140 //v124 = -1; 1128 //v124 = -1;
1141 v11 = (unsigned __int8)*(&_evt->v5 + rand() % ((_evt->v5 != 0) + (_evt->v6 != 0) + (_evt->v7 != 0) + (_evt->v8 != 0) + (_evt->v9 != 0) 1129 v11 = (unsigned __int8)*(&_evt->v5 + rand() % ((_evt->v5 != 0) + (_evt->v6 != 0) + (_evt->v7 != 0) + (_evt->v8 != 0) + (_evt->v9 != 0)
1142 + (_evt->v10 != 0))); 1130 + (_evt->v10 != 0)));
1143 goto LABEL_131; 1131 goto LABEL_131;
1144 case EVENT_ReceiveDamage: 1132 case EVENT_ReceiveDamage:
1145 v85 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8); 1133 v85 = EVT_DWORD(_evt->v7);
1146 v86 = _evt->v5; 1134 v86 = _evt->v5;
1147 if ( (unsigned __int8)v86 <= 3u ) 1135 if ( (unsigned __int8)v86 <= 3u )
1148 { 1136 {
1149 v119 = _evt->v6; 1137 v119 = _evt->v6;
1150 v115 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8); 1138 v115 = EVT_DWORD(_evt->v7);
1151 v89 = (unsigned __int8)v86; 1139 v89 = (unsigned __int8)v86;
1152 goto LABEL_233; 1140 goto LABEL_233;
1153 } 1141 }
1154 if ( v86 == 4 ) 1142 if ( v86 == 4 )
1155 { 1143 {
1162 //v7 = ""; 1150 //v7 = "";
1163 break; 1151 break;
1164 } 1152 }
1165 v119 = _evt->v6; 1153 v119 = _evt->v6;
1166 v88 = pPlayers[uActiveCharacter]; 1154 v88 = pPlayers[uActiveCharacter];
1167 v115 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10 << 8)) << 8)) << 8); 1155 v115 = EVT_DWORD(_evt->v7);
1168 goto LABEL_234; 1156 goto LABEL_234;
1169 } 1157 }
1170 if ( v86 != 5 ) 1158 if ( v86 != 5 )
1171 { 1159 {
1172 v119 = _evt->v6; 1160 v119 = _evt->v6;
1173 v115 = _evt->v7 + ((_evt->v8 + ((_evt->v9 + ((uint)_evt->v10<< 8)) << 8)) << 8); 1161 v115 = EVT_DWORD(_evt->v7);
1174 v89 = rand() % 4; 1162 v89 = rand() % 4;
1175 LABEL_233: 1163 LABEL_233:
1176 v88 = &pParty->pPlayers[v89]; 1164 v88 = &pParty->pPlayers[v89];
1177 LABEL_234: 1165 LABEL_234:
1178 v88->ReceiveDamage(v115, v119); 1166 v88->ReceiveDamage(v115, v119);