Mercurial > mm7
comparison mm7_6.cpp @ 828:0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
author | Nomad |
---|---|
date | Wed, 27 Mar 2013 00:27:38 +0200 |
parents | fe4c8b113548 |
children | 08d90b633131 |
comparison
equal
deleted
inserted
replaced
824:fe4c8b113548 | 828:0f56abdcce94 |
---|---|
2487 int v30; // ecx@106 | 2487 int v30; // ecx@106 |
2488 //int v31; // eax@112 | 2488 //int v31; // eax@112 |
2489 //int v32; // eax@112 | 2489 //int v32; // eax@112 |
2490 //char *v33; // edx@113 | 2490 //char *v33; // edx@113 |
2491 //int v34; // eax@121 | 2491 //int v34; // eax@121 |
2492 int v35; // eax@123 | 2492 //int v35; // eax@123 |
2493 int v36; // edx@125 | 2493 //int v36; // edx@125 |
2494 //int v37; // eax@129 | 2494 //int v37; // eax@129 |
2495 signed int v38; // edi@129 | 2495 //signed int v38; // edi@129 |
2496 signed int v39; // eax@129 | 2496 //signed int v39; // eax@129 |
2497 int v40; // ecx@129 | 2497 //int v40; // ecx@129 |
2498 int v41; // eax@129 | 2498 //int v41; // eax@129 |
2499 signed int v42; // eax@129 | 2499 //signed int v42; // eax@129 |
2500 int *v43; // ecx@129 | 2500 //int *v43; // ecx@129 |
2501 //int v44; // eax@132 | 2501 //int v44; // eax@132 |
2502 int v45; // ecx@132 | 2502 //int v45; // ecx@132 |
2503 int v46; // eax@132 | 2503 int v46; // eax@132 |
2504 unsigned int v47; // edx@133 | 2504 //unsigned int v47; // edx@133 |
2505 int v48; // eax@137 | 2505 //int v48; // eax@137 |
2506 //int v49; // eax@137 | 2506 //int v49; // eax@137 |
2507 //int v50; // eax@141 | 2507 //int v50; // eax@141 |
2508 int v51; // eax@146 | 2508 int v51; // eax@146 |
2509 __int16 v52; // ax@153 | 2509 __int16 v52; // ax@153 |
2510 //int v53; // eax@153 | 2510 //int v53; // eax@153 |
2535 int v78; // ecx@225 | 2535 int v78; // ecx@225 |
2536 int v79; // eax@227 | 2536 int v79; // eax@227 |
2537 //int v80; // eax@232 | 2537 //int v80; // eax@232 |
2538 //__int16 v81; // ST18_2@245 | 2538 //__int16 v81; // ST18_2@245 |
2539 //stru6 *v82; // eax@245 | 2539 //stru6 *v82; // eax@245 |
2540 signed int v83; // edi@245 | 2540 //signed int v83; // edi@245 |
2541 //__int16 v84; // ST18_2@245 | 2541 //__int16 v84; // ST18_2@245 |
2542 //stru6 *v85; // eax@245 | 2542 //stru6 *v85; // eax@245 |
2543 //__int16 v86; // ST18_2@245 | 2543 //__int16 v86; // ST18_2@245 |
2544 //stru6 *v87; // eax@245 | 2544 //stru6 *v87; // eax@245 |
2545 //__int16 v88; // ST18_2@245 | 2545 //__int16 v88; // ST18_2@245 |
2572 unsigned int v115; // ecx@278 | 2572 unsigned int v115; // ecx@278 |
2573 int v116; // edx@279 | 2573 int v116; // edx@279 |
2574 int v117; // edx@281 | 2574 int v117; // edx@281 |
2575 int v118; // edx@283 | 2575 int v118; // edx@283 |
2576 int v119; // edi@286 | 2576 int v119; // edi@286 |
2577 int v120; // eax@286 | 2577 //int v120; // eax@286 |
2578 int v121; // eax@286 | 2578 //int v121; // eax@286 |
2579 signed int v122; // eax@286 | 2579 signed int v122; // eax@286 |
2580 int v123; // ecx@288 | 2580 int v123; // ecx@288 |
2581 int v124; // ecx@289 | 2581 int v124; // ecx@289 |
2582 int v125; // ecx@290 | 2582 int v125; // ecx@290 |
2583 int v126; // eax@292 | 2583 int v126; // eax@292 |
2604 //__int16 v147; // ST18_2@311 | 2604 //__int16 v147; // ST18_2@311 |
2605 //stru6 *v148; // eax@311 | 2605 //stru6 *v148; // eax@311 |
2606 int v149; // ecx@312 | 2606 int v149; // ecx@312 |
2607 int v150; // ecx@313 | 2607 int v150; // ecx@313 |
2608 int v151; // ecx@314 | 2608 int v151; // ecx@314 |
2609 signed int v152; // eax@322 | 2609 //signed int v152; // eax@322 |
2610 int v153; // ecx@322 | 2610 int v153; // ecx@322 |
2611 int v154; // eax@322 | 2611 int v154; // eax@322 |
2612 int v155; // eax@323 | 2612 int v155; // eax@323 |
2613 int v156; // eax@323 | 2613 int v156; // eax@323 |
2614 int v157; // eax@326 | 2614 int v157; // eax@326 |
2615 double v158; // st7@326 | 2615 double v158; // st7@326 |
2616 double v159; // st6@326 | 2616 double v159; // st6@326 |
2617 signed __int64 v160; // qtt@334 | 2617 signed __int64 v160; // qtt@334 |
2618 //int v161; // eax@339 | 2618 //int v161; // eax@339 |
2619 int v162; // edi@340 | 2619 int v162; // edi@340 |
2620 int v163; // eax@340 | 2620 //int v163; // eax@340 |
2621 signed int v164; // eax@340 | 2621 signed int v164; // eax@340 |
2622 signed int v165; // edi@340 | 2622 signed int v165; // edi@340 |
2623 //stru6 *v166; // eax@340 | 2623 //stru6 *v166; // eax@340 |
2624 //stru6 *v167; // eax@340 | 2624 //stru6 *v167; // eax@340 |
2625 signed int v168; // edi@343 | 2625 signed int v168; // edi@343 |
2691 //stru6 *v234; // eax@469 | 2691 //stru6 *v234; // eax@469 |
2692 //__int16 v235; // ST18_2@469 | 2692 //__int16 v235; // ST18_2@469 |
2693 //stru6 *v236; // eax@469 | 2693 //stru6 *v236; // eax@469 |
2694 //__int16 v237; // ST18_2@469 | 2694 //__int16 v237; // ST18_2@469 |
2695 //stru6 *v238; // eax@469 | 2695 //stru6 *v238; // eax@469 |
2696 __int16 v239; // ST1C_2@469 | 2696 //__int16 v239; // ST1C_2@469 |
2697 char *v240; // ecx@472 | 2697 char *v240; // ecx@472 |
2698 double v241; // st7@478 | 2698 double v241; // st7@478 |
2699 signed __int64 v242; // qax@484 | 2699 signed __int64 v242; // qax@484 |
2700 char *v243; // ecx@484 | 2700 char *v243; // ecx@484 |
2701 char *v244; // eax@488 | 2701 char *v244; // eax@488 |
2778 int v321; // ecx@630 | 2778 int v321; // ecx@630 |
2779 int v322; // edi@632 | 2779 int v322; // edi@632 |
2780 int v323; // edi@635 | 2780 int v323; // edi@635 |
2781 char *v324; // eax@635 | 2781 char *v324; // eax@635 |
2782 Player *v325; // ecx@640 | 2782 Player *v325; // ecx@640 |
2783 int v326; // eax@643 | 2783 //int v326; // eax@643 |
2784 //int v327; // eax@648 | 2784 //int v327; // eax@648 |
2785 int v328; // ecx@651 | 2785 int v328; // ecx@651 |
2786 int v329; // ecx@652 | 2786 int v329; // ecx@652 |
2787 int v330; // edi@654 | 2787 int v330; // edi@654 |
2788 //__int16 v331; // ST18_2@658 | 2788 //__int16 v331; // ST18_2@658 |
2822 int v365; // ecx@699 | 2822 int v365; // ecx@699 |
2823 int v366; // eax@701 | 2823 int v366; // eax@701 |
2824 //stru6 *v367; // eax@704 | 2824 //stru6 *v367; // eax@704 |
2825 //int v368; // eax@704 | 2825 //int v368; // eax@704 |
2826 Actor *v369; // edi@705 | 2826 Actor *v369; // edi@705 |
2827 int v370; // eax@706 | 2827 //int v370; // eax@706 |
2828 int v371; // ecx@709 | 2828 int v371; // ecx@709 |
2829 int v372; // ecx@710 | 2829 int v372; // ecx@710 |
2830 int v373; // eax@715 | 2830 int v373; // eax@715 |
2831 int v374; // eax@717 | 2831 int v374; // eax@717 |
2832 Player *v375; // edi@717 | 2832 Player *v375; // edi@717 |
2837 int v380; // eax@724 | 2837 int v380; // eax@724 |
2838 int v381; // edi@727 | 2838 int v381; // edi@727 |
2839 int v382; // ecx@727 | 2839 int v382; // ecx@727 |
2840 Player *v383; // eax@728 | 2840 Player *v383; // eax@728 |
2841 int v384; // eax@733 | 2841 int v384; // eax@733 |
2842 int v385; // edi@736 | 2842 //int v385; // edi@736 |
2843 signed int v386; // eax@736 | 2843 //signed int v386; // eax@736 |
2844 Player *v387; // edi@738 | 2844 //Player *v387; // edi@738 |
2845 int v388; // edi@740 | 2845 int v388; // edi@740 |
2846 //unsigned __int16 v389; // ST1C_2@740 | 2846 //unsigned __int16 v389; // ST1C_2@740 |
2847 //__int16 v390; // ST18_2@740 | 2847 //__int16 v390; // ST18_2@740 |
2848 //stru6 *v391; // eax@740 | 2848 //stru6 *v391; // eax@740 |
2849 int v392; // ecx@742 | 2849 int v392; // ecx@742 |
2879 const char *v422; // eax@801 | 2879 const char *v422; // eax@801 |
2880 int v423; // ecx@808 | 2880 int v423; // ecx@808 |
2881 int v424; // ecx@809 | 2881 int v424; // ecx@809 |
2882 int v425; // eax@811 | 2882 int v425; // eax@811 |
2883 signed int v426; // eax@815 | 2883 signed int v426; // eax@815 |
2884 signed int v427; // eax@820 | 2884 //signed int v427; // eax@820 |
2885 int v428; // ecx@825 | 2885 int v428; // ecx@825 |
2886 int v429; // ecx@826 | 2886 int v429; // ecx@826 |
2887 int v430; // eax@828 | 2887 int v430; // eax@828 |
2888 //stru6 *v431; // eax@831 | 2888 //stru6 *v431; // eax@831 |
2889 //int v432; // eax@831 | 2889 //int v432; // eax@831 |
2890 Actor *v433; // edi@832 | 2890 Actor *v433; // edi@832 |
2891 int v434; // eax@833 | 2891 //int v434; // eax@833 |
2892 int v435; // ecx@837 | 2892 int v435; // ecx@837 |
2893 int v436; // ecx@838 | 2893 int v436; // ecx@838 |
2894 //__int16 v437; // ST1C_2@843 | 2894 //__int16 v437; // ST1C_2@843 |
2895 //__int16 v438; // ST18_2@843 | 2895 //__int16 v438; // ST18_2@843 |
2896 //stru6 *v439; // eax@843 | 2896 //stru6 *v439; // eax@843 |
2960 //stru6 *v503; // eax@940 | 2960 //stru6 *v503; // eax@940 |
2961 //stru6 *v504; // eax@943 | 2961 //stru6 *v504; // eax@943 |
2962 int v505; // eax@943 | 2962 int v505; // eax@943 |
2963 //int v506; // eax@943 | 2963 //int v506; // eax@943 |
2964 int v507; // edi@944 | 2964 int v507; // edi@944 |
2965 int v508; // eax@944 | 2965 //int v508; // eax@944 |
2966 signed int v509; // eax@944 | 2966 signed int v509; // eax@944 |
2967 signed int v510; // edi@944 | 2967 signed int v510; // edi@944 |
2968 Actor *v511; // edi@946 | 2968 Actor *v511; // edi@946 |
2969 int v512; // eax@946 | 2969 //int v512; // eax@946 |
2970 SpellBuff *v513; // edi@946 | 2970 SpellBuff *v513; // edi@946 |
2971 int v514; // ecx@950 | 2971 int v514; // ecx@950 |
2972 int v515; // ecx@951 | 2972 int v515; // ecx@951 |
2973 int v516; // eax@953 | 2973 int v516; // eax@953 |
2974 int v517; // eax@956 | 2974 //int v517; // eax@956 |
2975 Actor *v518; // edx@957 | 2975 Actor *v518; // edx@957 |
2976 __int16 v519; // cx@958 | 2976 __int16 v519; // cx@958 |
2977 int v520; // ecx@968 | 2977 int v520; // ecx@968 |
2978 int v521; // ecx@969 | 2978 int v521; // ecx@969 |
2979 int v522; // eax@971 | 2979 int v522; // eax@971 |
2986 //__int16 v529; // ST18_2@975 | 2986 //__int16 v529; // ST18_2@975 |
2987 //stru6 *v530; // eax@975 | 2987 //stru6 *v530; // eax@975 |
2988 int v531; // eax@982 | 2988 int v531; // eax@982 |
2989 //int v532; // eax@982 | 2989 //int v532; // eax@982 |
2990 int v533; // edi@983 | 2990 int v533; // edi@983 |
2991 int v534; // eax@983 | 2991 //int v534; // eax@983 |
2992 signed int v535; // eax@983 | 2992 signed int v535; // eax@983 |
2993 signed int v536; // edi@983 | 2993 signed int v536; // edi@983 |
2994 stru6 *v537; // eax@984 | 2994 stru6 *v537; // eax@984 |
2995 int v538; // ecx@985 | 2995 int v538; // ecx@985 |
2996 int v539; // ecx@986 | 2996 int v539; // ecx@986 |
3034 Player *v577; // eax@1026 | 3034 Player *v577; // eax@1026 |
3035 int v578; // eax@1028 | 3035 int v578; // eax@1028 |
3036 __int16 v579; // ax@1029 | 3036 __int16 v579; // ax@1029 |
3037 //int v580; // eax@1031 | 3037 //int v580; // eax@1031 |
3038 int v581; // edi@1031 | 3038 int v581; // edi@1031 |
3039 int v582; // eax@1031 | 3039 //int v582; // eax@1031 |
3040 //__int16 v583; // ST1C_2@1034 | 3040 //__int16 v583; // ST1C_2@1034 |
3041 //__int16 v584; // ST18_2@1034 | 3041 //__int16 v584; // ST18_2@1034 |
3042 char *v585; // esi@1034 | 3042 char *v585; // esi@1034 |
3043 //stru6 *v586; // eax@1034 | 3043 //stru6 *v586; // eax@1034 |
3044 signed int v587; // eax@1035 | 3044 signed int v587; // eax@1035 |
3051 int v594; // ecx@1058 | 3051 int v594; // ecx@1058 |
3052 //int v595; // eax@1064 | 3052 //int v595; // eax@1064 |
3053 int v596; // esi@1066 | 3053 int v596; // esi@1066 |
3054 unsigned int v597; // edi@1067 | 3054 unsigned int v597; // edi@1067 |
3055 int v598; // eax@1079 | 3055 int v598; // eax@1079 |
3056 signed int v599; // eax@1082 | 3056 //signed int v599; // eax@1082 |
3057 int v600; // edi@1086 | 3057 int v600; // edi@1086 |
3058 int v601; // edx@1086 | 3058 int v601; // edx@1086 |
3059 int v602; // eax@1086 | 3059 int v602; // eax@1086 |
3060 int v603; // ecx@1086 | 3060 int v603; // ecx@1086 |
3061 //int v604; // eax@1087 | 3061 //int v604; // eax@1087 |
3078 //__int16 v621; // ST18_2@1124 | 3078 //__int16 v621; // ST18_2@1124 |
3079 //stru6 *v622; // eax@1124 | 3079 //stru6 *v622; // eax@1124 |
3080 signed __int64 v623; // qax@1127 | 3080 signed __int64 v623; // qax@1127 |
3081 //int v624; // eax@1127 | 3081 //int v624; // eax@1127 |
3082 int v625; // edi@1129 | 3082 int v625; // edi@1129 |
3083 int v626; // eax@1129 | 3083 //int v626; // eax@1129 |
3084 signed int v627; // eax@1129 | 3084 signed int v627; // eax@1129 |
3085 signed int v628; // edi@1129 | 3085 signed int v628; // edi@1129 |
3086 int v629; // ecx@1130 | 3086 int v629; // ecx@1130 |
3087 Player *v630; // eax@1131 | 3087 Player *v630; // eax@1131 |
3088 int v631; // eax@1137 | 3088 int v631; // eax@1137 |
3089 int v632; // edi@1140 | 3089 //int v632; // edi@1140 |
3090 Player *v633; // eax@1140 | 3090 //Player *v633; // eax@1140 |
3091 signed int v634; // eax@1140 | 3091 //signed int v634; // eax@1140 |
3092 int v635; // edi@1142 | 3092 int v635; // edi@1142 |
3093 //unsigned __int16 v636; // ST1C_2@1142 | 3093 //unsigned __int16 v636; // ST1C_2@1142 |
3094 //__int16 v637; // ST18_2@1142 | 3094 //__int16 v637; // ST18_2@1142 |
3095 //stru6 *v638; // eax@1142 | 3095 //stru6 *v638; // eax@1142 |
3096 //stru6 *v639; // eax@1143 | 3096 //stru6 *v639; // eax@1143 |
3106 //Player *v649; // ecx@1170 | 3106 //Player *v649; // ecx@1170 |
3107 //unsigned __int64 v650; // [sp-10h] [bp-E94h]@103 | 3107 //unsigned __int64 v650; // [sp-10h] [bp-E94h]@103 |
3108 //unsigned __int16 v651; // [sp-8h] [bp-E8Ch]@100 | 3108 //unsigned __int16 v651; // [sp-8h] [bp-E8Ch]@100 |
3109 //unsigned __int16 v652; // [sp-8h] [bp-E8Ch]@304 | 3109 //unsigned __int16 v652; // [sp-8h] [bp-E8Ch]@304 |
3110 //unsigned __int16 v653; // [sp-4h] [bp-E88h]@100 | 3110 //unsigned __int16 v653; // [sp-4h] [bp-E88h]@100 |
3111 int v654; // [sp-4h] [bp-E88h]@124 | 3111 //int v654; // [sp-4h] [bp-E88h]@124 |
3112 //unsigned __int16 v655; // [sp-4h] [bp-E88h]@304 | 3112 //unsigned __int16 v655; // [sp-4h] [bp-E88h]@304 |
3113 unsigned int v656; // [sp-4h] [bp-E88h]@639 | 3113 unsigned int v656; // [sp-4h] [bp-E88h]@639 |
3114 int v657; // [sp-4h] [bp-E88h]@807 | 3114 int v657; // [sp-4h] [bp-E88h]@807 |
3115 //int v658; // [sp+0h] [bp-E84h]@100 | 3115 //int v658; // [sp+0h] [bp-E84h]@100 |
3116 int v659; // [sp+0h] [bp-E84h]@123 | 3116 int v659; // [sp+0h] [bp-E84h]@123 |
3121 const char *v664; // [sp+0h] [bp-E84h]@802 | 3121 const char *v664; // [sp+0h] [bp-E84h]@802 |
3122 int v665; // [sp+0h] [bp-E84h]@807 | 3122 int v665; // [sp+0h] [bp-E84h]@807 |
3123 int v666; // [sp+4h] [bp-E80h]@12 | 3123 int v666; // [sp+4h] [bp-E80h]@12 |
3124 PLAYER_SKILL_TYPE v667; // [sp+4h] [bp-E80h]@25 | 3124 PLAYER_SKILL_TYPE v667; // [sp+4h] [bp-E80h]@25 |
3125 //unsigned __int8 v668; // [sp+4h] [bp-E80h]@100 | 3125 //unsigned __int8 v668; // [sp+4h] [bp-E80h]@100 |
3126 int v669; // [sp+4h] [bp-E80h]@123 | 3126 //int v669; // [sp+4h] [bp-E80h]@123 |
3127 Vec3_int_ *v670; // [sp+4h] [bp-E80h]@133 | 3127 //Vec3_int_ *v670; // [sp+4h] [bp-E80h]@133 |
3128 int v671; // [sp+4h] [bp-E80h]@146 | 3128 int v671; // [sp+4h] [bp-E80h]@146 |
3129 unsigned int v672; // [sp+4h] [bp-E80h]@164 | 3129 unsigned int v672; // [sp+4h] [bp-E80h]@164 |
3130 //unsigned __int8 v673; // [sp+4h] [bp-E80h]@304 | 3130 //unsigned __int8 v673; // [sp+4h] [bp-E80h]@304 |
3131 __int16 v674; // [sp+4h] [bp-E80h]@684 | 3131 //__int16 v674; // [sp+4h] [bp-E80h]@684 |
3132 const char *v675; // [sp+4h] [bp-E80h]@800 | 3132 const char *v675; // [sp+4h] [bp-E80h]@800 |
3133 int v676; // [sp+4h] [bp-E80h]@807 | 3133 int v676; // [sp+4h] [bp-E80h]@807 |
3134 int v677; // [sp+4h] [bp-E80h]@861 | 3134 int v677; // [sp+4h] [bp-E80h]@861 |
3135 int v678; // [sp+4h] [bp-E80h]@997 | 3135 int v678; // [sp+4h] [bp-E80h]@997 |
3136 int v679; // [sp+14h] [bp-E70h]@515 | 3136 int v679; // [sp+14h] [bp-E70h]@515 |
3140 ItemGen v683; // [sp+CD0h] [bp-1B4h]@791 | 3140 ItemGen v683; // [sp+CD0h] [bp-1B4h]@791 |
3141 int v684; // [sp+D04h] [bp-180h]@416 | 3141 int v684; // [sp+D04h] [bp-180h]@416 |
3142 unsigned __int64 v685; // [sp+D08h] [bp-17Ch]@416 | 3142 unsigned __int64 v685; // [sp+D08h] [bp-17Ch]@416 |
3143 int x; // [sp+D20h] [bp-164h]@327 | 3143 int x; // [sp+D20h] [bp-164h]@327 |
3144 unsigned __int64 v687; // [sp+D24h] [bp-160h]@327 | 3144 unsigned __int64 v687; // [sp+D24h] [bp-160h]@327 |
3145 int v688; // [sp+D2Ch] [bp-158h]@943 | 3145 Vec3_int_ v688; // [sp+D2Ch] [bp-158h]@943 |
3146 int v689; // [sp+D30h] [bp-154h]@943 | 3146 //int v689; // [sp+D30h] [bp-154h]@943 |
3147 int v690; // [sp+D34h] [bp-150h]@943 | 3147 //int v690; // [sp+D34h] [bp-150h]@943 |
3148 int v691; // [sp+D38h] [bp-14Ch]@137 | 3148 Vec3_int_ v691; // [sp+D38h] [bp-14Ch]@137 |
3149 int v692; // [sp+D3Ch] [bp-148h]@137 | 3149 //int v692; // [sp+D3Ch] [bp-148h]@137 |
3150 int v693; // [sp+D40h] [bp-144h]@137 | 3150 //int v693; // [sp+D40h] [bp-144h]@137 |
3151 int v694; // [sp+D44h] [bp-140h]@982 | 3151 Vec3_int_ v694; // [sp+D44h] [bp-140h]@982 |
3152 int v695; // [sp+D48h] [bp-13Ch]@982 | 3152 //int v695; // [sp+D48h] [bp-13Ch]@982 |
3153 int v696; // [sp+D4Ch] [bp-138h]@982 | 3153 //int v696; // [sp+D4Ch] [bp-138h]@982 |
3154 int v697; // [sp+D50h] [bp-134h]@129 | 3154 Vec3_int_ v697; // [sp+D50h] [bp-134h]@129 |
3155 int v698; // [sp+D54h] [bp-130h]@129 | 3155 //int v698; // [sp+D54h] [bp-130h]@129 |
3156 int v699; // [sp+D58h] [bp-12Ch]@129 | 3156 //int v699; // [sp+D58h] [bp-12Ch]@129 |
3157 Vec3_int_ v700; // [sp+D5Ch] [bp-128h]@339 | 3157 Vec3_int_ v700; // [sp+D5Ch] [bp-128h]@339 |
3158 int v701; // [sp+D68h] [bp-11Ch]@286 | 3158 Vec3_int_ v701; // [sp+D68h] [bp-11Ch]@286 |
3159 int v702; // [sp+D6Ch] [bp-118h]@286 | 3159 //int v702; // [sp+D6Ch] [bp-118h]@286 |
3160 int v703; // [sp+D70h] [bp-114h]@286 | 3160 //int v703; // [sp+D70h] [bp-114h]@286 |
3161 int v704; // [sp+D74h] [bp-110h]@132 | 3161 Vec3_int_ v704; // [sp+D74h] [bp-110h]@132 |
3162 int v705; // [sp+D78h] [bp-10Ch]@132 | 3162 //int v705; // [sp+D78h] [bp-10Ch]@132 |
3163 int v706; // [sp+D7Ch] [bp-108h]@132 | 3163 //int v706; // [sp+D7Ch] [bp-108h]@132 |
3164 int v707; // [sp+D80h] [bp-104h]@1127 | 3164 Vec3_int_ v707; // [sp+D80h] [bp-104h]@1127 |
3165 int v708; // [sp+D84h] [bp-100h]@1127 | 3165 //int v708; // [sp+D84h] [bp-100h]@1127 |
3166 int v709; // [sp+D88h] [bp-FCh]@1127 | 3166 //int v709; // [sp+D88h] [bp-FCh]@1127 |
3167 char v710; // [sp+D8Ch] [bp-F8h]@1156 | 3167 char v710; // [sp+D8Ch] [bp-F8h]@1156 |
3168 stru277 *v711; // [sp+D90h] [bp-F4h]@1 | 3168 stru277 *v711; // [sp+D90h] [bp-F4h]@1 |
3169 __int64 v712; // [sp+D94h] [bp-F0h]@991 | 3169 __int64 v712; // [sp+D94h] [bp-F0h]@991 |
3170 int v713; // [sp+D9Ch] [bp-E8h]@324 | 3170 int v713; // [sp+D9Ch] [bp-E8h]@324 |
3171 int n; // [sp+DA0h] [bp-E4h]@1 | 3171 int n; // [sp+DA0h] [bp-E4h]@1 |
3179 //SpriteObject a1; // [sp+DDCh] [bp-A8h]@1 | 3179 //SpriteObject a1; // [sp+DDCh] [bp-A8h]@1 |
3180 int v723; // [sp+E4Ch] [bp-38h]@1 | 3180 int v723; // [sp+E4Ch] [bp-38h]@1 |
3181 ItemGen *_this; // [sp+E50h] [bp-34h]@23 | 3181 ItemGen *_this; // [sp+E50h] [bp-34h]@23 |
3182 float v725; // [sp+E54h] [bp-30h]@23 | 3182 float v725; // [sp+E54h] [bp-30h]@23 |
3183 Player *v726; // [sp+E58h] [bp-2Ch]@131 | 3183 Player *v726; // [sp+E58h] [bp-2Ch]@131 |
3184 int v726b; | 3184 //int v726b; |
3185 float v727; // [sp+E5Ch] [bp-28h]@1 | 3185 float v727; // [sp+E5Ch] [bp-28h]@1 |
3186 unsigned int uRequiredMana; // [sp+E60h] [bp-24h]@53 | 3186 unsigned int uRequiredMana; // [sp+E60h] [bp-24h]@53 |
3187 Player *pPlayer; // [sp+E64h] [bp-20h]@8 | 3187 Player *pPlayer; // [sp+E64h] [bp-20h]@8 |
3188 int v730; // [sp+E68h] [bp-1Ch]@53 | 3188 int v730; // [sp+E68h] [bp-1Ch]@53 |
3189 Player *v730b; | 3189 Player *v730b; |
3236 else | 3236 else |
3237 v666 = 0; | 3237 v666 = 0; |
3238 | 3238 |
3239 a2 = stru_50C198.FindClosestActor(5120, 1, v666); | 3239 a2 = stru_50C198.FindClosestActor(5120, 1, v666); |
3240 v6 = pMouse->uPointingObjectID; | 3240 v6 = pMouse->uPointingObjectID; |
3241 if ( pMouse->uPointingObjectID && (v6 & 7) == OBJECT_Actor && pActors[v6 >> 3].CanAct() ) | 3241 if ( pMouse->uPointingObjectID && PID_TYPE(v6) == OBJECT_Actor && pActors[PID_ID(v6)].CanAct() ) |
3242 a2 = pMouse->uPointingObjectID; | 3242 a2 = pMouse->uPointingObjectID; |
3243 } | 3243 } |
3244 | 3244 |
3245 | 3245 |
3246 a1.uType = stru_4E3ACC[v3->spellnum].field_0; | 3246 a1.uType = stru_4E3ACC[v3->spellnum].field_0; |
3247 if (a1.uType) | 3247 if (a1.uType) |
3248 { | 3248 { |
3249 if ( (a2 & 7) == OBJECT_Actor) | 3249 if (PID_TYPE(a2) == OBJECT_Actor) |
3250 { | 3250 { |
3251 memcpy(&v715, Actor::GetDirectionInfo((8 * v3->uPlayerID + 8) | OBJECT_Player, a2, &a3, 0), sizeof(v715)); | 3251 memcpy(&v715, Actor::GetDirectionInfo(PID(OBJECT_Player, v3->uPlayerID + 8), a2, &a3, 0), sizeof(v715)); |
3252 v2 = v723; | 3252 v2 = v723; |
3253 } | 3253 } |
3254 else | 3254 else |
3255 { | 3255 { |
3256 v715.uYawAngle = pParty->sRotationY; | 3256 v715.uYawAngle = pParty->sRotationY; |
3311 { | 3311 { |
3312 v731 = 3; | 3312 v731 = 3; |
3313 } | 3313 } |
3314 } | 3314 } |
3315 | 3315 |
3316 v730 = v3->spellnum; | |
3317 if (v3->forced_spell_skill_level) | 3316 if (v3->forced_spell_skill_level) |
3318 uRequiredMana = 0; | 3317 uRequiredMana = 0; |
3319 else | 3318 else |
3320 uRequiredMana = pSpellDatas[v3->spellnum].mana_per_skill[v731 - 1]; | 3319 uRequiredMana = pSpellDatas[v3->spellnum].mana_per_skill[v731 - 1]; |
3321 sRecoveryTime = pSpellDatas[v3->spellnum].recovery_per_skill[v731 - 1]; | 3320 sRecoveryTime = pSpellDatas[v3->spellnum].recovery_per_skill[v731 - 1]; |
3326 | 3325 |
3327 if (v3->spellnum >= PLAYER_SKILL_BOW || pPlayer->sMana >= uRequiredMana) | 3326 if (v3->spellnum >= PLAYER_SKILL_BOW || pPlayer->sMana >= uRequiredMana) |
3328 break; | 3327 break; |
3329 | 3328 |
3330 ShowStatusBarString(pGlobalTXT_LocalizationStrings[586], 2u); // "Not enough spell points" | 3329 ShowStatusBarString(pGlobalTXT_LocalizationStrings[586], 2u); // "Not enough spell points" |
3331 LABEL_203: | |
3332 v3->spellnum = 0; | 3330 v3->spellnum = 0; |
3333 LABEL_1166: | 3331 LABEL_1166: |
3334 ++n; | 3332 ++n; |
3335 if ( n >= 10 ) | 3333 if ( n >= 10 ) |
3336 return; | 3334 return; |
3337 } | 3335 } |
3338 | 3336 |
3339 if (pPlayer->Cursed() && v730 < SPELL_BOW_ARROW) | 3337 v730 = v3->spellnum; |
3338 if (pPlayer->Cursed() && v3->spellnum < SPELL_BOW_ARROW) | |
3340 if (rand() % 100 < 50) | 3339 if (rand() % 100 < 50) |
3341 { | 3340 { |
3342 if ( pParty->bTurnBasedModeOn == 0 ) | 3341 if (!pParty->bTurnBasedModeOn) |
3343 { | 3342 { |
3344 //v646 = pPlayer; | 3343 //v646 = pPlayer; |
3345 pPlayer->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * 213.3333333333333)); | 3344 pPlayer->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * 213.3333333333333)); |
3346 //v647 = n; | 3345 //v647 = n; |
3347 } | 3346 } |
3462 | 3461 |
3463 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 3462 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
3464 goto play_sound_and_continue; | 3463 goto play_sound_and_continue; |
3465 | 3464 |
3466 pParty->pPartyBuffs[PARTY_BUFF_TORCHLIGHT].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)3600 * v2 * 4.2666669), v731, amount, 0, 0); | 3465 pParty->pPartyBuffs[PARTY_BUFF_TORCHLIGHT].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)3600 * v2 * 4.2666669), v731, amount, 0, 0); |
3467 goto LABEL_1056; | 3466 LODWORD(v727) = 1; |
3467 goto play_sound_and_continue; | |
3468 | 3468 |
3469 case SPELL_FIRE_FIRE_SPIKE: | 3469 case SPELL_FIRE_FIRE_SPIKE: |
3470 { | |
3470 v29 = v731 - 2; | 3471 v29 = v731 - 2; |
3471 if ( v29 ) | 3472 if ( v29 ) |
3472 { | 3473 { |
3473 v30 = v29 - 1; | 3474 v30 = v29 - 1; |
3474 if ( v30 ) | 3475 if ( v30 ) |
3490 //v31 = v3->uPlayerID; | 3491 //v31 = v3->uPlayerID; |
3491 //v32 = 8 * v31; | 3492 //v32 = 8 * v31; |
3492 //LOBYTE(v32) = v32 | OBJECT_Player; | 3493 //LOBYTE(v32) = v32 | OBJECT_Player; |
3493 | 3494 |
3494 //if ( (signed int)uNumSpriteObjects > 0 ) | 3495 //if ( (signed int)uNumSpriteObjects > 0 ) |
3495 HIDWORD(v733) = 0; | 3496 int _v733 = 0; |
3496 for (uint i = 0; i < uNumSpriteObjects; ++i) | 3497 for (uint i = 0; i < uNumSpriteObjects; ++i) |
3497 { | 3498 { |
3498 auto object = pSpriteObjects + i; | 3499 auto object = pSpriteObjects + i; |
3499 if (object->uType && object->spell_id == SPELL_FIRE_FIRE_SPIKE && object->spell_caster_pid == (8 * (int)v3->uPlayerID) | OBJECT_Player) | 3500 if (object->uType && object->spell_id == SPELL_FIRE_FIRE_SPIKE && object->spell_caster_pid == PID(OBJECT_Player, v3->uPlayerID)) |
3500 ++HIDWORD(v733); | 3501 ++_v733; |
3501 /*v33 = (char *)&pSpriteObjects[0].field_48; | 3502 /*v33 = (char *)&pSpriteObjects[0].field_48; |
3502 v730 = uNumSpriteObjects; | 3503 v730 = uNumSpriteObjects; |
3503 do | 3504 do |
3504 { | 3505 { |
3505 if ( *((short *)v33 - 36) && *(int *)v33 == 7 && *((int *)v33 + 4) == v32 ) | 3506 if ( *((short *)v33 - 36) && *(int *)v33 == 7 && *((int *)v33 + 4) == v32 ) |
3507 v33 += 112; | 3508 v33 += 112; |
3508 --v730; | 3509 --v730; |
3509 } | 3510 } |
3510 while ( v730 );*/ | 3511 while ( v730 );*/ |
3511 } | 3512 } |
3512 if ( SHIDWORD(v733) > amount ) | 3513 if (_v733 > amount) |
3513 { | 3514 { |
3514 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed | 3515 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed |
3515 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | 3516 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
3516 goto LABEL_203; | 3517 v3->spellnum = 0; |
3518 goto LABEL_1166; | |
3517 } | 3519 } |
3518 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 3520 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
3519 goto play_sound_and_continue; | 3521 goto play_sound_and_continue; |
3520 | 3522 |
3521 a1.stru_24.Reset(); | 3523 a1.stru_24.Reset(); |
3537 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | 3539 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); |
3538 a1.uFacing = LOWORD(v715.uYawAngle); | 3540 a1.uFacing = LOWORD(v715.uYawAngle); |
3539 a1.uSoundID = LOWORD(v3->sound_id); | 3541 a1.uSoundID = LOWORD(v3->sound_id); |
3540 if ( pParty->bTurnBasedModeOn == 1 ) | 3542 if ( pParty->bTurnBasedModeOn == 1 ) |
3541 LOBYTE(a1.uAttributes) |= 4u; | 3543 LOBYTE(a1.uAttributes) |= 4u; |
3542 v669 = v3->uPlayerID + 1; | |
3543 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | 3544 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; |
3544 v35 = pParty->sRotationX + 10; | 3545 if ( a1.Create(pParty->sRotationY, pParty->sRotationX + 10, v659, v3->uPlayerID + 1) != -1 && pParty->bTurnBasedModeOn == 1 ) |
3545 goto LABEL_124; | 3546 ++pTurnEngine->field_1C; |
3547 LODWORD(v727) = 1; | |
3548 goto play_sound_and_continue; | |
3549 } | |
3546 | 3550 |
3547 case 20: | 3551 case 20: |
3552 { | |
3548 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 3553 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
3549 goto play_sound_and_continue; | 3554 goto play_sound_and_continue; |
3550 if (!a2) | 3555 if (!a2) |
3551 { | 3556 { |
3552 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed | 3557 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed |
3553 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | 3558 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
3554 goto LABEL_203; | 3559 v3->spellnum = 0; |
3555 } | 3560 goto LABEL_1166; |
3556 if ( (a2 & 7) != OBJECT_Actor) | 3561 } |
3557 goto LABEL_1056; | 3562 if (PID_TYPE(a2) != OBJECT_Actor) |
3558 v699 = 0; | 3563 { |
3559 v698 = 0; | 3564 LODWORD(v727) = 1; |
3560 v697 = 0; | 3565 goto play_sound_and_continue; |
3566 } | |
3567 v697.x = 0; | |
3568 v697.y = 0; | |
3569 v697.z = 0; | |
3561 a1.stru_24.Reset(); | 3570 a1.stru_24.Reset(); |
3562 a1.spell_id = v3->spellnum; | 3571 a1.spell_id = v3->spellnum; |
3563 a1.spell_level = v2; | 3572 a1.spell_level = v2; |
3564 a1.spell_skill = v731; | 3573 a1.spell_skill = v731; |
3565 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); | 3574 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
3567 a1.uSectorID = 0; | 3576 a1.uSectorID = 0; |
3568 a1.uSpriteFrameID = 0; | 3577 a1.uSpriteFrameID = 0; |
3569 a1.field_60_distance_related_prolly_lod = 0; | 3578 a1.field_60_distance_related_prolly_lod = 0; |
3570 a1.uFacing = 0; | 3579 a1.uFacing = 0; |
3571 a1.spell_caster_pid = PID(OBJECT_Player, v3->uPlayerID); | 3580 a1.spell_caster_pid = PID(OBJECT_Player, v3->uPlayerID); |
3572 v38 = a2 >> 3; | |
3573 a1.uSoundID = LOWORD(v3->sound_id); | 3581 a1.uSoundID = LOWORD(v3->sound_id); |
3574 v39 = a2 >> 3; | 3582 a1.vPosition.x = pActors[PID_ID(a2)].vPosition.x; |
3575 a1.vPosition.x = pActors[v39].vPosition.x; | 3583 a1.vPosition.z = pActors[PID_ID(a2)].vPosition.z; |
3576 v40 = pActors[v39].vPosition.y; | 3584 a1.vPosition.y = pActors[PID_ID(a2)].vPosition.y; |
3577 a1.vPosition.z = pActors[v39].vPosition.z; | 3585 a1.spell_target_pid = PID(OBJECT_Actor, a2 >> 3); |
3578 v41 = 8 * (a2 >> 3); | 3586 auto obj_id = a1.Create(0, 0, 0, 0); |
3579 a1.vPosition.y = v40; | 3587 DamageMonsterFromParty(PID(OBJECT_Item, obj_id), PID_ID(a2), &v697); |
3580 LOBYTE(v41) = v41 | OBJECT_Actor; | 3588 LODWORD(v727) = 1; |
3581 a1.spell_target_pid = v41; | 3589 goto play_sound_and_continue; |
3582 v42 = a1.Create(0, 0, 0, 0); | 3590 } |
3583 v43 = &v697; | 3591 |
3584 goto LABEL_133; | |
3585 case 44: | 3592 case 44: |
3593 { | |
3586 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 3594 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
3587 goto play_sound_and_continue; | 3595 goto play_sound_and_continue; |
3588 v726 = (Player *)(a2 >> 3); | 3596 |
3589 HIDWORD(v733) = 836 * (a2 >> 3); | |
3590 if ( !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 3u) ) | 3597 if ( !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 3u) ) |
3591 goto LABEL_1056; | 3598 { |
3592 pActors[a2 >> 3].pActorBuffs[10].Apply( | 3599 LODWORD(v727) = 1; |
3593 pMiscTimer->uTotalGameTimeElapsed + 128, 0, 0, 0, 0); | 3600 goto play_sound_and_continue; |
3594 v706 = 0; | 3601 } |
3595 v705 = 0; | 3602 pActors[a2 >> 3].pActorBuffs[10].Apply(pMiscTimer->uTotalGameTimeElapsed + 128, 0, 0, 0, 0); |
3596 v704 = 0; | 3603 v704.x = 0; |
3604 v704.y = 0; | |
3605 v704.z = 0; | |
3597 a1.stru_24.Reset(); | 3606 a1.stru_24.Reset(); |
3598 a1.spell_id = v3->spellnum; | 3607 a1.spell_id = v3->spellnum; |
3599 a1.spell_level = v2; | 3608 a1.spell_level = v2; |
3600 a1.spell_skill = v731; | 3609 a1.spell_skill = v731; |
3601 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); | 3610 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
3602 a1.uAttributes = 0; | 3611 a1.uAttributes = 0; |
3603 a1.uSectorID = 0; | 3612 a1.uSectorID = 0; |
3604 a1.uSpriteFrameID = 0; | 3613 a1.uSpriteFrameID = 0; |
3605 a1.field_60_distance_related_prolly_lod = 0; | 3614 a1.field_60_distance_related_prolly_lod = 0; |
3606 a1.uFacing = 0; | 3615 a1.uFacing = 0; |
3607 v38 = (signed int)v726; | |
3608 a1.spell_caster_pid = PID(OBJECT_Player, v3->uPlayerID); | 3616 a1.spell_caster_pid = PID(OBJECT_Player, v3->uPlayerID); |
3609 a1.uSoundID = LOWORD(v3->sound_id); | 3617 a1.uSoundID = LOWORD(v3->sound_id); |
3610 a1.vPosition.x = *(__int16 *)((char *)&pActors[0].vPosition.x + HIDWORD(v733)); | 3618 a1.vPosition.x = pActors[PID_ID(a2)].vPosition.x; |
3611 v45 = *(__int16 *)((char *)&pActors[0].vPosition.y + HIDWORD(v733)); | 3619 a1.vPosition.y = pActors[PID_ID(a2)].vPosition.y; |
3612 a1.vPosition.z = *(__int16 *)((char *)&pActors[0].vPosition.z + HIDWORD(v733)); | 3620 a1.vPosition.z = pActors[PID_ID(a2)].vPosition.z; |
3613 a1.vPosition.y = v45; | |
3614 a1.spell_target_pid = PID(OBJECT_Actor, (int)v726); | 3621 a1.spell_target_pid = PID(OBJECT_Actor, (int)v726); |
3615 v42 = a1.Create(0, 0, 0, 0); | 3622 |
3616 v43 = &v704; | 3623 auto obj_id = a1.Create(0, 0, 0, 0); |
3617 LABEL_133: | 3624 DamageMonsterFromParty(PID(OBJECT_Item, obj_id), PID_ID(a2), &v704); |
3618 v670 = (Vec3_int_ *)v43; | 3625 |
3619 v47 = v38; | 3626 LODWORD(v727) = 1; |
3620 goto LABEL_139; | 3627 goto play_sound_and_continue; |
3628 } | |
3629 | |
3621 case 79: | 3630 case 79: |
3622 if ( !pPlayer->CanCastSpell(uRequiredMana) || !a2 || (a2 & 7) != OBJECT_Actor) | 3631 { |
3623 goto play_sound_and_continue; | 3632 if ( !pPlayer->CanCastSpell(uRequiredMana) || !a2 || PID_TYPE(a2) != OBJECT_Actor) |
3624 v730 = a2 >> 3; | 3633 goto play_sound_and_continue; |
3625 v693 = 0; | 3634 //v730 = a2 >> 3; |
3626 HIDWORD(v733) = (int)&pActors[a2 >> 3]; | 3635 //HIDWORD(v733) = (int)&pActors[PID_ID(a2)]; |
3627 v692 = 0; | 3636 v691.x = 0; |
3628 v691 = 0; | 3637 v691.y = 0; |
3638 v691.z = 0; | |
3629 a1.stru_24.Reset(); | 3639 a1.stru_24.Reset(); |
3630 a1.spell_id = v3->spellnum; | 3640 a1.spell_id = v3->spellnum; |
3631 a1.spell_level = v2; | 3641 a1.spell_level = v2; |
3632 a1.spell_skill = v731; | 3642 a1.spell_skill = v731; |
3633 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); | 3643 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
3634 a1.vPosition.x = *(short *)(HIDWORD(v733) + 142); | 3644 a1.vPosition.x = pActors[PID_ID(a2)].vPosition.x; |
3635 a1.vPosition.y = *(short *)(HIDWORD(v733) + 144); | 3645 a1.vPosition.y = pActors[PID_ID(a2)].vPosition.y; |
3636 v48 = *(short *)(HIDWORD(v733) + 138); | 3646 a1.vPosition.z = pActors[PID_ID(a2)].vPosition.z; |
3637 a1.vPosition.z = *(short *)(HIDWORD(v733) + 138); | |
3638 a1.uAttributes = 0; | 3647 a1.uAttributes = 0; |
3639 a1.uSectorID = pIndoor->GetSector(a1.vPosition.x, a1.vPosition.y, v48); | 3648 a1.uSectorID = pIndoor->GetSector(a1.vPosition.x, a1.vPosition.y, a1.vPosition.z); |
3640 a1.uSpriteFrameID = 0; | 3649 a1.uSpriteFrameID = 0; |
3641 a1.spell_caster_pid = PID(OBJECT_Player, v3->uPlayerID); | 3650 a1.spell_caster_pid = PID(OBJECT_Player, v3->uPlayerID); |
3642 a1.spell_target_pid = a2; | 3651 a1.spell_target_pid = a2; |
3643 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | 3652 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); |
3644 a1.uFacing = LOWORD(v715.uYawAngle); | 3653 a1.uFacing = LOWORD(v715.uYawAngle); |
3645 LOBYTE(a1.uAttributes) |= 0x80u; | 3654 a1.uAttributes |= 0x80u; |
3646 a1.uSoundID = LOWORD(v3->sound_id); | 3655 a1.uSoundID = LOWORD(v3->sound_id); |
3647 v726 = (Player *)a1.Create(0, 0, 0, 0); | 3656 |
3657 auto obj_id = a1.Create(0, 0, 0, 0); | |
3648 if ( !MonsterStats::BelongsToSupertype(*(short *)(HIDWORD(v733) + 96), MONSTER_SUPERTYPE_UNDEAD) ) | 3658 if ( !MonsterStats::BelongsToSupertype(*(short *)(HIDWORD(v733) + 96), MONSTER_SUPERTYPE_UNDEAD) ) |
3649 { | 3659 { |
3650 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed | 3660 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed |
3651 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | 3661 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
3652 goto LABEL_203; | 3662 v3->spellnum = 0; |
3653 } | 3663 goto LABEL_1166; |
3654 v47 = v730; | 3664 } |
3655 v670 = (Vec3_int_ *)&v691; | 3665 DamageMonsterFromParty(PID(OBJECT_Item, obj_id), PID_ID(a2), &v691); |
3656 v42 = (signed int)v726; | 3666 LODWORD(v727) = 1; |
3657 LABEL_139: | 3667 goto play_sound_and_continue; |
3658 DamageMonsterFromParty(8 * v42 | 2, v47, v670); | 3668 } |
3659 goto LABEL_1056; | |
3660 | 3669 |
3661 | 3670 |
3662 case SPELL_FIRE_FIRE_BOLT: | 3671 case SPELL_FIRE_FIRE_BOLT: |
3663 case SPELL_FIRE_FIREBALL: | 3672 case SPELL_FIRE_FIREBALL: |
3664 case SPELL_FIRE_INCINERATE: | 3673 case SPELL_FIRE_INCINERATE: |
3688 pParty->vPosition.y, | 3697 pParty->vPosition.y, |
3689 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | 3698 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); |
3690 else a1.uSectorID = 0; | 3699 else a1.uSectorID = 0; |
3691 | 3700 |
3692 a1.uSpriteFrameID = 0; | 3701 a1.uSpriteFrameID = 0; |
3693 a1.spell_caster_pid = (8 * v3->uPlayerID) | OBJECT_Player; | 3702 a1.spell_caster_pid = PID(OBJECT_Player, v3->uPlayerID); |
3694 a1.spell_target_pid = a2; | 3703 a1.spell_target_pid = a2; |
3695 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | 3704 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); |
3696 a1.uFacing = LOWORD(v715.uYawAngle); | 3705 a1.uFacing = LOWORD(v715.uYawAngle); |
3697 a1.uSoundID = LOWORD(v3->sound_id); | 3706 a1.uSoundID = LOWORD(v3->sound_id); |
3698 if ( pParty->bTurnBasedModeOn == 1 ) | 3707 if ( pParty->bTurnBasedModeOn == 1 ) |
3699 LOBYTE(a1.uAttributes) |= 4u; | 3708 LOBYTE(a1.uAttributes) |= 4u; |
3700 if ( v3->spellnum == 18 ) | 3709 if ( v3->spellnum == SPELL_AIR_LIGHNING_BOLT ) |
3701 LOBYTE(a1.uAttributes) |= 0x40u; | 3710 LOBYTE(a1.uAttributes) |= 0x40u; |
3702 goto LABEL_156; | 3711 |
3712 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
3713 if ( a1.Create(v715.uYawAngle, v715.uPitchAngle, v659, v3->uPlayerID + 1) != -1 && pParty->bTurnBasedModeOn == 1 ) | |
3714 ++pTurnEngine->field_1C; | |
3715 LODWORD(v727) = 1; | |
3716 goto play_sound_and_continue; | |
3703 | 3717 |
3704 | 3718 |
3705 | 3719 |
3706 case 29: | 3720 case 29: |
3707 case 39: | 3721 case 39: |
3723 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor | 3737 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor |
3724 || uCurrentlyLoadedLevelType == LEVEL_Outdoor && (pParty->uCurrentHour < 5 || pParty->uCurrentHour >= 0x15) ) | 3738 || uCurrentlyLoadedLevelType == LEVEL_Outdoor && (pParty->uCurrentHour < 5 || pParty->uCurrentHour >= 0x15) ) |
3725 { | 3739 { |
3726 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed | 3740 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed |
3727 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | 3741 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
3728 goto LABEL_203; | 3742 v3->spellnum = 0; |
3743 goto LABEL_1166; | |
3729 } | 3744 } |
3730 if ( pPlayer->CanCastSpell(uRequiredMana) ) | 3745 if ( pPlayer->CanCastSpell(uRequiredMana) ) |
3731 goto LABEL_152; | 3746 goto LABEL_152; |
3732 goto play_sound_and_continue; | 3747 goto play_sound_and_continue; |
3748 | |
3749 | |
3733 case 81: | 3750 case 81: |
3751 { | |
3734 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 3752 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
3735 goto play_sound_and_continue; | 3753 goto play_sound_and_continue; |
3736 if ( !a2 | 3754 |
3737 || (a2 & 7) != OBJECT_Actor | 3755 if (PID_TYPE(a2) != OBJECT_Actor || |
3738 || (v730 = a2 >> 3, | 3756 (v730 = PID_ID(a2), |
3739 v721 = (int)&pActors[a2 >> 3], | 3757 v721 = (int)&pActors[PID_ID(a2)], |
3740 !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 9u)) ) | 3758 !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 9u)) ) |
3741 goto LABEL_1056; | 3759 { |
3742 Actor::AI_Stand(v730, 4u, 0x80u, 0); | 3760 LODWORD(v727) = 1; |
3743 v726 = (Player *)(23040 * v2); | 3761 goto play_sound_and_continue; |
3762 } | |
3763 Actor::AI_Stand(PID_ID(a2), 4u, 0x80u, 0); | |
3744 v54 = (signed __int64)((double)(23040 * v2) * 0.033333335); | 3764 v54 = (signed __int64)((double)(23040 * v2) * 0.033333335); |
3745 v55 = v721; | 3765 v55 = v721; |
3746 ((SpellBuff *)(v721 + 308))->Apply(pParty->uTimePlayed + (signed int)v54, v731, 0, 0, 0); | 3766 ((SpellBuff *)(v721 + 308))->Apply(pParty->uTimePlayed + (signed int)v54, v731, 0, 0, 0); |
3747 *(char *)(v55 + 38) |= 8u; | 3767 *(char *)(v55 + 38) |= 8u; |
3748 *(short *)(v55 + 148) = 0; | 3768 *(short *)(v55 + 148) = 0; |
3749 v672 = 0; | 3769 v672 = 0; |
3750 *(short *)(v55 + 150) = 0; | 3770 *(short *)(v55 + 150) = 0; |
3751 v661 = (Actor *)v55; | 3771 v661 = (Actor *)v55; |
3752 goto LABEL_165; | 3772 goto LABEL_165; |
3773 } | |
3774 | |
3753 case 35: | 3775 case 35: |
3754 if ( v731 == 2 ) | 3776 if ( v731 == 2 ) |
3755 { | 3777 { |
3756 v57 = 300 * v2; | 3778 v57 = 300 * v2; |
3757 } | 3779 } |
3774 amount = 2; | 3796 amount = 2; |
3775 LABEL_174: | 3797 LABEL_174: |
3776 LODWORD(v733) = v57; | 3798 LODWORD(v733) = v57; |
3777 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 3799 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
3778 goto play_sound_and_continue; | 3800 goto play_sound_and_continue; |
3779 if ( (a2 & 7) != OBJECT_Actor | 3801 if (PID_TYPE(a2) != OBJECT_Actor |
3780 || (v721 = 836 * (a2 >> 3), | 3802 || (v721 = 836 * PID_ID(a2), |
3781 LODWORD(v718) = (int)&pActors[a2 >> 3], | 3803 LODWORD(v718) = (int)&pActors[PID_ID(a2)], |
3782 !stru_50C198.GetMagicalResistance(&pActors[a2 >> 3], 3u)) ) | 3804 !stru_50C198.GetMagicalResistance(&pActors[PID_ID(a2)], 3u)) ) |
3783 goto LABEL_1056; | 3805 { |
3784 v726 = (Player *)(23040 * v2); | 3806 LODWORD(v727) = 1; |
3807 goto play_sound_and_continue; | |
3808 } | |
3785 v58 = (signed __int64)((double)(23040 * v2) * 0.033333335); | 3809 v58 = (signed __int64)((double)(23040 * v2) * 0.033333335); |
3786 v59 = v721; | 3810 v59 = v721; |
3787 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[7] + v721))->Apply( | 3811 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[7] + v721))->Apply( |
3788 pActors[a2 >> 3].pActorBuffs[7].Apply( | 3812 pActors[a2 >> 3].pActorBuffs[7].Apply(pParty->uTimePlayed + (signed int)v58, |
3789 pParty->uTimePlayed + (signed int)v58, | |
3790 v731, | 3813 v731, |
3791 amount, | 3814 amount, |
3792 0, | 3815 0, |
3793 0); | 3816 0); |
3794 *((char *)&pActors[0].uAttributes + v59 + 2) |= 8u; | 3817 *((char *)&pActors[0].uAttributes + v59 + 2) |= 8u; |
3795 v672 = 0; | 3818 v672 = 0; |
3796 v661 = (Actor *)LODWORD(v718); | 3819 v661 = (Actor *)LODWORD(v718); |
3797 goto LABEL_165; | 3820 goto LABEL_165; |
3821 | |
3822 | |
3798 case 60: | 3823 case 60: |
3824 { | |
3799 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 3825 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
3800 goto play_sound_and_continue; | 3826 goto play_sound_and_continue; |
3801 v730 = 836 * (a2 >> 3); | 3827 |
3802 if ( !stru_50C198.GetMagicalResistance(&pActors[a2>>3], 7u) ) | 3828 if ( !stru_50C198.GetMagicalResistance(&pActors[PID_ID(a2)], 7u) ) |
3803 goto LABEL_1056; | 3829 { |
3804 LODWORD(v733) = 300 * v2; | 3830 LODWORD(v727) = 1; |
3831 goto play_sound_and_continue; | |
3832 } | |
3833 | |
3834 uint power = 300 * v2; | |
3805 if ( v731 == 2 ) | 3835 if ( v731 == 2 ) |
3806 { | 3836 { |
3807 LODWORD(v733) = 600 * v2; | 3837 power = 600 * v2; |
3808 } | 3838 } |
3809 else | 3839 else if ( v731 == 3 ) |
3810 { | 3840 power = 29030400; |
3811 if ( v731 == 3 ) | 3841 |
3812 LODWORD(v733) = 29030400; | |
3813 } | |
3814 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[9] + v730))->Reset(); | 3842 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[9] + v730))->Reset(); |
3815 pActors[a2 >> 3].pActorBuffs[9].Reset(); | 3843 pActors[PID_ID(a2)].pActorBuffs[9].Reset(); |
3816 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[12] + v730))->Reset(); | 3844 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[12] + v730))->Reset(); |
3817 pActors[a2 >> 3].pActorBuffs[12].Reset(); | 3845 pActors[PID_ID(a2)].pActorBuffs[12].Reset(); |
3818 v726 = (Player *)((int)v733 << 7); | |
3819 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[1] + v730))->Apply( | 3846 //((SpellBuff *)((char *)&pActors[0].pActorBuffs[1] + v730))->Apply( |
3820 pActors[a2 >> 3].pActorBuffs[1].Apply( | 3847 pActors[PID_ID(a2)].pActorBuffs[1].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)(power << 7) * 0.033333335), |
3821 pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), | |
3822 v731, 0, 0, 0); | 3848 v731, 0, 0, 0); |
3823 a1.stru_24.Reset(); | 3849 a1.stru_24.Reset(); |
3824 a1.spell_id = v3->spellnum; | 3850 a1.spell_id = v3->spellnum; |
3825 a1.spell_level = v2; | 3851 a1.spell_level = v2; |
3826 a1.spell_skill = v731; | 3852 a1.spell_skill = v731; |
3827 v60 = pObjectList->ObjectIDByItemID(a1.uType); | 3853 v60 = pObjectList->ObjectIDByItemID(a1.uType); |
3828 v61 = a2 >> 3; | 3854 v61 = a2 >> 3; |
3829 goto LABEL_1086; | 3855 goto LABEL_1086; |
3856 } | |
3857 | |
3830 case 92: | 3858 case 92: |
3831 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 3859 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
3832 goto play_sound_and_continue; | 3860 goto play_sound_and_continue; |
3833 a1.stru_24.Reset(); | 3861 a1.stru_24.Reset(); |
3834 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); | 3862 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
3847 a1.uFacing = LOWORD(v715.uYawAngle); | 3875 a1.uFacing = LOWORD(v715.uYawAngle); |
3848 a1.uSoundID = LOWORD(v3->sound_id); | 3876 a1.uSoundID = LOWORD(v3->sound_id); |
3849 a1.spell_skill = v731; | 3877 a1.spell_skill = v731; |
3850 a1.spell_id = SPELL_FIRE_PROTECTION_FROM_FIRE; | 3878 a1.spell_id = SPELL_FIRE_PROTECTION_FROM_FIRE; |
3851 a1.spell_level = 300 * v2; | 3879 a1.spell_level = 300 * v2; |
3852 goto LABEL_154; | 3880 if ( pParty->bTurnBasedModeOn == 1 ) |
3881 LOBYTE(a1.uAttributes) |= 4u; | |
3882 | |
3883 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | |
3884 | |
3885 if ( a1.Create(v715.uYawAngle, v715.uPitchAngle, v659, v3->uPlayerID + 1) != -1 && pParty->bTurnBasedModeOn == 1 ) | |
3886 ++pTurnEngine->field_1C; | |
3887 LODWORD(v727) = 1; | |
3888 goto play_sound_and_continue; | |
3889 | |
3853 case 4: | 3890 case 4: |
3891 { | |
3854 v63 = v731 - 1; | 3892 v63 = v731 - 1; |
3855 if ( !v63 ) | 3893 if ( !v63 ) |
3856 { | 3894 { |
3857 amount = 10; | 3895 amount = 10; |
3858 goto LABEL_195; | 3896 goto LABEL_195; |
3878 } | 3916 } |
3879 LABEL_196: | 3917 LABEL_196: |
3880 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 3918 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
3881 goto play_sound_and_continue; | 3919 goto play_sound_and_continue; |
3882 v730c = &pParty->pPlayers[v3->uPlayerID_2].pInventoryItems[a2]; | 3920 v730c = &pParty->pPlayers[v3->uPlayerID_2].pInventoryItems[a2]; |
3883 v726 = (Player *)&pItemsTable->pItems[v730c->uItemID].pIconName; | 3921 auto _itm = &pItemsTable->pItems[v730c->uItemID]; |
3884 v730c->UpdateTempBonus(pParty->uTimePlayed); | 3922 v730c->UpdateTempBonus(pParty->uTimePlayed); |
3885 if ( v730c->uItemID < 64 || v730c->uItemID > 65 ) | 3923 if ( v730c->uItemID < 64 || v730c->uItemID > 65 ) |
3886 { | 3924 { |
3887 if (!v730c->Broken()) | 3925 if (!v730c->Broken()) |
3888 { | 3926 { |
3889 if (!v730c->uSpecEnchantmentType) | 3927 if (!v730c->uSpecEnchantmentType) |
3890 { | 3928 { |
3891 if (!v730c->uEnchantmentType) | 3929 if (!v730c->uEnchantmentType) |
3892 { | 3930 { |
3893 v68 = BYTE4(v726->pConditions[3]); | 3931 v68 = _itm->uEquipType; |
3894 if ( !v68 || v68 == 1 || v68 == 2 ) | 3932 if ( !v68 || v68 == 1 || v68 == 2 ) |
3895 { | 3933 { |
3896 if ( !pItemsTable->IsMaterialNonCommon(v730c) ) | 3934 if ( !pItemsTable->IsMaterialNonCommon(v730c) ) |
3897 { | 3935 { |
3898 v69 = v730c; | 3936 v69 = v730c; |
3899 v14 = v731 == 4; | 3937 v14 = v731 == 4; |
3900 *(int *)(v730 + 12) = amount; | 3938 *(int *)(v730 + 12) = amount; |
3901 if ( !v14 ) | 3939 if ( !v14 ) |
3902 { | 3940 { |
3903 v726 = (Player *)((int)v733 << 7); | |
3904 *(_QWORD *)(v69 + 28) = pParty->uTimePlayed | 3941 *(_QWORD *)(v69 + 28) = pParty->uTimePlayed |
3905 + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) | 3942 + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) |
3906 * 0.033333335); | 3943 * 0.033333335); |
3907 *(int *)(v69 + 20) |= 8u; | 3944 *(int *)(v69 + 20) |= 8u; |
3908 } | 3945 } |
3909 *(int *)(v69 + 20) |= 0x10u; | 3946 *(int *)(v69 + 20) |= 0x10u; |
3910 LABEL_1055: | |
3911 dword_50C9A8 = 256; | 3947 dword_50C9A8 = 256; |
3912 LABEL_1056: | |
3913 LODWORD(v727) = 1; | 3948 LODWORD(v727) = 1; |
3914 play_sound_and_continue: | 3949 play_sound_and_continue: |
3915 if ( v3->field_8 & 0x20 ) | 3950 if ( v3->field_8 & 0x20 ) |
3916 { | 3951 { |
3917 LABEL_1162: | |
3918 if ( v727 != 0.0 ) | 3952 if ( v727 != 0.0 ) |
3919 pAudioPlayer->PlaySound( | 3953 pAudioPlayer->PlaySound( |
3920 (SoundID)word_4EE088_sound_ids[v3->spellnum], | 3954 (SoundID)word_4EE088_sound_ids[v3->spellnum], |
3921 0, | 3955 0, |
3922 0, | 3956 0, |
3944 (signed __int64)(flt_6BE3A4_debug_recmod1 * (double)sRecoveryTime * 2.133333333333333)); | 3978 (signed __int64)(flt_6BE3A4_debug_recmod1 * (double)sRecoveryTime * 2.133333333333333)); |
3945 } | 3979 } |
3946 if ( v727 != 0.0 ) | 3980 if ( v727 != 0.0 ) |
3947 { | 3981 { |
3948 pPlayer->PlaySound(SPEECH_49, 0); | 3982 pPlayer->PlaySound(SPEECH_49, 0); |
3949 goto LABEL_1162; | 3983 if ( v727 != 0.0 ) |
3984 pAudioPlayer->PlaySound( | |
3985 (SoundID)word_4EE088_sound_ids[v3->spellnum], | |
3986 0, | |
3987 0, | |
3988 -1, | |
3989 0, | |
3990 v3->sound_id, | |
3991 0, | |
3992 0); | |
3993 | |
3994 v3->spellnum = 0; | |
3995 v2 = v723; | |
3996 goto LABEL_1166; | |
3950 } | 3997 } |
3951 } | 3998 } |
3952 v3->spellnum = 0; | 3999 v3->spellnum = 0; |
3953 //v1 = 0; | |
3954 LABEL_1165: | |
3955 v2 = v723; | 4000 v2 = v723; |
3956 goto LABEL_1166; | 4001 goto LABEL_1166; |
3957 } | 4002 } |
3958 } | 4003 } |
3959 } | 4004 } |
3965 dword_50C9D4 = 0; | 4010 dword_50C9D4 = 0; |
3966 dword_50C9D8 = 1; | 4011 dword_50C9D8 = 1; |
3967 | 4012 |
3968 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed | 4013 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed |
3969 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | 4014 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
3970 goto LABEL_203; | 4015 v3->spellnum = 0; |
4016 goto LABEL_1166; | |
4017 } | |
3971 | 4018 |
3972 case SPELL_BODY_REGENERATION: | 4019 case SPELL_BODY_REGENERATION: |
4020 { | |
3973 v70 = v731 - 1; | 4021 v70 = v731 - 1; |
3974 LODWORD(v733) = 3600 * v2; | 4022 LODWORD(v733) = 3600 * v2; |
3975 if ( v70 && (v71 = v70 - 1) != 0 ) | 4023 if ( v70 && (v71 = v70 - 1) != 0 ) |
3976 { | 4024 { |
3977 v72 = v71 - 1; | 4025 v72 = v71 - 1; |
3993 goto play_sound_and_continue; | 4041 goto play_sound_and_continue; |
3994 | 4042 |
3995 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | 4043 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); |
3996 | 4044 |
3997 pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_REGENERATION].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)v733 * 4.2666669), v731, amount, 0, 0); | 4045 pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_REGENERATION].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)v733 * 4.2666669), v731, amount, 0, 0); |
3998 goto LABEL_1056; | 4046 LODWORD(v727) = 1; |
4047 goto play_sound_and_continue; | |
4048 } | |
3999 | 4049 |
4000 case SPELL_FIRE_PROTECTION_FROM_FIRE: | 4050 case SPELL_FIRE_PROTECTION_FROM_FIRE: |
4001 case SPELL_AIR_PROTECTION_FROM_AIR: | 4051 case SPELL_AIR_PROTECTION_FROM_AIR: |
4002 case SPELL_WATER_PROTECTION_FROM_WATER: | 4052 case SPELL_WATER_PROTECTION_FROM_WATER: |
4003 case SPELL_EARTH_PROTECTION_FROM_EARTH: | 4053 case SPELL_EARTH_PROTECTION_FROM_EARTH: |
4063 | 4113 |
4064 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); | 4114 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); |
4065 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | 4115 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); |
4066 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | 4116 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); |
4067 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | 4117 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); |
4068 v83 = 1; | |
4069 | 4118 |
4070 v90 = (double)(signed int)v733 * 4.2666669; | 4119 v90 = (double)(signed int)v733 * 4.2666669; |
4071 pParty->pPartyBuffs[LODWORD(v725)].Apply(pParty->uTimePlayed + (signed int)(signed __int64)v90, v731, amount, 0, 0); | 4120 pParty->pPartyBuffs[LODWORD(v725)].Apply(pParty->uTimePlayed + (signed int)(signed __int64)v90, v731, amount, 0, 0); |
4072 LODWORD(v727) = 1; | 4121 LODWORD(v727) = 1; |
4073 goto play_sound_and_continue; | 4122 goto play_sound_and_continue; |
4074 | 4123 |
4075 case SPELL_FIRE_HASTE: | 4124 case SPELL_FIRE_HASTE: |
4076 if ( v731 <= 0 ) | 4125 if ( v731 <= 0 ) |
4077 goto LABEL_254; | 4126 goto LABEL_254; |
4105 ++v92; | 4154 ++v92; |
4106 } | 4155 } |
4107 while ( v92 <= &pParty->pPlayers[3] ); | 4156 while ( v92 <= &pParty->pPlayers[3] ); |
4108 if (LODWORD(v727)) | 4157 if (LODWORD(v727)) |
4109 { | 4158 { |
4110 v726 = (Player *)((int)v733 << 7); | |
4111 pParty->pPartyBuffs[PARTY_BUFF_HASTE].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, 0, 0, 0); | 4159 pParty->pPartyBuffs[PARTY_BUFF_HASTE].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, 0, 0, 0); |
4112 | 4160 |
4113 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); | 4161 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); |
4114 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | 4162 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); |
4115 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | 4163 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); |
4152 v111 = pOtherOverlayList->_4418B1(10000, v3->uPlayerID_2 + 310, 0, 65536); | 4200 v111 = pOtherOverlayList->_4418B1(10000, v3->uPlayerID_2 + 310, 0, 65536); |
4153 //v668 = 0; | 4201 //v668 = 0; |
4154 v716 = v111; | 4202 v716 = v111; |
4155 //v658 = v111; | 4203 //v658 = v111; |
4156 //v653 = amount; | 4204 //v653 = amount; |
4157 v726 = (Player *)((int)v733 << 7); | |
4158 //v651 = 1; | 4205 //v651 = 1; |
4159 //v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | 4206 //v28 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); |
4160 //v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_BLESS]; | 4207 //v27 = (char *)&pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_BLESS]; |
4161 //LABEL_103: | 4208 //LABEL_103: |
4162 //HIDWORD(v650) = HIDWORD(v28); | 4209 //HIDWORD(v650) = HIDWORD(v28); |
4163 //LABEL_104: | 4210 //LABEL_104: |
4164 //LODWORD(v650) = v28; | 4211 //LODWORD(v650) = v28; |
4165 pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_BLESS].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), 1, amount, v111, 0); | 4212 pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_BLESS].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), 1, amount, v111, 0); |
4166 goto LABEL_1056; | 4213 LODWORD(v727) = 1; |
4214 goto play_sound_and_continue; | |
4167 } | 4215 } |
4168 v105 = 0; | 4216 v105 = 0; |
4169 v726 = (Player *)((int)v733 << 7); | |
4170 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | 4217 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); |
4171 v730b = pParty->pPlayers;//[0].pPlayerBuffs[1]; | 4218 v730b = pParty->pPlayers;//[0].pPlayerBuffs[1]; |
4172 do | 4219 do |
4173 { | 4220 { |
4174 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v105); | 4221 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v105); |
4176 v730b->pPlayerBuffs[1].Apply(pParty->uTimePlayed + v717, v731, amount, v716, 0); | 4223 v730b->pPlayerBuffs[1].Apply(pParty->uTimePlayed + v717, v731, amount, v716, 0); |
4177 ++v730b; | 4224 ++v730b; |
4178 ++v105; | 4225 ++v105; |
4179 } | 4226 } |
4180 while ( v730b <= &pParty->pPlayers[3] ); | 4227 while ( v730b <= &pParty->pPlayers[3] ); |
4181 goto LABEL_1056; | 4228 LODWORD(v727) = 1; |
4229 goto play_sound_and_continue; | |
4182 | 4230 |
4183 case 52: | 4231 case 52: |
4184 if ( pPlayer->CanCastSpell(uRequiredMana) && a2 && (a2 & 7) == OBJECT_Actor) | 4232 if ( pPlayer->CanCastSpell(uRequiredMana) && a2 && PID_TYPE(a2) == OBJECT_Actor) |
4185 { | 4233 { |
4186 v730 = a2 >> 3; | 4234 //v730 = a2 >> 3; |
4187 v112 = &pActors[a2 >> 3]; | 4235 v112 = &pActors[PID_ID(a2)]; |
4188 v726 = (Player *)abs(v112->vPosition.z - pParty->vPosition.z); | 4236 //v726 = (Player *)abs(v112->vPosition.z - pParty->vPosition.z); |
4189 v721 = abs(v112->vPosition.y - pParty->vPosition.y); | 4237 v721 = abs(v112->vPosition.y - pParty->vPosition.y); |
4190 v113 = abs(v112->vPosition.x - pParty->vPosition.x); | 4238 v113 = abs(v112->vPosition.x - pParty->vPosition.x); |
4191 _this = (ItemGen *)v113; | 4239 _this = (ItemGen *)v113; |
4192 v114 = v721; | 4240 v114 = v721; |
4193 v115 = (unsigned int)v726; | 4241 v115 = (unsigned int)abs(v112->vPosition.z - pParty->vPosition.z); |
4194 if ( v113 < v721 ) | 4242 if ( v113 < v721 ) |
4195 { | 4243 { |
4196 v116 = v113; | 4244 v116 = v113; |
4197 v113 = v721; | 4245 v113 = v721; |
4198 v114 = v116; | 4246 v114 = v116; |
4199 } | 4247 } |
4200 if ( v113 < (signed int)v726 ) | 4248 if ( v113 < (signed int)v115 ) |
4201 { | 4249 { |
4202 v117 = v113; | 4250 v117 = v113; |
4203 v113 = (int)v726; | 4251 v113 = (int)v115; |
4204 v115 = v117; | 4252 v115 = v117; |
4205 } | 4253 } |
4206 if ( v114 < (signed int)v115 ) | 4254 if ( v114 < (signed int)v115 ) |
4207 { | 4255 { |
4208 v118 = v115; | 4256 v118 = v115; |
4210 v114 = v118; | 4258 v114 = v118; |
4211 } | 4259 } |
4212 _this = (ItemGen *)(((unsigned int)(11 * v114) >> 5) + (v115 >> 2) + v113); | 4260 _this = (ItemGen *)(((unsigned int)(11 * v114) >> 5) + (v115 >> 2) + v113); |
4213 if ( (double)(signed int)this <= 307.2 ) | 4261 if ( (double)(signed int)this <= 307.2 ) |
4214 { | 4262 { |
4215 v703 = 0; | 4263 v701.x = 0; |
4216 v702 = 0; | 4264 v701.y = 0; |
4217 v701 = 0; | 4265 v701.z = 0; |
4218 a1.stru_24.Reset(); | 4266 a1.stru_24.Reset(); |
4219 v119 = HIDWORD(v733); | 4267 v119 = HIDWORD(v733); |
4220 a1.spell_id = *(int *)HIDWORD(v733); | 4268 a1.spell_id = *(int *)HIDWORD(v733); |
4221 a1.spell_level = v723; | 4269 a1.spell_level = v723; |
4222 a1.spell_skill = v731; | 4270 a1.spell_skill = v731; |
4223 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); | 4271 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
4224 a1.uAttributes = 0; | 4272 a1.uAttributes = 0; |
4225 a1.uSectorID = 0; | 4273 a1.uSectorID = 0; |
4226 a1.uSpriteFrameID = 0; | 4274 a1.uSpriteFrameID = 0; |
4227 v120 = 8 * *(short *)(v119 + 2); | |
4228 LOBYTE(v120) = v120 | OBJECT_Player; | |
4229 a1.field_60_distance_related_prolly_lod = 0; | 4275 a1.field_60_distance_related_prolly_lod = 0; |
4230 a1.spell_caster_pid = v120; | 4276 a1.spell_caster_pid = PID(OBJECT_Player, *(short *)(v119 + 2)); |
4231 a1.uFacing = 0; | 4277 a1.uFacing = 0; |
4232 a1.uSoundID = *(short *)(v119 + 16); | 4278 a1.uSoundID = *(short *)(v119 + 16); |
4233 a1.vPosition.x = v112->vPosition.x; | 4279 a1.vPosition.x = v112->vPosition.x; |
4234 a1.vPosition.y = v112->vPosition.y; | 4280 a1.vPosition.y = v112->vPosition.y; |
4235 v726 = (Player *)v112->uActorHeight; | 4281 a1.vPosition.z = v112->vPosition.z - (unsigned int)(signed __int64)((double)(signed int)v112->uActorHeight * unk_4D8548); |
4236 v121 = 8 * a2; | 4282 a1.spell_target_pid = PID(OBJECT_Actor, a2); |
4237 a1.vPosition.z = v112->vPosition.z - (unsigned int)(signed __int64)((double)(signed int)v726 * unk_4D8548); | |
4238 LOBYTE(v121) = 8 * a2 | 3; | |
4239 a1.spell_target_pid = v121; | |
4240 v122 = a1.Create(0, 0, 0, 0); | 4283 v122 = a1.Create(0, 0, 0, 0); |
4241 DamageMonsterFromParty(8 * v122 | 2, v730, (Vec3_int_ *)&v701); | 4284 DamageMonsterFromParty(PID(OBJECT_Item, v122), PID_ID(a2), &v701); |
4242 LODWORD(v727) = 1; | 4285 LODWORD(v727) = 1; |
4243 } | 4286 } |
4244 else | 4287 else |
4245 { | 4288 { |
4246 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); | 4289 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); |
4300 goto play_sound_and_continue; | 4343 goto play_sound_and_continue; |
4301 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); | 4344 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); |
4302 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | 4345 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); |
4303 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | 4346 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); |
4304 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | 4347 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); |
4305 v83 = 1; | |
4306 v726 = (Player *)((int)v733 << 7); | |
4307 v90 = (double)(signed int)((int)v733 << 7) * 0.033333335; | 4348 v90 = (double)(signed int)((int)v733 << 7) * 0.033333335; |
4308 //LABEL_304: | 4349 //LABEL_304: |
4309 pParty->pPartyBuffs[LODWORD(v725)].Apply(pParty->uTimePlayed + (signed int)(signed __int64)v90, v731, amount, 0, 0); | 4350 pParty->pPartyBuffs[LODWORD(v725)].Apply(pParty->uTimePlayed + (signed int)(signed __int64)v90, v731, amount, 0, 0); |
4310 LODWORD(v727) = v83; | 4351 LODWORD(v727) = 1; |
4311 goto play_sound_and_continue; | 4352 goto play_sound_and_continue; |
4312 | 4353 |
4313 case SPELL_FIRE_IMMOLATION: | 4354 case SPELL_FIRE_IMMOLATION: |
4314 v138 = v731 - 2; | 4355 v138 = v731 - 2; |
4315 if ( v138 && (v139 = v138 - 1) != 0 && v139 == 1 ) | 4356 if ( v138 && (v139 = v138 - 1) != 0 && v139 == 1 ) |
4323 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); | 4364 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); |
4324 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | 4365 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); |
4325 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | 4366 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); |
4326 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | 4367 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); |
4327 | 4368 |
4328 v726 = (Player *)((int)v733 << 7); | |
4329 | |
4330 pParty->pPartyBuffs[PARTY_BUFF_IMMOLATION].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, v2, 0, 0); | 4369 pParty->pPartyBuffs[PARTY_BUFF_IMMOLATION].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, v2, 0, 0); |
4331 goto LABEL_1056; | 4370 LODWORD(v727) = 1; |
4371 goto play_sound_and_continue; | |
4332 | 4372 |
4333 case 9: | 4373 case 9: |
4334 v149 = v731 - 1; | 4374 v149 = v731 - 1; |
4335 if ( v149 && (v150 = v149 - 1) != 0 && (v151 = v150 - 1) != 0 ) | 4375 if ( v149 && (v150 = v149 - 1) != 0 && (v151 = v150 - 1) != 0 ) |
4336 { | 4376 { |
4343 } | 4383 } |
4344 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | 4384 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) |
4345 { | 4385 { |
4346 ShowStatusBarString(pGlobalTXT_LocalizationStrings[491], 2); // Can't cast Meteor Shower indoors! | 4386 ShowStatusBarString(pGlobalTXT_LocalizationStrings[491], 2); // Can't cast Meteor Shower indoors! |
4347 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | 4387 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
4348 goto LABEL_203; | 4388 v3->spellnum = 0; |
4389 goto LABEL_1166; | |
4349 } | 4390 } |
4350 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 4391 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
4351 goto play_sound_and_continue; | 4392 goto play_sound_and_continue; |
4352 LODWORD(v725) = a2 & 7; | 4393 LODWORD(v725) = a2 & 7; |
4353 if ( (a2 & 7) == OBJECT_Actor) | 4394 if (PID_TYPE(a2) == OBJECT_Actor) |
4354 { | 4395 { |
4355 v152 = a2 >> 3; | 4396 uRequiredMana = pActors[PID_ID(a2)].vPosition.x; |
4356 uRequiredMana = pActors[v152].vPosition.x; | 4397 v153 = pActors[PID_ID(a2)].vPosition.y; |
4357 v153 = pActors[v152].vPosition.y; | 4398 v154 = pActors[PID_ID(a2)].vPosition.z; |
4358 v154 = pActors[v152].vPosition.z; | |
4359 LODWORD(v727) = v153; | 4399 LODWORD(v727) = v153; |
4360 } | 4400 } |
4361 else | 4401 else |
4362 { | 4402 { |
4363 v155 = stru_5C6E00->Cos(pParty->sRotationY); | 4403 v155 = stru_5C6E00->Cos(pParty->sRotationY); |
4368 } | 4408 } |
4369 HIDWORD(v733) = v154; | 4409 HIDWORD(v733) = v154; |
4370 v713 = v154 + 2500; | 4410 v713 = v154 + 2500; |
4371 v721 = 0; | 4411 v721 = 0; |
4372 LODWORD(v718) = 0; | 4412 LODWORD(v718) = 0; |
4373 if ( (signed int)this > 0 ) | 4413 if ( (signed int)_this > 0 ) |
4374 { | 4414 { |
4375 *(float *)&y = (double)SHIDWORD(v733); | 4415 *(float *)&y = (double)SHIDWORD(v733); |
4376 *(float *)&v732 = (double)v713; | 4416 *(float *)&v732 = (double)v713; |
4377 v730 = LODWORD(v725) == 3 ? a2 : 0; | 4417 v730 = LODWORD(v725) == 3 ? a2 : 0; |
4378 v726 = (Player *)this; | 4418 auto _this_cpy = (int)_this; |
4379 do | 4419 do |
4380 { | 4420 { |
4381 v157 = rand(); | 4421 v157 = rand(); |
4382 v158 = (double)SLODWORD(v718); | 4422 v158 = (double)SLODWORD(v718); |
4383 v718 = v158; | 4423 v718 = v158; |
4408 a1.vPosition.x = uRequiredMana; | 4448 a1.vPosition.x = uRequiredMana; |
4409 a1.vPosition.y = LODWORD(v727); | 4449 a1.vPosition.y = LODWORD(v727); |
4410 a1.uSectorID = 0; | 4450 a1.uSectorID = 0; |
4411 a1.vPosition.z = a2 + v713; | 4451 a1.vPosition.z = a2 + v713; |
4412 a1.uSpriteFrameID = 0; | 4452 a1.uSpriteFrameID = 0; |
4413 a1.spell_caster_pid = 8 * v3->uPlayerID | OBJECT_Player; | 4453 a1.spell_caster_pid = PID(OBJECT_Player, v3->uPlayerID); |
4414 a1.spell_target_pid = v730; | 4454 a1.spell_target_pid = v730; |
4415 a1.field_60_distance_related_prolly_lod = stru_50C198._427546(a2 + 2500); | 4455 a1.field_60_distance_related_prolly_lod = stru_50C198._427546(a2 + 2500); |
4416 a1.uFacing = v687; | 4456 a1.uFacing = v687; |
4417 a1.uSoundID = LOWORD(v3->sound_id); | 4457 a1.uSoundID = LOWORD(v3->sound_id); |
4418 if ( pParty->bTurnBasedModeOn == 1 ) | 4458 if ( pParty->bTurnBasedModeOn == 1 ) |
4424 0) != -1 | 4464 0) != -1 |
4425 && pParty->bTurnBasedModeOn == 1 ) | 4465 && pParty->bTurnBasedModeOn == 1 ) |
4426 ++pTurnEngine->field_1C; | 4466 ++pTurnEngine->field_1C; |
4427 LODWORD(v718) = rand() % 1024 - 512; | 4467 LODWORD(v718) = rand() % 1024 - 512; |
4428 v160 = rand(); | 4468 v160 = rand(); |
4429 v14 = v726 == (Player *)1; | 4469 v14 = _this_cpy-- == 1; |
4430 v726 = (Player *)((char *)v726 - 1); | |
4431 v721 = (unsigned __int64)(v160 % 1024) - 512; | 4470 v721 = (unsigned __int64)(v160 % 1024) - 512; |
4432 } | 4471 } |
4433 while ( !v14 ); | 4472 while ( !v14 ); |
4434 } | 4473 } |
4435 goto LABEL_1056; | 4474 LODWORD(v727) = 1; |
4475 goto play_sound_and_continue; | |
4476 | |
4436 case 10: | 4477 case 10: |
4478 { | |
4437 //v67 = 2; | 4479 //v67 = 2; |
4438 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | 4480 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) |
4439 { | 4481 { |
4440 ShowStatusBarString(pGlobalTXT_LocalizationStrings[492], 2); // Can't cast Inferno outdoors! | 4482 ShowStatusBarString(pGlobalTXT_LocalizationStrings[492], 2); // Can't cast Inferno outdoors! |
4441 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | 4483 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
4442 goto LABEL_203; | 4484 v3->spellnum = 0; |
4485 goto LABEL_1166; | |
4443 } | 4486 } |
4444 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 4487 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
4445 goto play_sound_and_continue; | 4488 goto play_sound_and_continue; |
4446 v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096); | 4489 auto _v726 = sub_46A6AC((int)dword_50BF30, 100, 4096); |
4447 v700.z = 0; | 4490 v700.z = 0; |
4448 v700.y = 0; | 4491 v700.y = 0; |
4449 v700.x = 0; | 4492 v700.x = 0; |
4450 a1.stru_24.Reset(); | 4493 a1.stru_24.Reset(); |
4451 a1.spell_id = v3->spellnum; | 4494 a1.spell_id = v3->spellnum; |
4458 a1.field_60_distance_related_prolly_lod = 0; | 4501 a1.field_60_distance_related_prolly_lod = 0; |
4459 a1.uFacing = 0; | 4502 a1.uFacing = 0; |
4460 a1.spell_caster_pid = PID(OBJECT_Player, v3->uPlayerID); | 4503 a1.spell_caster_pid = PID(OBJECT_Player, v3->uPlayerID); |
4461 a1.uSoundID = LOWORD(v3->sound_id); | 4504 a1.uSoundID = LOWORD(v3->sound_id); |
4462 a2 = 0; | 4505 a2 = 0; |
4463 if ( (signed int)v726 > 0 ) | 4506 if ( (signed int)_v726 > 0 ) |
4464 { | 4507 { |
4465 do | 4508 do |
4466 { | 4509 { |
4467 v162 = dword_50BF30[a2]; | 4510 v162 = dword_50BF30[a2]; |
4468 a1.vPosition.x = pActors[v162].vPosition.x; | 4511 a1.vPosition.x = pActors[v162].vPosition.x; |
4469 a1.vPosition.y = pActors[v162].vPosition.y; | 4512 a1.vPosition.y = pActors[v162].vPosition.y; |
4470 v732 = pActors[v162].uActorHeight; | 4513 a1.vPosition.z = pActors[v162].vPosition.z - (unsigned int)(signed __int64)((double)pActors[v162].uActorHeight * unk_4D8548); |
4471 a1.vPosition.z = pActors[v162].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | 4514 a1.spell_target_pid = PID(OBJECT_Actor, dword_50BF30[a2]); |
4472 v163 = 8 * dword_50BF30[a2]; | |
4473 LOBYTE(v163) = v163 | OBJECT_Actor; | |
4474 a1.spell_target_pid = v163; | |
4475 v164 = a1.Create(0, 0, 0, 0); | 4515 v164 = a1.Create(0, 0, 0, 0); |
4476 v165 = a2; | 4516 v165 = a2; |
4477 DamageMonsterFromParty(8 * v164 | AI_OBJECT_LAYING_ITEM, dword_50BF30[a2], &v700); | 4517 DamageMonsterFromParty(PID(OBJECT_Item, v164), dword_50BF30[a2], &v700); |
4478 pGame->GetStru6()->_4A81CA(&a1); | 4518 pGame->GetStru6()->_4A81CA(&a1); |
4479 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFF3C1Eu, 0x40u); | 4519 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFF3C1Eu, 0x40u); |
4480 a2 = v165 + 1; | 4520 a2 = v165 + 1; |
4481 } | 4521 } |
4482 while ( v165 + 1 < (signed int)v726 ); | 4522 while ( v165 + 1 < (signed int)_v726 ); |
4483 } | 4523 } |
4484 goto LABEL_1056; | 4524 LODWORD(v727) = 1; |
4525 goto play_sound_and_continue; | |
4526 } | |
4485 | 4527 |
4486 case SPELL_AIR_WIZARD_EYE: | 4528 case SPELL_AIR_WIZARD_EYE: |
4487 LODWORD(v733) = 3600 * v2; | 4529 LODWORD(v733) = 3600 * v2; |
4488 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 4530 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
4489 goto play_sound_and_continue; | 4531 goto play_sound_and_continue; |
4493 v169 = pOtherOverlayList->_4418B1(2000, v168++ + 100, 0, 65536); | 4535 v169 = pOtherOverlayList->_4418B1(2000, v168++ + 100, 0, 65536); |
4494 v716 = v169; | 4536 v716 = v169; |
4495 } | 4537 } |
4496 while ( v168 < 4 ); | 4538 while ( v168 < 4 ); |
4497 | 4539 |
4498 v732 = (int)v733 << 7; | |
4499 | |
4500 pParty->pPartyBuffs[PARTY_BUFF_WIZARD_EYE].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, 0, 0, 0); | 4540 pParty->pPartyBuffs[PARTY_BUFF_WIZARD_EYE].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, 0, 0, 0); |
4501 goto LABEL_1056; | 4541 LODWORD(v727) = 1; |
4542 goto play_sound_and_continue; | |
4502 | 4543 |
4503 case SPELL_AIR_FEATHER_FALL: | 4544 case SPELL_AIR_FEATHER_FALL: |
4504 v170 = v731 - 1; | 4545 v170 = v731 - 1; |
4505 if ( !v170 ) | 4546 if ( !v170 ) |
4506 { | 4547 { |
4528 while ( v174 < 4 ); | 4569 while ( v174 < 4 ); |
4529 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); | 4570 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); |
4530 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | 4571 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); |
4531 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | 4572 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); |
4532 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | 4573 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); |
4533 v83 = 1; | 4574 |
4534 v732 = (int)v733 << 7; | 4575 pParty->pPartyBuffs[PARTY_BUFF_FEATHER_FALL].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, 0, 0, 0); |
4535 pParty->pPartyBuffs[PARTY_BUFF_FEATHER_FALL].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, 0, 0, 0); | 4576 LODWORD(v727) = 1; |
4536 LODWORD(v727) = v83; | |
4537 goto play_sound_and_continue; | 4577 goto play_sound_and_continue; |
4538 | 4578 |
4539 case SPELL_AIR_SPARKS: | 4579 case SPELL_AIR_SPARKS: |
4580 { | |
4540 v184 = v731 - 1; | 4581 v184 = v731 - 1; |
4541 if ( v184 ) | 4582 if ( v184 ) |
4542 { | 4583 { |
4543 v185 = v184 - 1; | 4584 v185 = v184 - 1; |
4544 if ( v185 ) | 4585 if ( v185 ) |
4563 { | 4604 { |
4564 amount = 3; | 4605 amount = 3; |
4565 } | 4606 } |
4566 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 4607 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
4567 goto play_sound_and_continue; | 4608 goto play_sound_and_continue; |
4568 v726 = (Player *)((signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360); | 4609 auto _v726 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360; |
4569 v732 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (amount - 1); | |
4570 a1.stru_24.Reset(); | 4610 a1.stru_24.Reset(); |
4571 a1.spell_id = v3->spellnum; | 4611 a1.spell_id = v3->spellnum; |
4572 a1.spell_level = v2; | 4612 a1.spell_level = v2; |
4573 a1.spell_skill = v731; | 4613 a1.spell_skill = v731; |
4574 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); | 4614 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
4585 a1.spell_target_pid = a2; | 4625 a1.spell_target_pid = a2; |
4586 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | 4626 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); |
4587 a1.uSoundID = LOWORD(v3->sound_id); | 4627 a1.uSoundID = LOWORD(v3->sound_id); |
4588 if ( pParty->bTurnBasedModeOn == 1 ) | 4628 if ( pParty->bTurnBasedModeOn == 1 ) |
4589 LOBYTE(a1.uAttributes) |= 4u; | 4629 LOBYTE(a1.uAttributes) |= 4u; |
4590 v188 = (signed int)v726 / -2; | 4630 v188 = (signed int)_v726 / -2; |
4591 v189 = (signed int)v726 / 2; | 4631 v189 = (signed int)_v726 / 2; |
4592 while ( v188 <= v189 ) | 4632 while ( v188 <= v189 ) |
4593 { | 4633 { |
4594 a1.uFacing = v188 + LOWORD(v715.uYawAngle); | 4634 a1.uFacing = v188 + LOWORD(v715.uYawAngle); |
4595 if ( a1.Create( | 4635 if ( a1.Create( |
4596 (signed __int16)(v188 + LOWORD(v715.uYawAngle)), | 4636 (signed __int16)(v188 + LOWORD(v715.uYawAngle)), |
4597 v715.uPitchAngle, | 4637 v715.uPitchAngle, |
4598 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | 4638 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, |
4599 v3->uPlayerID + 1) != -1 | 4639 v3->uPlayerID + 1) != -1 |
4600 && pParty->bTurnBasedModeOn == 1 ) | 4640 && pParty->bTurnBasedModeOn == 1 ) |
4601 ++pTurnEngine->field_1C; | 4641 ++pTurnEngine->field_1C; |
4602 v188 += v732; | 4642 v188 += _v726 / (amount - 1); |
4603 } | 4643 } |
4604 goto LABEL_1056; | 4644 LODWORD(v727) = 1; |
4645 goto play_sound_and_continue; | |
4646 } | |
4647 | |
4605 case 16: | 4648 case 16: |
4606 if ( pParty->uFlags & PARTY_FLAGS_1_FALLING) | 4649 if ( pParty->uFlags & PARTY_FLAGS_1_FALLING) |
4607 { | 4650 { |
4608 ShowStatusBarString(pGlobalTXT_LocalizationStrings[493], 2); // Can't cast Jump while airborne! | 4651 ShowStatusBarString(pGlobalTXT_LocalizationStrings[493], 2); // Can't cast Jump while airborne! |
4609 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | 4652 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
4615 do | 4658 do |
4616 pOtherOverlayList->_4418B1(2040, v191++ + 100, 0, 65536); | 4659 pOtherOverlayList->_4418B1(2040, v191++ + 100, 0, 65536); |
4617 while ( v191 < 4 ); | 4660 while ( v191 < 4 ); |
4618 BYTE1(pParty->uFlags) |= 1u; | 4661 BYTE1(pParty->uFlags) |= 1u; |
4619 pParty->uFallSpeed = 1000; | 4662 pParty->uFallSpeed = 1000; |
4620 goto LABEL_1056; | 4663 LODWORD(v727) = 1; |
4664 goto play_sound_and_continue; | |
4621 | 4665 |
4622 case SPELL_AIR_INVISIBILITY: | 4666 case SPELL_AIR_INVISIBILITY: |
4623 v192 = v731 - 1; | 4667 v192 = v731 - 1; |
4624 if ( !v192 ) | 4668 if ( !v192 ) |
4625 { | 4669 { |
4651 LABEL_393: | 4695 LABEL_393: |
4652 if (pParty->uFlags & (PARTY_FLAGS_1_ALERT_RED | PARTY_FLAGS_1_ALERT_YELLOW)) | 4696 if (pParty->uFlags & (PARTY_FLAGS_1_ALERT_RED | PARTY_FLAGS_1_ALERT_YELLOW)) |
4653 { | 4697 { |
4654 ShowStatusBarString(pGlobalTXT_LocalizationStrings[638], 2); // There are hostile creatures nearby! | 4698 ShowStatusBarString(pGlobalTXT_LocalizationStrings[638], 2); // There are hostile creatures nearby! |
4655 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | 4699 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
4656 goto LABEL_203; | 4700 v3->spellnum = 0; |
4701 goto LABEL_1166; | |
4657 } | 4702 } |
4658 if ( pPlayer->CanCastSpell(uRequiredMana) ) | 4703 if ( pPlayer->CanCastSpell(uRequiredMana) ) |
4659 { | 4704 { |
4660 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); | 4705 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); |
4661 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | 4706 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); |
4662 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | 4707 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); |
4663 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | 4708 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); |
4664 v83 = 1; | |
4665 v732 = (int)v733 << 7; | |
4666 | 4709 |
4667 pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, amount, 0, 0); | 4710 pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, amount, 0, 0); |
4668 LODWORD(v727) = v83; | 4711 LODWORD(v727) = 1; |
4669 } | 4712 } |
4670 goto play_sound_and_continue; | 4713 goto play_sound_and_continue; |
4671 | 4714 |
4672 case 21: | 4715 case 21: |
4716 { | |
4673 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | 4717 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) |
4674 { | 4718 { |
4675 ShowStatusBarString(pGlobalTXT_LocalizationStrings[494], 2); // Can not cast Fly indoors! | 4719 ShowStatusBarString(pGlobalTXT_LocalizationStrings[494], 2); // Can not cast Fly indoors! |
4676 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | 4720 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
4677 goto play_sound_and_continue; | 4721 goto play_sound_and_continue; |
4693 while ( v205 < 4 ); | 4737 while ( v205 < 4 ); |
4694 v206 = pOtherOverlayList->_4418B1(10008, 203, 0, 65536); | 4738 v206 = pOtherOverlayList->_4418B1(10008, 203, 0, 65536); |
4695 v207 = v3->uPlayerID + 1; | 4739 v207 = v3->uPlayerID + 1; |
4696 v716 = v206; | 4740 v716 = v206; |
4697 | 4741 |
4698 v732 = (int)v733 << 7; | |
4699 | |
4700 pParty->pPartyBuffs[PARTY_BUFF_FLY].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, amount, v206, v207); | 4742 pParty->pPartyBuffs[PARTY_BUFF_FLY].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, amount, v206, v207); |
4701 goto LABEL_1056; | 4743 LODWORD(v727) = 1; |
4744 goto play_sound_and_continue; | |
4745 } | |
4702 | 4746 |
4703 case 22: | 4747 case 22: |
4748 { | |
4704 //v67 = 2; | 4749 //v67 = 2; |
4705 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | 4750 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) |
4706 { | 4751 { |
4707 ShowStatusBarString(pGlobalTXT_LocalizationStrings[495], 2); // Can't cast Starburst indoors! | 4752 ShowStatusBarString(pGlobalTXT_LocalizationStrings[495], 2); // Can't cast Starburst indoors! |
4708 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | 4753 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
4709 goto LABEL_203; | 4754 v3->spellnum = 0; |
4755 goto LABEL_1166; | |
4710 } | 4756 } |
4711 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 4757 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
4712 goto play_sound_and_continue; | 4758 goto play_sound_and_continue; |
4713 v208 = a2 & 7; | 4759 v208 = a2 & 7; |
4714 LODWORD(v725) = a2 & 7; | 4760 LODWORD(v725) = a2 & 7; |
4728 v214 = sub_42EBBE(2048, v213); | 4774 v214 = sub_42EBBE(2048, v213); |
4729 v211 = pParty->vPosition.z; | 4775 v211 = pParty->vPosition.z; |
4730 v713 = pParty->vPosition.y + v214; | 4776 v713 = pParty->vPosition.y + v214; |
4731 v208 = LODWORD(v725); | 4777 v208 = LODWORD(v725); |
4732 } | 4778 } |
4733 v726 = (Player *)v211; | |
4734 HIDWORD(v733) = 0; | 4779 HIDWORD(v733) = 0; |
4735 *(float *)&v732 = (double)v211; | 4780 *(float *)&v732 = (double)v211; |
4736 LODWORD(v725) = v211 + 2500; | 4781 LODWORD(v725) = v211 + 2500; |
4737 v721 = 0; | 4782 v721 = 0; |
4738 *(float *)&y = (double)(v211 + 2500); | 4783 *(float *)&y = (double)(v211 + 2500); |
4740 a2 = 20; | 4785 a2 = 20; |
4741 do | 4786 do |
4742 { | 4787 { |
4743 v215 = rand(); | 4788 v215 = rand(); |
4744 v216 = (double)v721; | 4789 v216 = (double)v721; |
4745 v727 = v216; | |
4746 v217 = (double)SHIDWORD(v733); | 4790 v217 = (double)SHIDWORD(v733); |
4747 *(float *)&uRequiredMana = v217; | 4791 *(float *)&uRequiredMana = v217; |
4748 _this = (ItemGen *)(v215 % 1000); | 4792 _this = (ItemGen *)(v215 % 1000); |
4749 *((float *)&v733 + 1) = (double)(v215 % 1000) + *(float *)&v732 - *(float *)&y; | 4793 *((float *)&v733 + 1) = (double)(v215 % 1000) + *(float *)&v732 - *(float *)&y; |
4750 *(float *)&v721 = v217 * v217; | 4794 *(float *)&v721 = v217 * v217; |
4751 *(float *)&v726 = v216 * v216; | 4795 //*(float *)&v726 = v216 * v216; |
4752 if ( sqrt(*((float *)&v733 + 1) * *((float *)&v733 + 1) + *(float *)&v726 + *(float *)&v721) <= 1.0 ) | 4796 if ( sqrt(*((float *)&v733 + 1) * *((float *)&v733 + 1) + v216 * v216 + *(float *)&v721) <= 1.0 ) |
4753 { | 4797 { |
4754 LODWORD(v685) = 0; | 4798 LODWORD(v685) = 0; |
4755 HIDWORD(v685) = 0; | 4799 HIDWORD(v685) = 0; |
4756 } | 4800 } |
4757 else | 4801 else |
4758 { | 4802 { |
4759 v684 = (signed __int64)sqrt(*(float *)&v726 + *(float *)&v721); | 4803 v684 = (signed __int64)sqrt(v216 * v216 + *(float *)&v721); |
4760 v685 = __PAIR__( | 4804 v685 = __PAIR__( |
4761 stru_5C6E00->Atan2(v684, (signed __int64)*((float *)&v733 + 1)), | 4805 stru_5C6E00->Atan2(v684, (signed __int64)*((float *)&v733 + 1)), |
4762 stru_5C6E00->Atan2((signed __int64)v727, (signed __int64)*(float *)&uRequiredMana)); | 4806 stru_5C6E00->Atan2((signed __int64)v216, (signed __int64)*(float *)&uRequiredMana)); |
4763 } | 4807 } |
4764 a1.stru_24.Reset(); | 4808 a1.stru_24.Reset(); |
4765 a1.spell_id = v3->spellnum; | 4809 a1.spell_id = v3->spellnum; |
4766 a1.spell_level = v2; | 4810 a1.spell_level = v2; |
4767 a1.spell_skill = v731; | 4811 a1.spell_skill = v731; |
4770 a1.vPosition.x = LODWORD(v718); | 4814 a1.vPosition.x = LODWORD(v718); |
4771 a1.vPosition.y = v713; | 4815 a1.vPosition.y = v713; |
4772 a1.uSectorID = 0; | 4816 a1.uSectorID = 0; |
4773 a1.vPosition.z = (int)((char *)_this + LODWORD(v725)); | 4817 a1.vPosition.z = (int)((char *)_this + LODWORD(v725)); |
4774 a1.uSpriteFrameID = 0; | 4818 a1.uSpriteFrameID = 0; |
4775 a1.spell_caster_pid = 8 * v3->uPlayerID | OBJECT_Player; | 4819 a1.spell_caster_pid = PID(OBJECT_Player, v3->uPlayerID); |
4776 a1.spell_target_pid = v730; | 4820 a1.spell_target_pid = v730; |
4821 __debugbreak(); | |
4777 a1.field_60_distance_related_prolly_lod = stru_50C198._427546((int)&_this[69].uNumCharges); | 4822 a1.field_60_distance_related_prolly_lod = stru_50C198._427546((int)&_this[69].uNumCharges); |
4778 a1.uFacing = v685; | 4823 a1.uFacing = v685; |
4779 a1.uSoundID = LOWORD(v3->sound_id); | 4824 a1.uSoundID = LOWORD(v3->sound_id); |
4780 if ( pParty->bTurnBasedModeOn == 1 ) | 4825 if ( pParty->bTurnBasedModeOn == 1 ) |
4781 a1.uAttributes = 4; | 4826 a1.uAttributes = 4; |
4790 v218 = rand(); | 4835 v218 = rand(); |
4791 v14 = a2-- == 1; | 4836 v14 = a2-- == 1; |
4792 HIDWORD(v733) = (unsigned __int64)(v218 % 1024) - 512; | 4837 HIDWORD(v733) = (unsigned __int64)(v218 % 1024) - 512; |
4793 } | 4838 } |
4794 while ( !v14 ); | 4839 while ( !v14 ); |
4795 goto LABEL_1056; | 4840 LODWORD(v727) = 1; |
4841 goto play_sound_and_continue; | |
4842 } | |
4843 | |
4796 case 23: | 4844 case 23: |
4797 v219 = v731 - 2; | 4845 v219 = v731 - 2; |
4798 if ( v219 ) | 4846 if ( v219 ) |
4799 { | 4847 { |
4800 v220 = v219 - 1; | 4848 v220 = v219 - 1; |
4869 a1.spell_caster_pid = PID(OBJECT_Player, v3->uPlayerID); | 4917 a1.spell_caster_pid = PID(OBJECT_Player, v3->uPlayerID); |
4870 a1.spell_target_pid = a2; | 4918 a1.spell_target_pid = a2; |
4871 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | 4919 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); |
4872 a1.uFacing = LOWORD(v715.uYawAngle); | 4920 a1.uFacing = LOWORD(v715.uYawAngle); |
4873 a1.uSoundID = LOWORD(v3->sound_id); | 4921 a1.uSoundID = LOWORD(v3->sound_id); |
4874 LABEL_154: | 4922 |
4875 if ( pParty->bTurnBasedModeOn == 1 ) | 4923 if ( pParty->bTurnBasedModeOn == 1 ) |
4876 LOBYTE(a1.uAttributes) |= 4u; | 4924 LOBYTE(a1.uAttributes) |= 4u; |
4877 LABEL_156: | 4925 |
4878 v669 = v3->uPlayerID + 1; | |
4879 v36 = v715.uYawAngle; | |
4880 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | 4926 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; |
4881 v654 = v715.uPitchAngle; | 4927 |
4882 LABEL_157: | 4928 if ( a1.Create(v715.uYawAngle, v715.uPitchAngle, v659, v3->uPlayerID + 1) != -1 && pParty->bTurnBasedModeOn == 1 ) |
4883 if ( a1.Create(v36, v654, v659, v669) != -1 && pParty->bTurnBasedModeOn == 1 ) | |
4884 ++pTurnEngine->field_1C; | 4929 ++pTurnEngine->field_1C; |
4885 } | 4930 } |
4886 else | 4931 else |
4887 { | 4932 { |
4888 v732 = SHIDWORD(v733) / (amount - 1); | |
4889 a1.stru_24.Reset(); | 4933 a1.stru_24.Reset(); |
4890 a1.spell_id = v3->spellnum; | 4934 a1.spell_id = v3->spellnum; |
4891 a1.spell_level = v2; | 4935 a1.spell_level = v2; |
4892 a1.spell_skill = v731; | 4936 a1.spell_skill = v731; |
4893 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); | 4937 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
4919 v715.uPitchAngle, | 4963 v715.uPitchAngle, |
4920 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | 4964 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, |
4921 v3->uPlayerID + 1) != -1 | 4965 v3->uPlayerID + 1) != -1 |
4922 && pParty->bTurnBasedModeOn == 1 ) | 4966 && pParty->bTurnBasedModeOn == 1 ) |
4923 ++pTurnEngine->field_1C; | 4967 ++pTurnEngine->field_1C; |
4924 v227 += v732; | 4968 v227 += SHIDWORD(v733) / (amount - 1); |
4925 } | 4969 } |
4926 while ( v227 <= (signed int)y ); | 4970 while ( v227 <= (signed int)y ); |
4927 } | 4971 } |
4928 } | 4972 } |
4929 goto LABEL_1056; | 4973 LODWORD(v727) = 1; |
4974 goto play_sound_and_continue; | |
4975 | |
4930 case 27: | 4976 case 27: |
4931 if ( !pPlayers[v3->uPlayerID + 1]->GetMaxMana() ) | 4977 if ( !pPlayers[v3->uPlayerID + 1]->GetMaxMana() ) |
4932 { | 4978 { |
4933 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed | 4979 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed |
4934 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | 4980 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
4944 v716 = pOtherOverlayList->_4418B1(10005, 201, 0, 65536); | 4990 v716 = pOtherOverlayList->_4418B1(10005, 201, 0, 65536); |
4945 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); | 4991 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); |
4946 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | 4992 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); |
4947 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | 4993 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); |
4948 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | 4994 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); |
4949 v239 = v3->uPlayerID + 1; | 4995 |
4950 v732 = v229 << 7; | 4996 pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].Apply( |
4951 pParty->pPartyBuffs[18].Apply( | |
4952 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v229 << 7) * 0.033333335), | 4997 pParty->uTimePlayed + (signed int)(signed __int64)((double)(v229 << 7) * 0.033333335), |
4953 v731, | 4998 v731, |
4954 amount, | 4999 amount, |
4955 v716, | 5000 v716, |
4956 v239); | 5001 v3->uPlayerID + 1); |
4957 if ( v731 == 4 ) | 5002 if ( v731 == 4 ) |
4958 pParty->pPartyBuffs[18].uFlags = 1; | 5003 pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uFlags = 1; |
4959 LODWORD(v727) = 1; | 5004 LODWORD(v727) = 1; |
4960 goto play_sound_and_continue; | 5005 goto play_sound_and_continue; |
4961 | 5006 |
4962 case 28: | 5007 case 28: |
4963 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 5008 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
4970 dword_50C9D4 = 0; | 5015 dword_50C9D4 = 0; |
4971 dword_50C9D8 = 1; | 5016 dword_50C9D8 = 1; |
4972 | 5017 |
4973 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed | 5018 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed |
4974 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | 5019 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
4975 goto LABEL_203; | 5020 v3->spellnum = 0; |
5021 goto LABEL_1166; | |
4976 } | 5022 } |
4977 if ( v731 == 1 || v731 == 2 ) | 5023 if ( v731 == 1 || v731 == 2 ) |
4978 { | 5024 { |
4979 v241 = (double)v723 * 0.0099999998 + 0.5; | 5025 v241 = (double)v723 * 0.0099999998 + 0.5; |
4980 } | 5026 } |
5009 dword_50C9D4 = 0; | 5055 dword_50C9D4 = 0; |
5010 dword_50C9D8 = 1; | 5056 dword_50C9D8 = 1; |
5011 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); | 5057 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2u); |
5012 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | 5058 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
5013 v3->spellnum = 0; | 5059 v3->spellnum = 0; |
5014 goto LABEL_1165; | 5060 v2 = v723; |
5061 goto LABEL_1166; | |
5015 } | 5062 } |
5016 *((int *)v243 + 5) |= 0x40u; | 5063 *((int *)v243 + 5) |= 0x40u; |
5017 goto LABEL_1055; | 5064 dword_50C9A8 = 256; |
5065 LODWORD(v727) = 1; | |
5066 goto play_sound_and_continue; | |
5067 | |
5018 case 30: | 5068 case 30: |
5019 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 5069 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
5020 goto play_sound_and_continue; | 5070 goto play_sound_and_continue; |
5021 uRequiredMana = 0; | 5071 uRequiredMana = 0; |
5022 HIDWORD(v733) = 10 * v2; | 5072 HIDWORD(v733) = 10 * v2; |
5023 v730 = 1; | 5073 v730 = 1; |
5024 v244 = (char *)&pParty->pPlayers[v3->uPlayerID_2]; | 5074 v244 = (char *)&pParty->pPlayers[v3->uPlayerID_2]; |
5025 v726 = &pParty->pPlayers[v3->uPlayerID_2]; | |
5026 if ( v731 == 1 ) | 5075 if ( v731 == 1 ) |
5027 { | 5076 { |
5028 v245 = (int)&v244[36 * a2 + 532]; | 5077 v245 = (int)&v244[36 * a2 + 532]; |
5029 v309 = (char *)&pItemsTable->pItems[*(int *)v245].pIconName; | 5078 v309 = (char *)&pItemsTable->pItems[*(int *)v245].pIconName; |
5030 v311 = __OFSUB__(*(int *)v245, 134); | 5079 v311 = __OFSUB__(*(int *)v245, 134); |
5078 v256 = 10;//pItemsTable->field_116D8[16]; | 5127 v256 = 10;//pItemsTable->field_116D8[16]; |
5079 LABEL_611: | 5128 LABEL_611: |
5080 *(int *)(v245 + 8) = v256 + v254 % (v255 - v256 + 1); | 5129 *(int *)(v245 + 8) = v256 + v254 % (v255 - v256 + 1); |
5081 LABEL_612: | 5130 LABEL_612: |
5082 _this->uItemID |= 0x20u; | 5131 _this->uItemID |= 0x20u; |
5083 goto LABEL_1055; | 5132 |
5133 dword_50C9A8 = 256; | |
5134 LODWORD(v727) = 1; | |
5135 goto play_sound_and_continue; | |
5084 } | 5136 } |
5085 goto LABEL_615; | 5137 goto LABEL_615; |
5086 } | 5138 } |
5087 LABEL_613: | 5139 LABEL_613: |
5088 v316 = _this->uItemID; | 5140 v316 = _this->uItemID; |
5105 v317 = pGlobalTXT_LocalizationStrings[428]; | 5157 v317 = pGlobalTXT_LocalizationStrings[428]; |
5106 if ( v730 == 0 ) | 5158 if ( v730 == 0 ) |
5107 v317 = pGlobalTXT_LocalizationStrings[585]; | 5159 v317 = pGlobalTXT_LocalizationStrings[585]; |
5108 ShowStatusBarString(v317, 2u); | 5160 ShowStatusBarString(v317, 2u); |
5109 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | 5161 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
5110 v318 = v726; | 5162 __debugbreak(); // decompilation error; most probably v318 is the caster, filled in case 54 |
5163 //v318 = v726; | |
5111 v3->spellnum = 0; | 5164 v3->spellnum = 0; |
5112 v318->PlaySound(SPEECH_43, 0); | 5165 v318->PlaySound(SPEECH_43, 0); |
5113 } | 5166 } |
5114 goto play_sound_and_continue; | 5167 goto play_sound_and_continue; |
5115 } | 5168 } |
5214 goto LABEL_525; | 5267 goto LABEL_525; |
5215 } | 5268 } |
5216 } | 5269 } |
5217 else | 5270 else |
5218 { | 5271 { |
5272 __debugbreak(); // v726 is most probably the caster, filled in case 54 | |
5219 if ( v731 != 4 | 5273 if ( v731 != 4 |
5220 || (v245 = (int)&v726->pInventoryItems[a2], v246 = *(int *)v245, *(int *)v245 > 134) | 5274 || (v245 = (int)&v726->pInventoryItems[a2], v246 = *(int *)v245, *(int *)v245 > 134) |
5221 || v726->pInventoryItems[a2].uSpecEnchantmentType != 0 | 5275 || v726->pInventoryItems[a2].uSpecEnchantmentType != 0 |
5222 || v726->pInventoryItems[a2].uEnchantmentType != 0 | 5276 || v726->pInventoryItems[a2].uEnchantmentType != 0 |
5223 || v726->pInventoryItems[a2]._bonus_strength != 0 | 5277 || v726->pInventoryItems[a2]._bonus_strength != 0 |
5341 dword_50C9D4 = 0; | 5395 dword_50C9D4 = 0; |
5342 dword_50C9D8 = 1; | 5396 dword_50C9D8 = 1; |
5343 | 5397 |
5344 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed | 5398 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed |
5345 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | 5399 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
5346 goto LABEL_203; | 5400 v3->spellnum = 0; |
5401 goto LABEL_1166; | |
5347 } | 5402 } |
5348 v292 = *(char *)(LODWORD(v725) + 28); | 5403 v292 = *(char *)(LODWORD(v725) + 28); |
5349 if ( !(v292 == 3 | v292 == 4 | v292 == 5 | v292 == 6 | v292 == 7 | v292 == 8 | v292 == 9 | v292 == 10 | v292 == 11) ) | 5404 if ( !(v292 == 3 | v292 == 4 | v292 == 5 | v292 == 6 | v292 == 7 | v292 == 8 | v292 == 9 | v292 == 10 | v292 == 11) ) |
5350 { | 5405 { |
5351 v2 = v723; | 5406 v2 = v723; |
5355 dword_50C9D4 = 0; | 5410 dword_50C9D4 = 0; |
5356 dword_50C9D8 = 1; | 5411 dword_50C9D8 = 1; |
5357 | 5412 |
5358 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed | 5413 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed |
5359 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | 5414 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
5360 goto LABEL_203; | 5415 v3->spellnum = 0; |
5416 goto LABEL_1166; | |
5361 } | 5417 } |
5362 if ( rand() % 100 >= 80 ) | 5418 if ( rand() % 100 >= 80 ) |
5363 { | 5419 { |
5364 v297 = pItemsTable->pSpecialEnchantments_count; | 5420 v297 = pItemsTable->pSpecialEnchantments_count; |
5365 v294 = _this; | 5421 v294 = _this; |
5426 } | 5482 } |
5427 v294->_bonus_strength = 10//pItemsTable->field_116D8[18] | 5483 v294->_bonus_strength = 10//pItemsTable->field_116D8[18] |
5428 + rand() % 10;//(pItemsTable->field_116D8[19] - pItemsTable->field_116D8[18] + 1); | 5484 + rand() % 10;//(pItemsTable->field_116D8[19] - pItemsTable->field_116D8[18] + 1); |
5429 } | 5485 } |
5430 v294->uAttributes |= 0x20u; | 5486 v294->uAttributes |= 0x20u; |
5431 goto LABEL_1055; | 5487 dword_50C9A8 = 256; |
5488 LODWORD(v727) = 1; | |
5489 goto play_sound_and_continue; | |
5490 | |
5432 case SPELL_WATER_TOWN_PORTAL: | 5491 case SPELL_WATER_TOWN_PORTAL: |
5433 amount = 10 * v2; | 5492 amount = 10 * v2; |
5434 if ( pPlayer->sMana < (signed int)uRequiredMana ) | 5493 if ( pPlayer->sMana < (signed int)uRequiredMana ) |
5435 goto play_sound_and_continue; | 5494 goto play_sound_and_continue; |
5436 if ( pParty->uFlags & (PARTY_FLAGS_1_ALERT_RED | PARTY_FLAGS_1_ALERT_YELLOW) && v731 != 4 || rand() % 100 >= amount && v731 != 4 ) | 5495 if ( pParty->uFlags & (PARTY_FLAGS_1_ALERT_RED | PARTY_FLAGS_1_ALERT_YELLOW) && v731 != 4 || rand() % 100 >= amount && v731 != 4 ) |
5437 { | 5496 { |
5438 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed | 5497 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed |
5439 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | 5498 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
5440 goto LABEL_203; | 5499 v3->spellnum = 0; |
5500 goto LABEL_1166; | |
5441 } | 5501 } |
5442 town_portal_caster_id = LOBYTE(v3->uPlayerID); | 5502 town_portal_caster_id = LOBYTE(v3->uPlayerID); |
5443 pMessageQueue_50CBD0->AddMessage(UIMSG_OnCastTownPortal, 0, 0); | 5503 pMessageQueue_50CBD0->AddMessage(UIMSG_OnCastTownPortal, 0, 0); |
5444 goto LABEL_1056; | 5504 LODWORD(v727) = 1; |
5505 goto play_sound_and_continue; | |
5445 case 33: | 5506 case 33: |
5446 LODWORD(v733) = 604800 * v2; | 5507 LODWORD(v733) = 604800 * v2; |
5447 if ( !_strcmpi(pCurrentMapName, "d05.blv") ) | 5508 if ( !_strcmpi(pCurrentMapName, "d05.blv") ) |
5448 { | 5509 { |
5449 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed | 5510 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed |
5450 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | 5511 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
5451 goto LABEL_203; | 5512 v3->spellnum = 0; |
5513 goto LABEL_1166; | |
5452 } | 5514 } |
5453 v319 = uRequiredMana; | 5515 v319 = uRequiredMana; |
5454 if ( pPlayer->sMana >= (signed int)uRequiredMana ) | 5516 if ( pPlayer->sMana >= (signed int)uRequiredMana ) |
5455 { | 5517 { |
5456 pEventTimer->Pause(); | 5518 pEventTimer->Pause(); |
5485 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 5547 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
5486 goto play_sound_and_continue; | 5548 goto play_sound_and_continue; |
5487 v323 = v3->uPlayerID_2; | 5549 v323 = v3->uPlayerID_2; |
5488 v324 = (char *)&pParty->pPlayers[v323].pConditions[15]; | 5550 v324 = (char *)&pParty->pPlayers[v323].pConditions[15]; |
5489 if ( !pParty->pPlayers[v323].pConditions[15] ) | 5551 if ( !pParty->pPlayers[v323].pConditions[15] ) |
5490 goto LABEL_1056; | 5552 { |
5553 LODWORD(v727) = 1; | |
5554 goto play_sound_and_continue; | |
5555 } | |
5491 if ( v731 == 4 ) | 5556 if ( v731 == 4 ) |
5492 goto LABEL_637; | 5557 { |
5558 *(int *)v324 = 0; | |
5559 *((int *)v324 + 1) = 0; | |
5560 LODWORD(v727) = 1; | |
5561 goto play_sound_and_continue; | |
5562 } | |
5493 v732 = amount << 7; | 5563 v732 = amount << 7; |
5494 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | 5564 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); |
5495 v656 = 15; | 5565 v656 = 15; |
5496 goto LABEL_640; | 5566 goto LABEL_640; |
5567 | |
5497 case 41: | 5568 case 41: |
5498 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 5569 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
5499 goto play_sound_and_continue; | 5570 goto play_sound_and_continue; |
5500 a1.stru_24.Reset(); | 5571 a1.stru_24.Reset(); |
5501 a1.spell_id = v3->spellnum; | 5572 a1.spell_id = v3->spellnum; |
5509 a1.uSectorID = pIndoor->GetSector( | 5580 a1.uSectorID = pIndoor->GetSector( |
5510 pParty->vPosition.x, | 5581 pParty->vPosition.x, |
5511 pParty->vPosition.y, | 5582 pParty->vPosition.y, |
5512 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); | 5583 pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3); |
5513 a1.uSpriteFrameID = 0; | 5584 a1.uSpriteFrameID = 0; |
5514 v326 = 8 * v3->uPlayerID; | 5585 a1.spell_caster_pid = PID(OBJECT_Player, v3->uPlayerID); |
5515 LOBYTE(v326) = v326 | OBJECT_Player; | |
5516 a1.spell_caster_pid = v326; | |
5517 a1.spell_target_pid = a2; | 5586 a1.spell_target_pid = a2; |
5518 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | 5587 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); |
5519 a1.uFacing = LOWORD(pParty->sRotationY); | 5588 a1.uFacing = LOWORD(pParty->sRotationY); |
5520 a1.uSoundID = LOWORD(v3->sound_id); | 5589 a1.uSoundID = LOWORD(v3->sound_id); |
5521 if ( pParty->bTurnBasedModeOn == 1 ) | 5590 if ( pParty->bTurnBasedModeOn == 1 ) |
5522 LOBYTE(a1.uAttributes) |= 4u; | 5591 LOBYTE(a1.uAttributes) |= 4u; |
5523 v669 = v3->uPlayerID + 1; | 5592 |
5524 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | 5593 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; |
5525 v654 = pParty->sRotationX; | 5594 if ( a1.Create(pParty->sRotationY, pParty->sRotationX, v659, v3->uPlayerID + 1) != -1 && pParty->bTurnBasedModeOn == 1 ) |
5526 goto LABEL_125; | 5595 ++pTurnEngine->field_1C; |
5596 LODWORD(v727) = 1; | |
5597 goto play_sound_and_continue; | |
5598 | |
5527 case 43: | 5599 case 43: |
5528 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | 5600 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) |
5529 { | 5601 { |
5530 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed | 5602 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed |
5531 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | 5603 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
5532 goto LABEL_203; | 5604 v3->spellnum = 0; |
5605 goto LABEL_1166; | |
5533 } | 5606 } |
5534 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 5607 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
5535 goto play_sound_and_continue; | 5608 goto play_sound_and_continue; |
5536 a1.uType = 4090; | 5609 a1.uType = 4090; |
5537 a1.stru_24.Reset(); | 5610 a1.stru_24.Reset(); |
5550 a1.spell_target_pid = a2; | 5623 a1.spell_target_pid = a2; |
5551 a1.uFacing = LOWORD(pParty->sRotationY); | 5624 a1.uFacing = LOWORD(pParty->sRotationY); |
5552 a1.uSoundID = LOWORD(v3->sound_id); | 5625 a1.uSoundID = LOWORD(v3->sound_id); |
5553 if ( pParty->bTurnBasedModeOn == 1 ) | 5626 if ( pParty->bTurnBasedModeOn == 1 ) |
5554 a1.uAttributes = 4; | 5627 a1.uAttributes = 4; |
5555 v669 = 0; | 5628 |
5556 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; | 5629 v659 = pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed; |
5557 v35 = (signed int)stru_5C6E00->uIntegerHalfPi / 2; | 5630 if ( a1.Create(pParty->sRotationY, stru_5C6E00->uIntegerHalfPi / 2, v659, 0) != -1 && pParty->bTurnBasedModeOn == 1 ) |
5558 LABEL_124: | 5631 ++pTurnEngine->field_1C; |
5559 v654 = v35; | 5632 LODWORD(v727) = 1; |
5560 LABEL_125: | 5633 goto play_sound_and_continue; |
5561 v36 = pParty->sRotationY; | |
5562 goto LABEL_157; | |
5563 | 5634 |
5564 case SPELL_SPIRIT_DETECT_LIFE: | 5635 case SPELL_SPIRIT_DETECT_LIFE: |
5565 v328 = v731 - 2; | 5636 v328 = v731 - 2; |
5566 if ( v328 ) | 5637 if ( v328 ) |
5567 { | 5638 { |
5580 goto play_sound_and_continue; | 5651 goto play_sound_and_continue; |
5581 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); | 5652 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); |
5582 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | 5653 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); |
5583 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | 5654 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); |
5584 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | 5655 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); |
5585 v83 = 1; | |
5586 | |
5587 v732 = (int)v733 << 7; | |
5588 | 5656 |
5589 pParty->pPartyBuffs[PARTY_BUFF_DETECT_LIFE].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, 0, 0, 0); | 5657 pParty->pPartyBuffs[PARTY_BUFF_DETECT_LIFE].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, 0, 0, 0); |
5590 LODWORD(v727) = v83; | 5658 LODWORD(v727) = 1; |
5591 | |
5592 goto play_sound_and_continue; | 5659 goto play_sound_and_continue; |
5593 | 5660 |
5594 case SPELL_SPIRIT_FATE: | 5661 case SPELL_SPIRIT_FATE: |
5595 LODWORD(v733) = 300; | 5662 LODWORD(v733) = 300; |
5596 v339 = v731 - 2; | 5663 v339 = v731 - 2; |
5623 if ( v342 == 0 ) | 5690 if ( v342 == 0 ) |
5624 { | 5691 { |
5625 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | 5692 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); |
5626 | 5693 |
5627 pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_FATE].Apply(pParty->uTimePlayed + 1280, v731, amount, 0, 0); | 5694 pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_FATE].Apply(pParty->uTimePlayed + 1280, v731, amount, 0, 0); |
5628 goto LABEL_1056; | 5695 LODWORD(v727) = 1; |
5629 } | 5696 goto play_sound_and_continue; |
5630 if ( (v342 & 7) == OBJECT_Actor) | 5697 } |
5698 if (PID_TYPE(v342) == OBJECT_Actor) | |
5631 { | 5699 { |
5632 v343 = v342 >> 3; | 5700 v343 = v342 >> 3; |
5633 HIDWORD(v344) = 0 + ((pParty->uTimePlayed + 1280) >> 32); | 5701 HIDWORD(v344) = 0 + ((pParty->uTimePlayed + 1280) >> 32); |
5634 LODWORD(v344) = LODWORD(pParty->uTimePlayed) + 1280; | 5702 LODWORD(v344) = LODWORD(pParty->uTimePlayed) + 1280; |
5635 pActors[v343].pActorBuffs[11].Apply(v344, v731, amount, 0, 0); | 5703 pActors[v343].pActorBuffs[11].Apply(v344, v731, amount, 0, 0); |
5637 v672 = 0; | 5705 v672 = 0; |
5638 v661 = &pActors[v343]; | 5706 v661 = &pActors[v343]; |
5639 LABEL_165: | 5707 LABEL_165: |
5640 pGame->GetStru6()->_4A7E89_sparkles_on_actor_after_it_casts_buff(v661, v672); | 5708 pGame->GetStru6()->_4A7E89_sparkles_on_actor_after_it_casts_buff(v661, v672); |
5641 } | 5709 } |
5642 goto LABEL_1056; | 5710 LODWORD(v727) = 1; |
5711 goto play_sound_and_continue; | |
5643 | 5712 |
5644 case 49: | 5713 case 49: |
5645 v348 = v731 - 2; | 5714 v348 = v731 - 2; |
5646 if ( !v348 ) | 5715 if ( !v348 ) |
5647 goto LABEL_677; | 5716 goto LABEL_677; |
5664 LABEL_679: | 5733 LABEL_679: |
5665 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 5734 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
5666 goto play_sound_and_continue; | 5735 goto play_sound_and_continue; |
5667 v351 = &pParty->pPlayers[v3->uPlayerID_2]; | 5736 v351 = &pParty->pPlayers[v3->uPlayerID_2]; |
5668 if ( !v351->pConditions[0] ) | 5737 if ( !v351->pConditions[0] ) |
5669 goto LABEL_1056; | 5738 { |
5739 LODWORD(v727) = 1; | |
5740 goto play_sound_and_continue; | |
5741 } | |
5670 if ( v731 == 4 ) | 5742 if ( v731 == 4 ) |
5671 { | 5743 { |
5672 LODWORD(v351->pConditions[0]) = 0; | 5744 LODWORD(v351->pConditions[0]) = 0; |
5673 HIDWORD(v351->pConditions[0]) = 0; | 5745 HIDWORD(v351->pConditions[0]) = 0; |
5674 goto LABEL_904; | 5746 } |
5675 } | 5747 else |
5676 v732 = amount << 7; | 5748 { |
5677 v351->DiscardConditionIfLastsLongerThan( | 5749 v732 = amount << 7; |
5678 0, | 5750 v351->DiscardConditionIfLastsLongerThan(0, (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335)); |
5679 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335)); | 5751 if ( HIDWORD(pParty->pPlayers[v3->uPlayerID_2].pConditions[0]) | LODWORD(pParty->pPlayers[v3->uPlayerID_2].pConditions[0]) ) |
5680 if ( HIDWORD(pParty->pPlayers[v3->uPlayerID_2].pConditions[0]) | LODWORD(pParty->pPlayers[v3->uPlayerID_2].pConditions[0]) ) | 5752 { |
5681 goto LABEL_1056; | 5753 LODWORD(v727) = 1; |
5682 v674 = v3->uPlayerID_2; | 5754 goto play_sound_and_continue; |
5683 goto LABEL_685; | 5755 } |
5756 } | |
5757 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | |
5758 LODWORD(v727) = 1; | |
5759 goto play_sound_and_continue; | |
5760 | |
5684 case SPELL_SPIRIT_PRESERVATION: | 5761 case SPELL_SPIRIT_PRESERVATION: |
5685 v354 = v731 - 2; | 5762 v354 = v731 - 2; |
5686 if ( v354 && (v355 = v354 - 1) != 0 && v355 == 1 ) | 5763 if ( v354 && (v355 = v354 - 1) != 0 && v355 == 1 ) |
5687 v356 = 900 * (v2 + 4); | 5764 v356 = 900 * (v2 + 4); |
5688 else | 5765 else |
5692 goto play_sound_and_continue; | 5769 goto play_sound_and_continue; |
5693 if ( v731 == 1 || v731 == 2 ) | 5770 if ( v731 == 1 || v731 == 2 ) |
5694 { | 5771 { |
5695 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | 5772 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); |
5696 | 5773 |
5697 v732 = (int)v733 << 7; | |
5698 | |
5699 pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_PRESERVATION].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, 0, 0, 0); | 5774 pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_PRESERVATION].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, 0, 0, 0); |
5700 goto LABEL_1056; | 5775 LODWORD(v727) = 1; |
5776 goto play_sound_and_continue; | |
5701 } | 5777 } |
5702 a2 = 0; | 5778 a2 = 0; |
5703 v732 = (int)v733 << 7; | |
5704 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | 5779 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); |
5705 v357 = pParty->pPlayers;//[0].pPlayerBuffs[11]; | 5780 v357 = pParty->pPlayers;//[0].pPlayerBuffs[11]; |
5706 do | 5781 do |
5707 { | 5782 { |
5708 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, a2); | 5783 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, a2); |
5709 v357->pPlayerBuffs[PLAYER_BUFF_PRESERVATION].Apply(pParty->uTimePlayed + v717, v731, 0, 0, 0); | 5784 v357->pPlayerBuffs[PLAYER_BUFF_PRESERVATION].Apply(pParty->uTimePlayed + v717, v731, 0, 0, 0); |
5710 ++a2; | 5785 ++a2; |
5711 ++v357;// = (SpellBuff *)((char *)v357 + 6972); | 5786 ++v357;// = (SpellBuff *)((char *)v357 + 6972); |
5712 } | 5787 } |
5713 while ( v357 <= &pParty->pPlayers[3] ); | 5788 while ( v357 <= &pParty->pPlayers[3] ); |
5714 goto LABEL_1056; | 5789 LODWORD(v727) = 1; |
5790 goto play_sound_and_continue; | |
5791 | |
5715 case 48: | 5792 case 48: |
5793 { | |
5716 v364 = v731 - 2; | 5794 v364 = v731 - 2; |
5717 if ( !v364 || (v365 = v364 - 1) != 0 && v365 != 1 ) | 5795 if ( !v364 || (v365 = v364 - 1) != 0 && v365 != 1 ) |
5718 v366 = 60 * (v2 + 3); | 5796 v366 = 60 * (v2 + 3); |
5719 else | 5797 else |
5720 v366 = 300 * v2 + 180; | 5798 v366 = 300 * v2 + 180; |
5721 LODWORD(v733) = v366; | 5799 LODWORD(v733) = v366; |
5722 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 5800 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
5723 goto play_sound_and_continue; | 5801 goto play_sound_and_continue; |
5724 v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096); | 5802 auto _v726 = sub_46A6AC((int)dword_50BF30, 100, 4096); |
5725 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFFFFFFu, 0xC0u); | 5803 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFFFFFFu, 0xC0u); |
5726 ++a1.uType; | 5804 ++a1.uType; |
5727 a1.stru_24.Reset(); | 5805 a1.stru_24.Reset(); |
5728 a1.spell_id = v3->spellnum; | 5806 a1.spell_id = v3->spellnum; |
5729 a1.spell_level = v2; | 5807 a1.spell_level = v2; |
5734 a1.uSpriteFrameID = 0; | 5812 a1.uSpriteFrameID = 0; |
5735 a1.field_60_distance_related_prolly_lod = 0; | 5813 a1.field_60_distance_related_prolly_lod = 0; |
5736 a1.uFacing = 0; | 5814 a1.uFacing = 0; |
5737 a1.spell_caster_pid = PID(OBJECT_Player, v3->uPlayerID); | 5815 a1.spell_caster_pid = PID(OBJECT_Player, v3->uPlayerID); |
5738 a1.uSoundID = LOWORD(v3->sound_id); | 5816 a1.uSoundID = LOWORD(v3->sound_id); |
5739 for ( a2 = 0; a2 < (signed int)v726; ++a2 ) | 5817 for ( a2 = 0; a2 < (signed int)_v726; ++a2 ) |
5740 { | 5818 { |
5741 v369 = &pActors[dword_50BF30[a2]]; | 5819 v369 = &pActors[dword_50BF30[a2]]; |
5742 if ( MonsterStats::BelongsToSupertype(v369->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | 5820 if ( MonsterStats::BelongsToSupertype(v369->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) |
5743 { | 5821 { |
5744 a1.vPosition.x = v369->vPosition.x; | 5822 a1.vPosition.x = v369->vPosition.x; |
5745 a1.vPosition.y = v369->vPosition.y; | 5823 a1.vPosition.y = v369->vPosition.y; |
5746 v732 = v369->uActorHeight; | 5824 a1.vPosition.z = v369->vPosition.z - (unsigned int)(signed __int64)((double)v369->uActorHeight * unk_4D8548); |
5747 a1.vPosition.z = v369->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | 5825 |
5748 v370 = 8 * dword_50BF30[a2]; | 5826 a1.spell_target_pid = PID(OBJECT_Actor, dword_50BF30[a2]); |
5749 LOBYTE(v370) = v370 | OBJECT_Actor; | |
5750 a1.spell_target_pid = v370; | |
5751 a1.Create(0, 0, 0, 0); | 5827 a1.Create(0, 0, 0, 0); |
5752 v732 = (int)v733 << 7; | |
5753 v369->pActorBuffs[4].Apply( | 5828 v369->pActorBuffs[4].Apply( |
5754 pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), | 5829 pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), |
5755 v731, 0, 0, 0); | 5830 v731, 0, 0, 0); |
5756 } | 5831 } |
5757 } | 5832 } |
5758 goto LABEL_1056; | 5833 LODWORD(v727) = 1; |
5834 } | |
5835 goto play_sound_and_continue; | |
5836 | |
5759 case 53: | 5837 case 53: |
5760 v371 = v731 - 2; | 5838 v371 = v731 - 2; |
5761 if ( v371 && (v372 = v371 - 1) != 0 && v372 == 1 ) | 5839 if ( v371 && (v372 = v371 - 1) != 0 && v372 == 1 ) |
5762 amount = 0; | 5840 amount = 0; |
5763 else | 5841 else |
5765 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 5843 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
5766 goto play_sound_and_continue; | 5844 goto play_sound_and_continue; |
5767 pOtherOverlayList->_4418B1(5080, v3->uPlayerID_2 + 100, 0, 65536); | 5845 pOtherOverlayList->_4418B1(5080, v3->uPlayerID_2 + 100, 0, 65536); |
5768 v373 = v3->uPlayerID_2; | 5846 v373 = v3->uPlayerID_2; |
5769 if ( !(HIDWORD(pParty->pPlayers[v373].pConditions[14]) | LODWORD(pParty->pPlayers[v373].pConditions[14])) ) | 5847 if ( !(HIDWORD(pParty->pPlayers[v373].pConditions[14]) | LODWORD(pParty->pPlayers[v373].pConditions[14])) ) |
5770 goto LABEL_1056; | 5848 { |
5849 LODWORD(v727) = 1; | |
5850 goto play_sound_and_continue; | |
5851 } | |
5771 v14 = v731 == 4; | 5852 v14 = v731 == 4; |
5772 pParty->pPlayers[v373].sHealth = 1; | 5853 pParty->pPlayers[v373].sHealth = 1; |
5773 if ( v14 ) | 5854 if ( v14 ) |
5774 { | 5855 { |
5775 v374 = v3->uPlayerID_2; | 5856 v374 = v3->uPlayerID_2; |
5779 LODWORD(pParty->pPlayers[v376].pConditions[13]) = 0; | 5860 LODWORD(pParty->pPlayers[v376].pConditions[13]) = 0; |
5780 HIDWORD(pParty->pPlayers[v376].pConditions[13]) = 0; | 5861 HIDWORD(pParty->pPlayers[v376].pConditions[13]) = 0; |
5781 } | 5862 } |
5782 else | 5863 else |
5783 { | 5864 { |
5784 v732 = amount << 7; | |
5785 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | 5865 *(float *)&a2 = (double)(amount << 7) * 0.033333335; |
5786 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | 5866 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( |
5787 0xEu, | 5867 0xEu, |
5788 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | 5868 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); |
5789 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | 5869 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( |
5825 HIDWORD(v733) = 0; | 5905 HIDWORD(v733) = 0; |
5826 if ( v381 > 0 ) | 5906 if ( v381 > 0 ) |
5827 { | 5907 { |
5828 do | 5908 do |
5829 { | 5909 { |
5830 v385 = 4 * v682[HIDWORD(v733)] + 10965188; | 5910 //v385 = (ItemGen **)&pPlayers[v682[HIDWORD(v733)]]; |
5831 pPlayers[v682[HIDWORD(v733)]]->sHealth = v732; | 5911 v726 = pPlayers[v682[HIDWORD(v733)]]; |
5832 v726 = *(Player **)v385; | 5912 v726->sHealth = v732; |
5833 v386 = v726->GetMaxHealth(); | 5913 //v386 = v726->GetMaxHealth(); |
5834 if ( v726->sHealth > v386 ) | 5914 if ( v726->sHealth > v726->GetMaxHealth()) |
5835 *(int *)(*(int *)v385 + 6460) = v726->GetMaxHealth(); | 5915 v726->sHealth = v726->GetMaxHealth(); |
5836 v387 = *(Player **)v385; | 5916 if ( v726->sHealth > 0 ) |
5837 if ( v387->sHealth > 0 ) | |
5838 { | 5917 { |
5839 LODWORD(v387->pConditions[13]) = 0; | 5918 v726->pConditions[Player::Condition_Unconcious] = 0; |
5840 HIDWORD(v387->pConditions[13]) = 0; | |
5841 } | 5919 } |
5842 v388 = HIDWORD(v733); | 5920 v388 = HIDWORD(v733); |
5843 | 5921 |
5844 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, LOWORD(v682[HIDWORD(v733)]) - 1); | 5922 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, LOWORD(v682[HIDWORD(v733)]) - 1); |
5845 HIDWORD(v733) = v388 + 1; | 5923 HIDWORD(v733) = v388 + 1; |
5846 } | 5924 } |
5847 while ( v388 + 1 < v730 ); | 5925 while ( v388 + 1 < v730 ); |
5848 } | 5926 } |
5849 goto LABEL_1056; | 5927 LODWORD(v727) = 1; |
5928 goto play_sound_and_continue; | |
5850 | 5929 |
5851 case 55: | 5930 case 55: |
5852 v392 = v731 - 1; | 5931 v392 = v731 - 1; |
5853 if ( !v392 ) | 5932 if ( !v392 ) |
5854 { | 5933 { |
5892 LODWORD(pParty->pPlayers[v399].pConditions[13]) = 0; | 5971 LODWORD(pParty->pPlayers[v399].pConditions[13]) = 0; |
5893 HIDWORD(pParty->pPlayers[v399].pConditions[13]) = 0; | 5972 HIDWORD(pParty->pPlayers[v399].pConditions[13]) = 0; |
5894 } | 5973 } |
5895 else | 5974 else |
5896 { | 5975 { |
5897 v732 = amount << 7; | |
5898 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | 5976 *(float *)&a2 = (double)(amount << 7) * 0.033333335; |
5899 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | 5977 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( 0x10u, |
5900 0x10u, | |
5901 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | 5978 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); |
5902 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | 5979 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( 0xEu, |
5903 0xEu, | |
5904 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | 5980 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); |
5905 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | 5981 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( 0xDu, |
5906 0xDu, | |
5907 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | 5982 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); |
5908 } | 5983 } |
5909 v83 = 1; | |
5910 pParty->pPlayers[v3->uPlayerID_2].SetCondition(1u, 1); | 5984 pParty->pPlayers[v3->uPlayerID_2].SetCondition(1u, 1); |
5911 | 5985 |
5912 pParty->pPlayers[v3->uPlayerID_2].sHealth = 1; | 5986 pParty->pPlayers[v3->uPlayerID_2].sHealth = 1; |
5913 | 5987 |
5914 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | 5988 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); |
5915 } | 5989 } |
5916 else | 5990 LODWORD(v727) = 1; |
5917 { | |
5918 v83 = 1; | |
5919 } | |
5920 LODWORD(v727) = v83; | |
5921 goto play_sound_and_continue; | 5991 goto play_sound_and_continue; |
5922 | 5992 |
5923 case 61: | 5993 case 61: |
5924 v405 = v731 - 2; | 5994 v405 = v731 - 2; |
5925 if ( !v405 ) | 5995 if ( !v405 ) |
5946 | 6016 |
5947 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | 6017 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); |
5948 v323 = v3->uPlayerID_2; | 6018 v323 = v3->uPlayerID_2; |
5949 v324 = (char *)&pParty->pPlayers[v323].pConditions[12]; | 6019 v324 = (char *)&pParty->pPlayers[v323].pConditions[12]; |
5950 if ( !pParty->pPlayers[v323].pConditions[12] ) | 6020 if ( !pParty->pPlayers[v323].pConditions[12] ) |
5951 goto LABEL_1056; | 6021 { |
6022 LODWORD(v727) = 1; | |
6023 goto play_sound_and_continue; | |
6024 } | |
5952 if ( v731 == 4 ) | 6025 if ( v731 == 4 ) |
5953 goto LABEL_637; | 6026 { |
5954 v732 = amount << 7; | 6027 *(int *)v324 = 0; |
6028 *((int *)v324 + 1) = 0; | |
6029 LODWORD(v727) = 1; | |
6030 goto play_sound_and_continue; | |
6031 } | |
5955 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | 6032 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); |
5956 v656 = 12; | 6033 v656 = 12; |
5957 goto LABEL_640; | 6034 goto LABEL_640; |
6035 | |
6036 | |
5958 case 56: | 6037 case 56: |
5959 v411 = v731 - 2; | 6038 v411 = v731 - 2; |
5960 if ( v411 ) | 6039 if ( v411 ) |
5961 { | 6040 { |
5962 v412 = v411 - 1; | 6041 v412 = v411 - 1; |
5985 | 6064 |
5986 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | 6065 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); |
5987 v323 = v3->uPlayerID_2; | 6066 v323 = v3->uPlayerID_2; |
5988 v324 = (char *)&pParty->pPlayers[v323].pConditions[3]; | 6067 v324 = (char *)&pParty->pPlayers[v323].pConditions[3]; |
5989 if ( !pParty->pPlayers[v323].pConditions[3] ) | 6068 if ( !pParty->pPlayers[v323].pConditions[3] ) |
5990 goto LABEL_1056; | 6069 { |
6070 LODWORD(v727) = 1; | |
6071 goto play_sound_and_continue; | |
6072 } | |
5991 if ( v731 == 4 ) | 6073 if ( v731 == 4 ) |
5992 goto LABEL_637; | 6074 { |
5993 v732 = amount << 7; | 6075 *(int *)v324 = 0; |
6076 *((int *)v324 + 1) = 0; | |
6077 LODWORD(v727) = 1; | |
6078 goto play_sound_and_continue; | |
6079 } | |
5994 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | 6080 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); |
5995 v656 = 3; | 6081 v656 = 3; |
5996 goto LABEL_640; | 6082 goto LABEL_640; |
6083 | |
5997 case 59: | 6084 case 59: |
5998 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 6085 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
5999 goto play_sound_and_continue; | 6086 goto play_sound_and_continue; |
6000 if ( a2 == 0 || (a2 & 7) != OBJECT_Actor) | 6087 if (PID_TYPE(a2) != OBJECT_Actor) |
6001 goto LABEL_1056; | 6088 { |
6002 v417 = (int)&pActors[a2 >> 3]; | 6089 LODWORD(v727) = 1; |
6090 goto play_sound_and_continue; | |
6091 } | |
6092 v417 = (int)&pActors[PID_ID(a2)]; | |
6003 v730 = v417; | 6093 v730 = v417; |
6004 if ( !(*(char *)(v417 + 38) & 0x80) ) | 6094 if ( !(*(char *)(v417 + 38) & 0x80) ) |
6005 { | 6095 { |
6006 ((Actor *)v417)->SetRandomGoldIfTheresNoItem(); | 6096 ((Actor *)v417)->SetRandomGoldIfTheresNoItem(); |
6007 v417 = v730; | 6097 v417 = v730; |
6086 v425 = 600 * v2; | 6176 v425 = 600 * v2; |
6087 } | 6177 } |
6088 amount = v425; | 6178 amount = v425; |
6089 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 6179 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
6090 goto play_sound_and_continue; | 6180 goto play_sound_and_continue; |
6091 v426 = a2 >> 3; | 6181 v426 = PID_ID(a2); |
6092 if ( (a2 & 7) != OBJECT_Actor) | 6182 if (PID_TYPE(a2) != OBJECT_Actor) |
6093 goto LABEL_1056; | 6183 { |
6184 LODWORD(v727) = 1; | |
6185 goto play_sound_and_continue; | |
6186 } | |
6094 v730 = 836 * v426; | 6187 v730 = 836 * v426; |
6095 if ( stru_50C198.GetMagicalResistance(&pActors[v426], 7u) ) | 6188 if ( stru_50C198.GetMagicalResistance(&pActors[v426], 7u) ) |
6096 { | 6189 { |
6097 pActors[v426].pActorBuffs[1].Reset(); | 6190 pActors[v426].pActorBuffs[1].Reset(); |
6098 pActors[v426].pActorBuffs[12].Reset(); | 6191 pActors[v426].pActorBuffs[12].Reset(); |
6099 v732 = amount << 7; | |
6100 pActors[v426].pActorBuffs[9].Apply( | 6192 pActors[v426].pActorBuffs[9].Apply( |
6101 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), | 6193 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), |
6102 v731, 0, 0, 0); | 6194 v731, 0, 0, 0); |
6103 pActors[v426].pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long; | 6195 pActors[v426].pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long; |
6104 } | 6196 } |
6107 a1.spell_level = v2; | 6199 a1.spell_level = v2; |
6108 a1.spell_skill = v731; | 6200 a1.spell_skill = v731; |
6109 v60 = pObjectList->ObjectIDByItemID(a1.uType); | 6201 v60 = pObjectList->ObjectIDByItemID(a1.uType); |
6110 v61 = v426; | 6202 v61 = v426; |
6111 goto LABEL_1086; | 6203 goto LABEL_1086; |
6204 | |
6205 | |
6112 case 66: | 6206 case 66: |
6113 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 6207 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
6114 goto play_sound_and_continue; | 6208 goto play_sound_and_continue; |
6115 amount = 600 * v2; | 6209 amount = 600 * v2; |
6116 v427 = a2 >> 3; | 6210 if (PID_TYPE(a2) != OBJECT_Actor) |
6117 if ( (a2 & 7) != OBJECT_Actor) | 6211 { |
6118 goto LABEL_1056; | 6212 LODWORD(v727) = 1; |
6119 v730 = 836 * v427; | 6213 goto play_sound_and_continue; |
6120 if ( MonsterStats::BelongsToSupertype(pActors[v427].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | 6214 } |
6121 goto play_sound_and_continue; | 6215 v730 = 836 * PID_ID(a2); |
6122 if ( stru_50C198.GetMagicalResistance(&pActors[v427], 7u) ) | 6216 if ( MonsterStats::BelongsToSupertype(pActors[PID_ID(a2)].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) |
6123 { | 6217 goto play_sound_and_continue; |
6124 pActors[v427].pActorBuffs[9].Reset(); | 6218 if ( stru_50C198.GetMagicalResistance(&pActors[PID_ID(a2)], 7u) ) |
6125 pActors[v427].pActorBuffs[1].Reset(); | 6219 { |
6126 v732 = amount << 7; | 6220 pActors[PID_ID(a2)].pActorBuffs[9].Reset(); |
6127 pActors[v427].pActorBuffs[12].Apply( | 6221 pActors[PID_ID(a2)].pActorBuffs[1].Reset(); |
6128 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), | 6222 pActors[PID_ID(a2)].pActorBuffs[12].Apply(pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), |
6129 v731, 0, 0, 0); | 6223 v731, 0, 0, 0); |
6130 } | 6224 } |
6131 a1.stru_24.Reset(); | 6225 a1.stru_24.Reset(); |
6132 a1.spell_id = v3->spellnum; | 6226 a1.spell_id = v3->spellnum; |
6133 a1.spell_level = v2; | 6227 a1.spell_level = v2; |
6134 a1.spell_skill = v731; | 6228 a1.spell_skill = v731; |
6135 v60 = pObjectList->ObjectIDByItemID(a1.uType); | 6229 v60 = pObjectList->ObjectIDByItemID(a1.uType); |
6136 v61 = v427; | 6230 v61 = PID_ID(a2); |
6137 goto LABEL_1086; | 6231 goto LABEL_1086; |
6232 | |
6138 case 63: | 6233 case 63: |
6234 { | |
6139 v428 = v731 - 2; | 6235 v428 = v731 - 2; |
6140 if ( v428 && (v429 = v428 - 1) != 0 && v429 == 1 ) | 6236 if ( v428 && (v429 = v428 - 1) != 0 && v429 == 1 ) |
6141 v430 = 300 * v2; | 6237 v430 = 300 * v2; |
6142 else | 6238 else |
6143 v430 = 180 * v2; | 6239 v430 = 180 * v2; |
6144 amount = v430; | 6240 amount = v430; |
6145 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 6241 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
6146 goto play_sound_and_continue; | 6242 goto play_sound_and_continue; |
6147 v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096); | 6243 auto _v726 = sub_46A6AC((int)dword_50BF30, 100, 4096); |
6148 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xA0A0Au, 0xC0u); | 6244 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xA0A0Au, 0xC0u); |
6149 ++a1.uType; | 6245 ++a1.uType; |
6150 a1.stru_24.Reset(); | 6246 a1.stru_24.Reset(); |
6151 a1.spell_id = v3->spellnum; | 6247 a1.spell_id = v3->spellnum; |
6152 a1.spell_level = v2; | 6248 a1.spell_level = v2; |
6157 a1.uSpriteFrameID = 0; | 6253 a1.uSpriteFrameID = 0; |
6158 a1.field_60_distance_related_prolly_lod = 0; | 6254 a1.field_60_distance_related_prolly_lod = 0; |
6159 a1.uFacing = 0; | 6255 a1.uFacing = 0; |
6160 a1.spell_caster_pid = PID(OBJECT_Player, v3->uPlayerID); | 6256 a1.spell_caster_pid = PID(OBJECT_Player, v3->uPlayerID); |
6161 a1.uSoundID = LOWORD(v3->sound_id); | 6257 a1.uSoundID = LOWORD(v3->sound_id); |
6162 for ( a2 = 0; a2 < (signed int)v726; ++a2 ) | 6258 for ( a2 = 0; a2 < (signed int)_v726; ++a2 ) |
6163 { | 6259 { |
6164 v433 = &pActors[dword_50BF30[a2]]; | 6260 v433 = &pActors[dword_50BF30[a2]]; |
6165 if ( MonsterStats::BelongsToSupertype(v433->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | 6261 if ( MonsterStats::BelongsToSupertype(v433->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) |
6166 break; | 6262 break; |
6167 a1.vPosition.x = v433->vPosition.x; | 6263 a1.vPosition.x = v433->vPosition.x; |
6168 a1.vPosition.y = v433->vPosition.y; | 6264 a1.vPosition.y = v433->vPosition.y; |
6169 v732 = v433->uActorHeight; | 6265 a1.vPosition.z = v433->vPosition.z - (unsigned int)(signed __int64)((double)v433->uActorHeight * unk_4D8548); |
6170 a1.vPosition.z = v433->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | 6266 |
6171 v434 = 8 * dword_50BF30[a2]; | 6267 a1.spell_target_pid = PID(OBJECT_Actor, dword_50BF30[a2]); |
6172 LOBYTE(v434) = v434 | OBJECT_Actor; | |
6173 a1.spell_target_pid = v434; | |
6174 a1.Create(0, 0, 0, 0); | 6268 a1.Create(0, 0, 0, 0); |
6175 if ( stru_50C198.GetMagicalResistance(v433, 7u) ) | 6269 if ( stru_50C198.GetMagicalResistance(v433, 7u) ) |
6176 { | 6270 { |
6177 v732 = amount << 7; | 6271 v433->pActorBuffs[4].Apply(pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), |
6178 v433->pActorBuffs[4].Apply( | |
6179 pParty->uTimePlayed + (signed __int64)((double)(amount << 7) * 0.033333335), | |
6180 v731, 0, 0, 0); | 6272 v731, 0, 0, 0); |
6181 } | 6273 } |
6182 } | 6274 } |
6183 goto LABEL_1056; | 6275 LODWORD(v727) = 1; |
6276 goto play_sound_and_continue; | |
6277 } | |
6278 | |
6184 case 64: | 6279 case 64: |
6185 v435 = v731 - 2; | 6280 v435 = v731 - 2; |
6186 if ( v435 && (v436 = v435 - 1) != 0 && v436 == 1 ) | 6281 if ( v435 && (v436 = v435 - 1) != 0 && v436 == 1 ) |
6187 amount = 0; | 6282 amount = 0; |
6188 else | 6283 else |
6202 LODWORD(pParty->pPlayers[v441].pConditions[5]) = 0; | 6297 LODWORD(pParty->pPlayers[v441].pConditions[5]) = 0; |
6203 HIDWORD(pParty->pPlayers[v441].pConditions[5]) = 0; | 6298 HIDWORD(pParty->pPlayers[v441].pConditions[5]) = 0; |
6204 } | 6299 } |
6205 else | 6300 else |
6206 { | 6301 { |
6207 v732 = amount << 7; | 6302 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan(5u, |
6208 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | |
6209 5u, | |
6210 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335)); | 6303 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335)); |
6211 } | 6304 } |
6212 v377 = &pParty->pPlayers[v3->uPlayerID_2]; | 6305 v377 = &pParty->pPlayers[v3->uPlayerID_2]; |
6213 LABEL_720: | 6306 LABEL_720: |
6214 v377->SetCondition(1, 0); | 6307 v377->SetCondition(1, 0); |
6215 } | 6308 } |
6216 goto LABEL_1056; | 6309 LODWORD(v727) = 1; |
6310 goto play_sound_and_continue; | |
6311 | |
6217 case 42: | 6312 case 42: |
6218 v442 = v731 - 2; | 6313 v442 = v731 - 2; |
6219 if ( !v442 ) | 6314 if ( !v442 ) |
6220 goto LABEL_855; | 6315 goto LABEL_855; |
6221 v443 = v442 - 1; | 6316 v443 = v442 - 1; |
6232 v444 = 3 * v2; | 6327 v444 = 3 * v2; |
6233 } | 6328 } |
6234 amount = v444; | 6329 amount = v444; |
6235 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 6330 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
6236 goto play_sound_and_continue; | 6331 goto play_sound_and_continue; |
6237 v445 = a2 >> 3; | 6332 v445 = PID_ID(a2); |
6238 if ( (a2 & 7) == OBJECT_Item) | 6333 if (PID_TYPE(a2) == OBJECT_Item) |
6239 { | 6334 { |
6240 v449 = (char *)&pSpriteObjects[v445].stru_24; | 6335 v449 = (char *)&pSpriteObjects[v445].stru_24; |
6241 v450 = *(int *)v449; | 6336 v450 = *(int *)v449; |
6242 if ( pItemsTable->pItems[v450].uEquipType == 18 ) | 6337 if ( pItemsTable->pItems[v450].uEquipType == 18 ) |
6243 { | 6338 { |
6244 party_finds_gold(*((int *)v449 + 3), 0); | 6339 party_finds_gold(*((int *)v449 + 3), 0); |
6245 viewparams->bRedrawGameUI = 1; | 6340 viewparams->bRedrawGameUI = 1; |
6246 } | 6341 } |
6247 else | 6342 else |
6248 { | 6343 { |
6249 sprintfex(pTmpBuf2, (char*)pGlobalTXT_LocalizationStrings[471], pItemsTable->pItems[v450].pUnidentifiedName); | 6344 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], pItemsTable->pItems[v450].pUnidentifiedName); |
6250 ShowStatusBarString(pTmpBuf2, 2u); | 6345 ShowStatusBarString(pTmpBuf2, 2u); |
6251 if ( !pParty->AddItem(&pSpriteObjects[v445].stru_24) ) | 6346 if ( !pParty->AddItem(&pSpriteObjects[v445].stru_24) ) |
6252 pParty->SetHoldingItem(&pSpriteObjects[v445].stru_24); | 6347 pParty->SetHoldingItem(&pSpriteObjects[v445].stru_24); |
6253 } | 6348 } |
6254 SpriteObject::OnInteraction(v445); | 6349 SpriteObject::OnInteraction(v445); |
6255 } | 6350 } |
6256 else | 6351 else |
6257 { | 6352 { |
6258 if ( (a2 & 7) == OBJECT_Actor) | 6353 if (PID_TYPE(a2) == OBJECT_Actor) |
6259 { | 6354 { |
6260 stru_50C198.LootActor(&pActors[v445]); | 6355 stru_50C198.LootActor(&pActors[v445]); |
6261 } | 6356 } |
6262 else | 6357 else |
6263 { | 6358 { |
6264 if ( (a2 & 7) != OBJECT_Decoration) | 6359 if (PID_TYPE(a2) != OBJECT_Decoration) |
6265 { | 6360 { |
6266 if ( (a2 & 7) != OBJECT_BModel) | 6361 if (PID_TYPE(a2) != OBJECT_BModel) |
6267 goto LABEL_1056; | 6362 { |
6363 LODWORD(v727) = 1; | |
6364 goto play_sound_and_continue; | |
6365 } | |
6268 dword_507CD8 = 1; | 6366 dword_507CD8 = 1; |
6269 v677 = 1; | 6367 v677 = 1; |
6270 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | 6368 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) |
6271 v446 = pIndoor->pFaceExtras[pIndoor->pFaces[v445].uFaceExtraID].uEventID; | 6369 v446 = pIndoor->pFaceExtras[pIndoor->pFaces[v445].uFaceExtraID].uEventID; |
6272 else | 6370 else |
6273 v446 = pOutdoor->pBModels[a2 >> 9].pFaces[v445 & 0x3F].sCogTriggeredID; | 6371 v446 = pOutdoor->pBModels[a2 >> 9].pFaces[v445 & 0x3F].sCogTriggeredID; |
6274 goto LABEL_866; | 6372 |
6373 EventProcessor(v446, a2, v677); | |
6374 LODWORD(v727) = 1; | |
6375 goto play_sound_and_continue; | |
6275 } | 6376 } |
6276 v447 = &pLevelDecorations[v445]; | 6377 v447 = &pLevelDecorations[v445]; |
6277 dword_507CD8 = 1; | 6378 dword_507CD8 = 1; |
6278 v448 = v447->field_16_event_id; | 6379 v448 = v447->field_16_event_id; |
6279 if (v448) | 6380 if (v448) |
6280 { | 6381 { |
6281 v677 = 1; | 6382 v677 = 1; |
6282 v446 = v448; | 6383 v446 = v448; |
6283 LABEL_866: | |
6284 EventProcessor(v446, a2, v677); | 6384 EventProcessor(v446, a2, v677); |
6285 goto LABEL_1056; | 6385 LODWORD(v727) = 1; |
6386 goto play_sound_and_continue; | |
6286 } | 6387 } |
6287 if ( v447->IsInteractive() ) | 6388 if ( v447->IsInteractive() ) |
6288 { | 6389 { |
6289 activeLevelDecoration = v447; | 6390 activeLevelDecoration = v447; |
6290 EventProcessor(stru_5E4C90._decor_events[v447->_idx_in_stru123 - 75] + 380, 0, 1); | 6391 EventProcessor(stru_5E4C90._decor_events[v447->_idx_in_stru123 - 75] + 380, 0, 1); |
6291 activeLevelDecoration = NULL; | 6392 activeLevelDecoration = NULL; |
6292 } | 6393 } |
6293 } | 6394 } |
6294 } | 6395 } |
6295 goto LABEL_1056; | 6396 LODWORD(v727) = 1; |
6397 goto play_sound_and_continue; | |
6398 | |
6296 case 67: | 6399 case 67: |
6297 v451 = v731 - 2; | 6400 v451 = v731 - 2; |
6298 if ( v451 ) | 6401 if ( v451 ) |
6299 { | 6402 { |
6300 v452 = v451 - 1; | 6403 v452 = v451 - 1; |
6323 | 6426 |
6324 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | 6427 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); |
6325 v323 = v3->uPlayerID_2; | 6428 v323 = v3->uPlayerID_2; |
6326 v324 = (char *)&pParty->pPlayers[v323].pConditions[1]; | 6429 v324 = (char *)&pParty->pPlayers[v323].pConditions[1]; |
6327 if ( !pParty->pPlayers[v323].pConditions[1] ) | 6430 if ( !pParty->pPlayers[v323].pConditions[1] ) |
6328 goto LABEL_1056; | 6431 { |
6432 LODWORD(v727) = 1; | |
6433 goto play_sound_and_continue; | |
6434 } | |
6329 if ( v731 == 4 ) | 6435 if ( v731 == 4 ) |
6330 { | 6436 { |
6331 LABEL_637: | |
6332 *(int *)v324 = 0; | 6437 *(int *)v324 = 0; |
6333 *((int *)v324 + 1) = 0; | 6438 *((int *)v324 + 1) = 0; |
6334 goto LABEL_1056; | 6439 LODWORD(v727) = 1; |
6335 } | 6440 goto play_sound_and_continue; |
6336 v732 = amount << 7; | 6441 } |
6337 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); | 6442 v663 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed - (double)(amount << 7) * 0.033333335); |
6338 v656 = 1; | 6443 v656 = 1; |
6339 LABEL_640: | 6444 LABEL_640: |
6340 v325 = &pParty->pPlayers[v323]; | 6445 v325 = &pParty->pPlayers[v323]; |
6341 goto LABEL_641; | 6446 goto LABEL_641; |
6447 | |
6342 case 68: | 6448 case 68: |
6343 v457 = v731 - 2; | 6449 v457 = v731 - 2; |
6344 if ( v457 ) | 6450 if ( v457 ) |
6345 { | 6451 { |
6346 v458 = v457 - 1; | 6452 v458 = v457 - 1; |
6365 goto play_sound_and_continue; | 6471 goto play_sound_and_continue; |
6366 v460 = v3->spell_target_pid; | 6472 v460 = v3->spell_target_pid; |
6367 if (!v460) | 6473 if (!v460) |
6368 { | 6474 { |
6369 pParty->pPlayers[v3->uPlayerID_2].Heal(amount); | 6475 pParty->pPlayers[v3->uPlayerID_2].Heal(amount); |
6370 LABEL_904: | 6476 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); |
6371 v674 = v3->uPlayerID_2; | |
6372 LABEL_685: | |
6373 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v674); | |
6374 } | 6477 } |
6375 else | 6478 else |
6376 { | 6479 { |
6377 if ( (v460 & 7) == OBJECT_Actor) | 6480 if (PID_TYPE(v460) == OBJECT_Actor) |
6378 { | 6481 { |
6379 v461 = &pActors[v460 >> 3]; | 6482 v461 = &pActors[PID_ID(v460)]; |
6380 v462 = v461->uAIState; | 6483 v462 = v461->uAIState; |
6381 v463 = v461->pMonsterInfo.uHP; | 6484 v463 = v461->pMonsterInfo.uHP; |
6382 if ( v462 != 5 ) | 6485 if ( v462 != 5 ) |
6383 { | 6486 { |
6384 if ( v462 != 4 ) | 6487 if ( v462 != 4 ) |
6394 } | 6497 } |
6395 } | 6498 } |
6396 } | 6499 } |
6397 } | 6500 } |
6398 } | 6501 } |
6399 goto LABEL_1056; | 6502 LODWORD(v727) = 1; |
6503 goto play_sound_and_continue; | |
6504 | |
6400 case 72: | 6505 case 72: |
6401 v464 = v731 - 2; | 6506 v464 = v731 - 2; |
6402 if ( !v464 ) | 6507 if ( !v464 ) |
6403 goto LABEL_910; | 6508 goto LABEL_910; |
6404 v465 = v464 - 1; | 6509 v465 = v464 - 1; |
6424 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | 6529 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); |
6425 v470 = v3->uPlayerID_2; | 6530 v470 = v3->uPlayerID_2; |
6426 if ( !(HIDWORD(pParty->pPlayers[v470].pConditions[6]) | LODWORD(pParty->pPlayers[v470].pConditions[6])) | 6531 if ( !(HIDWORD(pParty->pPlayers[v470].pConditions[6]) | LODWORD(pParty->pPlayers[v470].pConditions[6])) |
6427 && !(HIDWORD(pParty->pPlayers[v470].pConditions[8]) | LODWORD(pParty->pPlayers[v470].pConditions[8])) | 6532 && !(HIDWORD(pParty->pPlayers[v470].pConditions[8]) | LODWORD(pParty->pPlayers[v470].pConditions[8])) |
6428 && !(HIDWORD(pParty->pPlayers[v470].pConditions[10]) | LODWORD(pParty->pPlayers[v470].pConditions[10])) ) | 6533 && !(HIDWORD(pParty->pPlayers[v470].pConditions[10]) | LODWORD(pParty->pPlayers[v470].pConditions[10])) ) |
6429 goto LABEL_1056; | 6534 { |
6535 LODWORD(v727) = 1; | |
6536 goto play_sound_and_continue; | |
6537 } | |
6430 if ( v731 == 4 ) | 6538 if ( v731 == 4 ) |
6431 { | 6539 { |
6432 LODWORD(pParty->pPlayers[v470].pConditions[6]) = 0; | 6540 LODWORD(pParty->pPlayers[v470].pConditions[6]) = 0; |
6433 HIDWORD(pParty->pPlayers[v470].pConditions[6]) = 0; | 6541 HIDWORD(pParty->pPlayers[v470].pConditions[6]) = 0; |
6434 v471 = v3->uPlayerID_2; | 6542 v471 = v3->uPlayerID_2; |
6435 LODWORD(pParty->pPlayers[v471].pConditions[8]) = 0; | 6543 LODWORD(pParty->pPlayers[v471].pConditions[8]) = 0; |
6436 HIDWORD(pParty->pPlayers[v471].pConditions[8]) = 0; | 6544 HIDWORD(pParty->pPlayers[v471].pConditions[8]) = 0; |
6437 v472 = v3->uPlayerID_2; | 6545 v472 = v3->uPlayerID_2; |
6438 LODWORD(pParty->pPlayers[v472].pConditions[10]) = 0; | 6546 LODWORD(pParty->pPlayers[v472].pConditions[10]) = 0; |
6439 HIDWORD(pParty->pPlayers[v472].pConditions[10]) = 0; | 6547 HIDWORD(pParty->pPlayers[v472].pConditions[10]) = 0; |
6440 goto LABEL_1056; | 6548 LODWORD(v727) = 1; |
6441 } | 6549 goto play_sound_and_continue; |
6442 v732 = amount << 7; | 6550 } |
6443 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | 6551 *(float *)&a2 = (double)(amount << 7) * 0.033333335; |
6444 pParty->pPlayers[v470].DiscardConditionIfLastsLongerThan( | 6552 pParty->pPlayers[v470].DiscardConditionIfLastsLongerThan( |
6445 6u, | 6553 6u, |
6446 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | 6554 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); |
6447 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | 6555 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( |
6461 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); | 6569 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); |
6462 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | 6570 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); |
6463 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | 6571 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); |
6464 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | 6572 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); |
6465 | 6573 |
6466 v732 = (int)v733 << 7; | |
6467 | |
6468 pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, v2, 0, 0); | 6574 pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, v2, 0, 0); |
6469 goto LABEL_1056; | 6575 LODWORD(v727) = 1; |
6576 goto play_sound_and_continue; | |
6470 | 6577 |
6471 case 73: | 6578 case 73: |
6472 LODWORD(v733) = 3600 * v2; | 6579 LODWORD(v733) = 3600 * v2; |
6473 amount = v2; | 6580 amount = v2; |
6474 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 6581 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
6484 pParty->pPlayers[0].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, 0); | 6591 pParty->pPlayers[0].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, 0); |
6485 pParty->pPlayers[1].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, 0); | 6592 pParty->pPlayers[1].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, 0); |
6486 pParty->pPlayers[2].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, 0); | 6593 pParty->pPlayers[2].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + v717, 4u, v2, v2, 0); |
6487 | 6594 |
6488 pParty->pPlayers[3].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + v717, 4, v2, v2, 0); | 6595 pParty->pPlayers[3].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + v717, 4, v2, v2, 0); |
6489 goto LABEL_1056; | 6596 LODWORD(v727) = 1; |
6490 //goto LABEL_104; | 6597 goto play_sound_and_continue; |
6491 } | 6598 } |
6492 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | 6599 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); |
6493 | 6600 |
6494 v732 = (int)v733 << 7; | |
6495 | |
6496 pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, v2, v2, 0); | 6601 pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, v2, v2, 0); |
6497 goto LABEL_1056; | 6602 LODWORD(v727) = 1; |
6603 goto play_sound_and_continue; | |
6604 | |
6498 case 74: | 6605 case 74: |
6499 v493 = v731 - 2; | 6606 v493 = v731 - 2; |
6500 if ( v493 && (v494 = v493 - 1) != 0 && v494 == 1 ) | 6607 if ( v493 && (v494 = v493 - 1) != 0 && v494 == 1 ) |
6501 amount = 0; | 6608 amount = 0; |
6502 else | 6609 else |
6507 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | 6614 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); |
6508 v498 = v3->uPlayerID_2; | 6615 v498 = v3->uPlayerID_2; |
6509 if ( !(HIDWORD(pParty->pPlayers[v498].pConditions[7]) | LODWORD(pParty->pPlayers[v498].pConditions[7])) | 6616 if ( !(HIDWORD(pParty->pPlayers[v498].pConditions[7]) | LODWORD(pParty->pPlayers[v498].pConditions[7])) |
6510 && !(HIDWORD(pParty->pPlayers[v498].pConditions[9]) | LODWORD(pParty->pPlayers[v498].pConditions[9])) | 6617 && !(HIDWORD(pParty->pPlayers[v498].pConditions[9]) | LODWORD(pParty->pPlayers[v498].pConditions[9])) |
6511 && !(HIDWORD(pParty->pPlayers[v498].pConditions[11]) | LODWORD(pParty->pPlayers[v498].pConditions[11])) ) | 6618 && !(HIDWORD(pParty->pPlayers[v498].pConditions[11]) | LODWORD(pParty->pPlayers[v498].pConditions[11])) ) |
6512 goto LABEL_1056; | 6619 { |
6620 LODWORD(v727) = 1; | |
6621 goto play_sound_and_continue; | |
6622 } | |
6513 if ( v731 == 4 ) | 6623 if ( v731 == 4 ) |
6514 { | 6624 { |
6515 LODWORD(pParty->pPlayers[v498].pConditions[7]) = 0; | 6625 LODWORD(pParty->pPlayers[v498].pConditions[7]) = 0; |
6516 HIDWORD(pParty->pPlayers[v498].pConditions[7]) = 0; | 6626 HIDWORD(pParty->pPlayers[v498].pConditions[7]) = 0; |
6517 v499 = v3->uPlayerID_2; | 6627 v499 = v3->uPlayerID_2; |
6521 LODWORD(pParty->pPlayers[v500].pConditions[11]) = 0; | 6631 LODWORD(pParty->pPlayers[v500].pConditions[11]) = 0; |
6522 HIDWORD(pParty->pPlayers[v500].pConditions[11]) = 0; | 6632 HIDWORD(pParty->pPlayers[v500].pConditions[11]) = 0; |
6523 } | 6633 } |
6524 else | 6634 else |
6525 { | 6635 { |
6526 v732 = amount << 7; | |
6527 *(float *)&a2 = (double)(amount << 7) * 0.033333335; | 6636 *(float *)&a2 = (double)(amount << 7) * 0.033333335; |
6528 pParty->pPlayers[v498].DiscardConditionIfLastsLongerThan( | 6637 pParty->pPlayers[v498].DiscardConditionIfLastsLongerThan( |
6529 7u, | 6638 7u, |
6530 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); | 6639 (signed __int64)((double)(signed __int64)pParty->uTimePlayed - *(float *)&a2)); |
6531 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( | 6640 pParty->pPlayers[v3->uPlayerID_2].DiscardConditionIfLastsLongerThan( |
6536 LABEL_937: | 6645 LABEL_937: |
6537 v325 = &pParty->pPlayers[v3->uPlayerID_2]; | 6646 v325 = &pParty->pPlayers[v3->uPlayerID_2]; |
6538 LABEL_641: | 6647 LABEL_641: |
6539 v325->DiscardConditionIfLastsLongerThan(v656, v663); | 6648 v325->DiscardConditionIfLastsLongerThan(v656, v663); |
6540 } | 6649 } |
6541 goto LABEL_1056; | 6650 LODWORD(v727) = 1; |
6651 goto play_sound_and_continue; | |
6652 | |
6542 case 77: | 6653 case 77: |
6543 { | 6654 { |
6544 amount = 5 * v2 + 10; | 6655 amount = 5 * v2 + 10; |
6545 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 6656 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
6546 goto play_sound_and_continue; | 6657 goto play_sound_and_continue; |
6552 v501->Heal(amount); | 6663 v501->Heal(amount); |
6553 ++v501; | 6664 ++v501; |
6554 ++v1; | 6665 ++v1; |
6555 } | 6666 } |
6556 while ( (signed int)v501 < (signed int)pParty->pHirelings ); | 6667 while ( (signed int)v501 < (signed int)pParty->pHirelings ); |
6557 goto LABEL_1056; | 6668 LODWORD(v727) = 1; |
6669 goto play_sound_and_continue; | |
6558 } | 6670 } |
6559 case 80: | 6671 case 80: |
6560 sRecoveryTime -= v2; | 6672 sRecoveryTime -= v2; |
6561 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 6673 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
6562 goto play_sound_and_continue; | 6674 goto play_sound_and_continue; |
6563 | 6675 |
6564 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xAFF0Au, 0xC0u); | 6676 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xAFF0Au, 0xC0u); |
6565 v505 = sub_46A6AC((int)dword_50BF30, 100, 4096); | 6677 v505 = sub_46A6AC((int)dword_50BF30, 100, 4096); |
6566 ++a1.uType; | 6678 ++a1.uType; |
6567 HIDWORD(v733) = v505; | 6679 HIDWORD(v733) = v505; |
6568 v690 = 0; | 6680 v688.x = 0; |
6569 v689 = 0; | 6681 v688.y = 0; |
6570 v688 = 0; | 6682 v688.z = 0; |
6571 a1.stru_24.Reset(); | 6683 a1.stru_24.Reset(); |
6572 a1.spell_id = v3->spellnum; | 6684 a1.spell_id = v3->spellnum; |
6573 a1.spell_level = v2; | 6685 a1.spell_level = v2; |
6574 a1.spell_skill = v731; | 6686 a1.spell_skill = v731; |
6575 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); | 6687 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
6586 do | 6698 do |
6587 { | 6699 { |
6588 v507 = dword_50BF30[a2]; | 6700 v507 = dword_50BF30[a2]; |
6589 a1.vPosition.x = pActors[v507].vPosition.x; | 6701 a1.vPosition.x = pActors[v507].vPosition.x; |
6590 a1.vPosition.y = pActors[v507].vPosition.y; | 6702 a1.vPosition.y = pActors[v507].vPosition.y; |
6591 v732 = pActors[v507].uActorHeight; | 6703 a1.vPosition.z = pActors[v507].vPosition.z - (unsigned int)(signed __int64)((double)pActors[v507].uActorHeight * unk_4D8548); |
6592 a1.vPosition.z = pActors[v507].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | 6704 a1.spell_target_pid = PID(OBJECT_Actor, dword_50BF30[a2]); |
6593 v508 = 8 * dword_50BF30[a2]; | |
6594 LOBYTE(v508) = v508 | OBJECT_Actor; | |
6595 a1.spell_target_pid = v508; | |
6596 v509 = a1.Create(0, 0, 0, 0); | 6705 v509 = a1.Create(0, 0, 0, 0); |
6597 v510 = a2; | 6706 v510 = a2; |
6598 DamageMonsterFromParty(8 * v509 | OBJECT_Item, dword_50BF30[a2], (Vec3_int_ *)&v688); | 6707 DamageMonsterFromParty(PID(OBJECT_Item, v509), dword_50BF30[a2], (Vec3_int_ *)&v688); |
6599 a2 = v510 + 1; | 6708 a2 = v510 + 1; |
6600 } | 6709 } |
6601 while ( v510 + 1 < SHIDWORD(v733) ); | 6710 while ( v510 + 1 < SHIDWORD(v733) ); |
6602 } | 6711 } |
6603 for ( a2 = 0; a2 < SHIDWORD(v733); ++a2 ) | 6712 for ( a2 = 0; a2 < SHIDWORD(v733); ++a2 ) |
6604 { | 6713 { |
6605 v511 = &pActors[dword_50BF30[a2]]; | 6714 v511 = &pActors[dword_50BF30[a2]]; |
6606 a1.vPosition.x = v511->vPosition.x; | 6715 a1.vPosition.x = v511->vPosition.x; |
6607 a1.vPosition.y = v511->vPosition.y; | 6716 a1.vPosition.y = v511->vPosition.y; |
6608 v732 = v511->uActorHeight; | 6717 a1.vPosition.z = v511->vPosition.z - (unsigned int)(signed __int64)((double)v511->uActorHeight * unk_4D8548); |
6609 a1.vPosition.z = v511->vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | 6718 a1.spell_target_pid = PID(OBJECT_Actor, dword_50BF30[a2]); |
6610 v512 = 8 * dword_50BF30[a2]; | |
6611 LOBYTE(v512) = v512 | OBJECT_Actor; | |
6612 a1.spell_target_pid = v512; | |
6613 a1.Create(0, 0, 0, 0); | 6719 a1.Create(0, 0, 0, 0); |
6614 v513 = v511->pActorBuffs; | 6720 v513 = v511->pActorBuffs; |
6615 v726 = (Player *)22; | 6721 for (int _v726 = 22; _v726 != 0; --_v726) |
6616 do | |
6617 { | 6722 { |
6618 v513->Reset(); | 6723 v513->Reset(); |
6619 ++v513; | 6724 ++v513; |
6620 v726 = (Player *)((char *)v726 - 1); | 6725 } |
6621 } | 6726 } |
6622 while ( *(float *)&v726 != 0.0 ); | 6727 LODWORD(v727) = 1; |
6623 } | 6728 goto play_sound_and_continue; |
6624 goto LABEL_1056; | 6729 |
6625 case 82: | 6730 case 82: |
6626 v514 = v731 - 2; | 6731 v514 = v731 - 2; |
6627 if ( !v514 ) | 6732 if ( !v514 ) |
6628 goto LABEL_955; | 6733 goto LABEL_955; |
6629 v515 = v514 - 1; | 6734 v515 = v514 - 1; |
6645 { | 6750 { |
6646 v516 = 900 * v2; | 6751 v516 = 900 * v2; |
6647 amount = 3; | 6752 amount = 3; |
6648 } | 6753 } |
6649 v733 = __PAIR__(0, v516); | 6754 v733 = __PAIR__(0, v516); |
6650 v517 = 8 * v3->uPlayerID; | 6755 |
6651 LOBYTE(v517) = v517 | 4; | |
6652 if ( (signed int)uNumActors > 0 ) | 6756 if ( (signed int)uNumActors > 0 ) |
6653 { | 6757 { |
6654 v518 = pActors;//[0].uAIState; | 6758 v518 = pActors;//[0].uAIState; |
6655 v726b = uNumActors; | 6759 auto _v726 = uNumActors; |
6656 do | 6760 do |
6657 { | 6761 { |
6658 v519 = v518->uAIState; | 6762 v519 = v518->uAIState; |
6659 if ( v518->uAIState != 5 && v519 != 11 && v519 != 19 && v517 == v518->uSummonerID ) | 6763 if ( v518->uAIState != 5 && v519 != 11 && v519 != 19 && PID(OBJECT_Player, v3->uPlayerID) == v518->uSummonerID ) |
6660 ++HIDWORD(v733); | 6764 ++HIDWORD(v733); |
6661 ++v518; | 6765 ++v518; |
6662 --v726; | 6766 --_v726; |
6663 } | 6767 } |
6664 while ( v726 != 0 ); | 6768 while ( _v726 != 0 ); |
6665 } | 6769 } |
6666 if ( SHIDWORD(v733) >= amount ) | 6770 if ( SHIDWORD(v733) >= amount ) |
6667 { | 6771 { |
6668 ShowStatusBarString(pGlobalTXT_LocalizationStrings[648], 2); // This character can't summon any more monsters! | 6772 ShowStatusBarString(pGlobalTXT_LocalizationStrings[648], 2); // This character can't summon any more monsters! |
6669 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | 6773 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
6670 goto LABEL_203; | 6774 v3->spellnum = 0; |
6775 goto LABEL_1166; | |
6671 } | 6776 } |
6672 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 6777 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
6673 goto play_sound_and_continue; | 6778 goto play_sound_and_continue; |
6674 sub_44FA4C_spawn_light_elemental(v3->uPlayerID, v731, v733); | 6779 sub_44FA4C_spawn_light_elemental(v3->uPlayerID, v731, v733); |
6675 goto LABEL_1056; | 6780 LODWORD(v727) = 1; |
6781 goto play_sound_and_continue; | |
6782 | |
6676 case 83: | 6783 case 83: |
6677 v520 = v731 - 2; | 6784 v520 = v731 - 2; |
6678 if ( !v520 ) | 6785 if ( !v520 ) |
6679 goto LABEL_973; | 6786 goto LABEL_973; |
6680 v521 = v520 - 1; | 6787 v521 = v520 - 1; |
6703 | 6810 |
6704 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); | 6811 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); |
6705 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); | 6812 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 1); |
6706 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); | 6813 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 2); |
6707 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | 6814 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); |
6708 v83 = 1; | |
6709 | |
6710 v732 = (int)v733 << 7; | |
6711 | 6815 |
6712 pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, amount, 0, 0); | 6816 pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, amount, 0, 0); |
6713 LODWORD(v727) = v83; | 6817 LODWORD(v727) = 1; |
6714 | |
6715 goto play_sound_and_continue; | 6818 goto play_sound_and_continue; |
6716 | 6819 |
6717 case 84: | 6820 case 84: |
6718 //v67 = 2; | 6821 //v67 = 2; |
6719 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | 6822 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) |
6720 { | 6823 { |
6721 ShowStatusBarString(pGlobalTXT_LocalizationStrings[497], 2); // Can't cast Prismatic Light outdoors! | 6824 ShowStatusBarString(pGlobalTXT_LocalizationStrings[497], 2); // Can't cast Prismatic Light outdoors! |
6722 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | 6825 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
6723 goto LABEL_203; | 6826 v3->spellnum = 0; |
6827 goto LABEL_1166; | |
6724 } | 6828 } |
6725 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 6829 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
6726 goto play_sound_and_continue; | 6830 goto play_sound_and_continue; |
6727 v531 = sub_46A6AC((int)dword_50BF30, 100, 4096); | 6831 v531 = sub_46A6AC((int)dword_50BF30, 100, 4096); |
6728 ++a1.uType; | 6832 ++a1.uType; |
6729 v726 = (Player *)v531; | 6833 v694.x = 0; |
6730 v696 = 0; | 6834 v694.y = 0; |
6731 v695 = 0; | 6835 v694.z = 0; |
6732 v694 = 0; | |
6733 a1.stru_24.Reset(); | 6836 a1.stru_24.Reset(); |
6734 a1.spell_id = v3->spellnum; | 6837 a1.spell_id = v3->spellnum; |
6735 a1.spell_level = v2; | 6838 a1.spell_level = v2; |
6736 a1.spell_skill = v731; | 6839 a1.spell_skill = v731; |
6737 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); | 6840 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
6741 a1.field_60_distance_related_prolly_lod = 0; | 6844 a1.field_60_distance_related_prolly_lod = 0; |
6742 a1.uFacing = 0; | 6845 a1.uFacing = 0; |
6743 a1.spell_caster_pid = PID(OBJECT_Player, v3->uPlayerID); | 6846 a1.spell_caster_pid = PID(OBJECT_Player, v3->uPlayerID); |
6744 a1.uSoundID = LOWORD(v3->sound_id); | 6847 a1.uSoundID = LOWORD(v3->sound_id); |
6745 a2 = 0; | 6848 a2 = 0; |
6746 if ( (signed int)v726 > 0 ) | 6849 if ( (signed int)v531 > 0 ) |
6747 { | 6850 { |
6748 do | 6851 do |
6749 { | 6852 { |
6750 v533 = dword_50BF30[a2]; | 6853 v533 = dword_50BF30[a2]; |
6751 a1.vPosition.x = pActors[v533].vPosition.x; | 6854 a1.vPosition.x = pActors[v533].vPosition.x; |
6752 a1.vPosition.y = pActors[v533].vPosition.y; | 6855 a1.vPosition.y = pActors[v533].vPosition.y; |
6753 v732 = pActors[v533].uActorHeight; | 6856 a1.vPosition.z = pActors[v533].vPosition.z - (unsigned int)(signed __int64)((double)pActors[v533].uActorHeight * unk_4D8548); |
6754 a1.vPosition.z = pActors[v533].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | 6857 a1.spell_target_pid = PID(OBJECT_Actor, dword_50BF30[a2]); |
6755 v534 = 8 * dword_50BF30[a2]; | |
6756 LOBYTE(v534) = v534 | OBJECT_Actor; | |
6757 a1.spell_target_pid = v534; | |
6758 v535 = a1.Create(0, 0, 0, 0); | 6858 v535 = a1.Create(0, 0, 0, 0); |
6759 v536 = a2; | 6859 v536 = a2; |
6760 DamageMonsterFromParty(8 * v535 | OBJECT_Item, dword_50BF30[a2], (Vec3_int_ *)&v694); | 6860 DamageMonsterFromParty(PID(OBJECT_Item, v535), dword_50BF30[a2], &v694); |
6761 a2 = v536 + 1; | 6861 a2 = v536 + 1; |
6762 } | 6862 } |
6763 while ( v536 + 1 < (signed int)v726 ); | 6863 while ( v536 + 1 < (signed int)v531 ); |
6764 } | 6864 } |
6765 v537 = pGame->GetStru6(); | 6865 v537 = pGame->GetStru6(); |
6766 pGame->GetStru6()->_4A8BFC(); | 6866 pGame->GetStru6()->_4A8BFC(); |
6767 goto LABEL_1056; | 6867 LODWORD(v727) = 1; |
6868 goto play_sound_and_continue; | |
6768 | 6869 |
6769 case SPELL_LIGHT_DAY_OF_PROTECTION: | 6870 case SPELL_LIGHT_DAY_OF_PROTECTION: |
6871 { | |
6770 v538 = v731 - 2; | 6872 v538 = v731 - 2; |
6771 if ( v538 && (v539 = v538 - 1) != 0 && v539 == 1 ) | 6873 if ( v538 && (v539 = v538 - 1) != 0 && v539 == 1 ) |
6772 { | 6874 { |
6773 amount = 5 * v2; | 6875 amount = 5 * v2; |
6774 v540 = 18000 * v2; | 6876 v540 = 18000 * v2; |
6803 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), | 6905 (signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), |
6804 v731, | 6906 v731, |
6805 v550, 0, 0); | 6907 v550, 0, 0); |
6806 | 6908 |
6807 pParty->pPartyBuffs[PARTY_BUFF_WIZARD_EYE].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), v731, v550, 0, 0); | 6909 pParty->pPartyBuffs[PARTY_BUFF_WIZARD_EYE].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), v731, v550, 0, 0); |
6808 goto LABEL_1056; | 6910 LODWORD(v727) = 1; |
6911 goto play_sound_and_continue; | |
6912 } | |
6913 | |
6809 case 86: | 6914 case 86: |
6915 { | |
6810 v551 = v731 - 2; | 6916 v551 = v731 - 2; |
6811 if ( !v551 ) | 6917 if ( !v551 ) |
6812 goto LABEL_998; | 6918 goto LABEL_998; |
6813 v552 = v551 - 1; | 6919 v552 = v551 - 1; |
6814 if ( v552 ) | 6920 if ( v552 ) |
6832 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 6938 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
6833 goto play_sound_and_continue; | 6939 goto play_sound_and_continue; |
6834 y = (char *)(60 * (v2 * HIDWORD(v733) + 60)); | 6940 y = (char *)(60 * (v2 * HIDWORD(v733) + 60)); |
6835 v732 = (300 * amount * v2 + 60) << 7; | 6941 v732 = (300 * amount * v2 + 60) << 7; |
6836 v730 = v2 + 5; | 6942 v730 = v2 + 5; |
6837 v726 = 0; | 6943 int _v726 = 0; |
6838 v553 = pParty->pPlayers;//[0].pConditions[1]; | 6944 v553 = pParty->pPlayers;//[0].pConditions[1]; |
6839 *((float *)&v733 + 1) = (double)v732 * 0.033333335; | 6945 *((float *)&v733 + 1) = (double)v732 * 0.033333335; |
6840 do | 6946 do |
6841 { | 6947 { |
6842 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); | 6948 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 0); |
6845 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); | 6951 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, 3); |
6846 | 6952 |
6847 //((SpellBuff *)(v553 + 6056))->Apply( | 6953 //((SpellBuff *)(v553 + 6056))->Apply( |
6848 v553->pPlayerBuffs[4].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), v731, v730, 0, 0); | 6954 v553->pPlayerBuffs[4].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), v731, v730, 0, 0); |
6849 if ( *(_QWORD *)v553 ) | 6955 if ( *(_QWORD *)v553 ) |
6850 v726 = (Player *)1; | 6956 _v726 = 1; |
6851 ++v553; | 6957 ++v553; |
6852 } | 6958 } |
6853 while ( v553 <= &pParty->pPlayers[3] ); | 6959 while ( v553 <= &pParty->pPlayers[3] ); |
6854 v562 = v731; | 6960 v562 = v731; |
6855 pParty->pPartyBuffs[PARTY_BUFF_HEROISM].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), v731, v730, 0, 0); | 6961 pParty->pPartyBuffs[PARTY_BUFF_HEROISM].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), v731, v730, 0, 0); |
6856 pParty->pPartyBuffs[PARTY_BUFF_SHIELD].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), v562, 0, 0, 0); | 6962 pParty->pPartyBuffs[PARTY_BUFF_SHIELD].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), v562, 0, 0, 0); |
6857 pParty->pPartyBuffs[PARTY_BUFF_STONE_SKIN].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), v562, v730, 0, 0); | 6963 pParty->pPartyBuffs[PARTY_BUFF_STONE_SKIN].Apply((signed __int64)((double)(signed __int64)pParty->uTimePlayed + *((float *)&v733 + 1)), v562, v730, 0, 0); |
6858 if (v726) | 6964 if (!_v726) |
6859 goto LABEL_1056; | 6965 { |
6860 v732 = (int)y << 7; | 6966 pParty->pPartyBuffs[PARTY_BUFF_HASTE].Apply((signed __int64)((double)(signed int)((int)y << 7) * 0.033333335 + (double)(signed __int64)pParty->uTimePlayed), v562, v730, 0, 0); |
6861 pParty->pPartyBuffs[PARTY_BUFF_HASTE].Apply((signed __int64)((double)(signed int)((int)y << 7) * 0.033333335 + (double)(signed __int64)pParty->uTimePlayed), v562, v730, 0, 0); | 6967 } |
6862 goto LABEL_1056; | 6968 LODWORD(v727) = 1; |
6969 goto play_sound_and_continue; | |
6970 } | |
6971 | |
6972 | |
6863 case 88: | 6973 case 88: |
6864 amount = 3; | 6974 amount = 3; |
6865 if ( pPlayer->uNumDivineInterventionCastsThisDay >= 3u ) | 6975 if ( pPlayer->uNumDivineInterventionCastsThisDay >= 3u ) |
6866 { | 6976 { |
6867 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed | 6977 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed |
6868 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | 6978 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
6869 goto LABEL_203; | 6979 v3->spellnum = 0; |
6980 goto LABEL_1166; | |
6870 } | 6981 } |
6871 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 6982 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
6872 goto play_sound_and_continue; | 6983 goto play_sound_and_continue; |
6873 a2 = 0; | 6984 a2 = 0; |
6874 _this = (ItemGen *)&pPlayers[1]; | 6985 _this = (ItemGen *)&pPlayers[1]; |
6899 *(short *)v572 = 120; | 7010 *(short *)v572 = 120; |
6900 else | 7011 else |
6901 *(short *)v572 = pPlayer->sAgeModifier + 10; | 7012 *(short *)v572 = pPlayer->sAgeModifier + 10; |
6902 sRecoveryTime += -5 * v2; | 7013 sRecoveryTime += -5 * v2; |
6903 ++v571->uNumDivineInterventionCastsThisDay; | 7014 ++v571->uNumDivineInterventionCastsThisDay; |
6904 goto LABEL_1056; | 7015 LODWORD(v727) = 1; |
7016 goto play_sound_and_continue; | |
7017 | |
6905 case 89: | 7018 case 89: |
6906 v573 = v731 - 2; | 7019 v573 = v731 - 2; |
6907 if ( v573 ) | 7020 if ( v573 ) |
6908 { | 7021 { |
6909 v574 = v573 - 1; | 7022 v574 = v573 - 1; |
6939 *((_QWORD *)v585 + 17) = pParty->uTimePlayed; | 7052 *((_QWORD *)v585 + 17) = pParty->uTimePlayed; |
6940 } | 7053 } |
6941 goto play_sound_and_continue; | 7054 goto play_sound_and_continue; |
6942 } | 7055 } |
6943 v577 = (Player *)(v576 >> 3); | 7056 v577 = (Player *)(v576 >> 3); |
6944 v726 = v577; | 7057 //v726 = v577; |
6945 if ( v577 == (Player *)-1 ) | 7058 if ( v577 == (Player *)-1 ) |
6946 { | 7059 { |
6947 ShowStatusBarString(pGlobalTXT_LocalizationStrings[496], 2); // No valid target exists! | 7060 ShowStatusBarString(pGlobalTXT_LocalizationStrings[496], 2); // No valid target exists! |
6948 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | 7061 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
6949 goto LABEL_203; | 7062 v3->spellnum = 0; |
7063 goto LABEL_1166; | |
6950 } | 7064 } |
6951 v578 = (int)&pActors[(int)v577]; | 7065 v578 = (int)&pActors[(int)v577]; |
6952 v721 = v578; | 7066 v721 = v578; |
6953 if ( *(short *)(v578 + 40) > 0 || (v579 = *(short *)(v578 + 176), v579 != 5) && v579 != 4 ) | 7067 if ( *(short *)(v578 + 40) > 0 || (v579 = *(short *)(v578 + 176), v579 != 5) && v579 != 4 ) |
6954 { | 7068 { |
6955 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed | 7069 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed |
6956 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | 7070 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
6957 goto LABEL_203; | 7071 v3->spellnum = 0; |
7072 goto LABEL_1166; | |
6958 } | 7073 } |
6959 ++a1.uType; | 7074 ++a1.uType; |
6960 a1.stru_24.Reset(); | 7075 a1.stru_24.Reset(); |
6961 a1.spell_id = v3->spellnum; | 7076 a1.spell_id = v3->spellnum; |
6962 a1.spell_level = v2; | 7077 a1.spell_level = v2; |
6971 a1.spell_caster_pid = PID(OBJECT_Player, v3->uPlayerID); | 7086 a1.spell_caster_pid = PID(OBJECT_Player, v3->uPlayerID); |
6972 a1.uSoundID = LOWORD(v3->sound_id); | 7087 a1.uSoundID = LOWORD(v3->sound_id); |
6973 a1.vPosition.x = *(short *)(v721 + 142); | 7088 a1.vPosition.x = *(short *)(v721 + 142); |
6974 a1.vPosition.y = *(short *)(v721 + 144); | 7089 a1.vPosition.y = *(short *)(v721 + 144); |
6975 v732 = *(short *)(v721 + 138); | 7090 v732 = *(short *)(v721 + 138); |
6976 v582 = 8 * (int)v726; | |
6977 a1.vPosition.z = *(short *)(v721 + 146) - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | 7091 a1.vPosition.z = *(short *)(v721 + 146) - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); |
6978 a1.spell_target_pid = PID(OBJECT_Actor, (int)v726); | 7092 a1.spell_target_pid = PID(OBJECT_Actor, (int)v577); |
6979 a1.Create(0, 0, 0, 0); | 7093 a1.Create(0, 0, 0, 0); |
6980 if ( *(char *)(v581 + 52) > amount ) | 7094 if ( *(char *)(v581 + 52) > amount ) |
6981 goto play_sound_and_continue; | 7095 goto play_sound_and_continue; |
6982 Actor::Resurrect((unsigned int)v726); | 7096 Actor::Resurrect((unsigned int)v577); |
6983 *(char *)(v581 + 61) = 0; | 7097 *(char *)(v581 + 61) = 0; |
6984 *(char *)(v581 + 53) = 0; | 7098 *(char *)(v581 + 53) = 0; |
6985 *(char *)(v581 + 54) = 0; | 7099 *(char *)(v581 + 54) = 0; |
6986 *(char *)(v581 + 55) = 0; | 7100 *(char *)(v581 + 55) = 0; |
6987 *(char *)(v581 + 56) = 0; | 7101 *(char *)(v581 + 56) = 0; |
6992 ((SpellBuff *)(v581 + 356))->Reset(); | 7106 ((SpellBuff *)(v581 + 356))->Reset(); |
6993 ((SpellBuff *)(v581 + 228))->Reset(); | 7107 ((SpellBuff *)(v581 + 228))->Reset(); |
6994 ((SpellBuff *)(v581 + 404))->Reset(); | 7108 ((SpellBuff *)(v581 + 404))->Reset(); |
6995 if ( *(short *)(v581 + 40) > 10 * amount ) | 7109 if ( *(short *)(v581 + 40) > 10 * amount ) |
6996 *(short *)(v581 + 40) = 10 * amount; | 7110 *(short *)(v581 + 40) = 10 * amount; |
6997 goto LABEL_1056; | 7111 LODWORD(v727) = 1; |
7112 goto play_sound_and_continue; | |
7113 | |
6998 case 91: | 7114 case 91: |
6999 v588 = v731 - 1; | 7115 v588 = v731 - 1; |
7000 amount = 16; | 7116 amount = 16; |
7001 if ( v588 && (v589 = v588 - 1) != 0 && (v590 = v589 - 1) != 0 ) | 7117 if ( v588 && (v589 = v588 - 1) != 0 && (v590 = v589 - 1) != 0 ) |
7002 { | 7118 { |
7007 { | 7123 { |
7008 LODWORD(v733) = 3600 * v2; | 7124 LODWORD(v733) = 3600 * v2; |
7009 } | 7125 } |
7010 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 7126 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
7011 goto play_sound_and_continue; | 7127 goto play_sound_and_continue; |
7128 __debugbreak(); | |
7012 HIDWORD(v733) = (int)(char *)&pParty + 6972 * v3->uPlayerID_2 + 36 * a2 + 3040; | 7129 HIDWORD(v733) = (int)(char *)&pParty + 6972 * v3->uPlayerID_2 + 36 * a2 + 3040; |
7013 v732 = (signed int)&pItemsTable->pItems[*(int *)HIDWORD(v733)].pIconName; | 7130 v732 = (signed int)&pItemsTable->pItems[*(int *)HIDWORD(v733)].pIconName; |
7014 ((ItemGen *)HIDWORD(v733))->UpdateTempBonus(pParty->uTimePlayed); | 7131 ((ItemGen *)HIDWORD(v733))->UpdateTempBonus(pParty->uTimePlayed); |
7015 if ( *(int *)HIDWORD(v733) >= 64 && *(int *)HIDWORD(v733) <= 65 | 7132 if ( *(int *)HIDWORD(v733) >= 64 && *(int *)HIDWORD(v733) <= 65 |
7016 || *(char *)(HIDWORD(v733) + 20) & 2 | 7133 || *(char *)(HIDWORD(v733) + 20) & 2 |
7023 dword_50C9D4 = 0; | 7140 dword_50C9D4 = 0; |
7024 dword_50C9D8 = 1; | 7141 dword_50C9D8 = 1; |
7025 | 7142 |
7026 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed | 7143 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed |
7027 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | 7144 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
7028 goto LABEL_203; | 7145 v3->spellnum = 0; |
7146 goto LABEL_1166; | |
7029 } | 7147 } |
7030 v592 = HIDWORD(v733); | 7148 v592 = HIDWORD(v733); |
7031 v14 = v731 == 4; | 7149 v14 = v731 == 4; |
7032 *(int *)(HIDWORD(v733) + 12) = 16; | 7150 *(int *)(HIDWORD(v733) + 12) = 16; |
7033 if ( !v14 ) | 7151 if ( !v14 ) |
7034 { | 7152 { |
7035 v732 = (int)v733 << 7; | 7153 v732 = (int)v733 << 7; |
7036 *(_QWORD *)(v592 + 28) = pParty->uTimePlayed | 7154 *(_QWORD *)(v592 + 28) = pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); |
7037 + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | |
7038 *(int *)(v592 + 20) |= 8u; | 7155 *(int *)(v592 + 20) |= 8u; |
7039 } | 7156 } |
7040 *(char *)(v592 + 20) |= 0x80u; | 7157 *(char *)(v592 + 20) |= 0x80u; |
7041 goto LABEL_1055; | 7158 dword_50C9A8 = 256; |
7159 LODWORD(v727) = 1; | |
7160 goto play_sound_and_continue; | |
7161 | |
7042 case 93: | 7162 case 93: |
7163 { | |
7043 v593 = v731 - 2; | 7164 v593 = v731 - 2; |
7044 if ( !v593 ) | 7165 if ( !v593 ) |
7045 goto LABEL_1062; | 7166 goto LABEL_1062; |
7046 v594 = v593 - 1; | 7167 v594 = v593 - 1; |
7047 if ( v594 ) | 7168 if ( v594 ) |
7056 { | 7177 { |
7057 amount = 7; | 7178 amount = 7; |
7058 } | 7179 } |
7059 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 7180 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
7060 goto play_sound_and_continue; | 7181 goto play_sound_and_continue; |
7061 v726 = (Player *)((signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360); | 7182 auto _v726 = ((signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360); |
7062 v732 = (signed int)(60 * stru_5C6E00->uIntegerDoublePi) / 360 / (amount - 1); | |
7063 a1.stru_24.Reset(); | 7183 a1.stru_24.Reset(); |
7064 a1.spell_id = v3->spellnum; | 7184 a1.spell_id = v3->spellnum; |
7065 a1.spell_level = v2; | 7185 a1.spell_level = v2; |
7066 a1.spell_skill = v731; | 7186 a1.spell_skill = v731; |
7067 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); | 7187 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
7078 a1.spell_target_pid = a2; | 7198 a1.spell_target_pid = a2; |
7079 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | 7199 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); |
7080 a1.uSoundID = LOWORD(v3->sound_id); | 7200 a1.uSoundID = LOWORD(v3->sound_id); |
7081 if ( pParty->bTurnBasedModeOn == 1 ) | 7201 if ( pParty->bTurnBasedModeOn == 1 ) |
7082 LOBYTE(a1.uAttributes) |= 4u; | 7202 LOBYTE(a1.uAttributes) |= 4u; |
7083 v596 = (signed int)v726 / -2; | 7203 v596 = (signed int)_v726 / -2; |
7084 y = (char *)((signed int)v726 / 2); | 7204 y = (char *)((signed int)_v726 / 2); |
7085 if ( (signed int)v726 / -2 <= (signed int)v726 / 2 ) | 7205 if ( (signed int)_v726 / -2 <= (signed int)_v726 / 2 ) |
7086 { | 7206 { |
7087 v597 = v715.uYawAngle; | 7207 v597 = v715.uYawAngle; |
7088 do | 7208 do |
7089 { | 7209 { |
7090 a1.uFacing = v596 + v597; | 7210 a1.uFacing = v596 + v597; |
7093 v715.uPitchAngle, | 7213 v715.uPitchAngle, |
7094 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, | 7214 pObjectList->pObjects[(signed __int16)a1.uObjectDescID].uSpeed, |
7095 v3->uPlayerID + 1) != -1 | 7215 v3->uPlayerID + 1) != -1 |
7096 && pParty->bTurnBasedModeOn == 1 ) | 7216 && pParty->bTurnBasedModeOn == 1 ) |
7097 ++pTurnEngine->field_1C; | 7217 ++pTurnEngine->field_1C; |
7098 v596 += v732; | 7218 v596 += _v726 / (amount - 1); |
7099 } | 7219 } |
7100 while ( v596 <= (signed int)y ); | 7220 while ( v596 <= (signed int)y ); |
7101 } | 7221 } |
7102 goto LABEL_1056; | 7222 LODWORD(v727) = 1; |
7223 goto play_sound_and_continue; | |
7224 } | |
7225 | |
7103 case 94: | 7226 case 94: |
7104 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 7227 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
7105 goto play_sound_and_continue; | 7228 goto play_sound_and_continue; |
7106 if ( v731 == 1 || v731 == 2 ) | 7229 if ( v731 == 1 || v731 == 2 ) |
7107 { | 7230 { |
7116 goto LABEL_1082; | 7239 goto LABEL_1082; |
7117 } | 7240 } |
7118 if ( v731 == 4 ) | 7241 if ( v731 == 4 ) |
7119 LODWORD(v733) = 29030400; | 7242 LODWORD(v733) = 29030400; |
7120 LABEL_1082: | 7243 LABEL_1082: |
7121 v599 = a2 >> 3; | 7244 if (PID_TYPE(a2) != OBJECT_Actor) |
7122 if ( (a2 & 7) != OBJECT_Actor) | 7245 { |
7123 goto LABEL_1056; | 7246 LODWORD(v727) = 1; |
7124 v730 = 836 * v599; | 7247 goto play_sound_and_continue; |
7125 if ( !MonsterStats::BelongsToSupertype(pActors[v599].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | 7248 } |
7126 goto play_sound_and_continue; | 7249 v730 = 836 * PID_ID(a2); |
7127 if ( !stru_50C198.GetMagicalResistance(&pActors[v599], 0xAu) ) | 7250 if ( !MonsterStats::BelongsToSupertype(pActors[PID_ID(a2)].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) |
7251 goto play_sound_and_continue; | |
7252 if ( !stru_50C198.GetMagicalResistance(&pActors[PID_ID(a2)], 0xAu) ) | |
7128 { | 7253 { |
7129 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed | 7254 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed |
7130 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | 7255 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
7131 goto LABEL_203; | 7256 v3->spellnum = 0; |
7132 } | 7257 goto LABEL_1166; |
7133 pActors[v599].pActorBuffs[9].Reset(); | 7258 } |
7134 pActors[v599].pActorBuffs[1].Reset(); | 7259 pActors[PID_ID(a2)].pActorBuffs[9].Reset(); |
7135 v732 = (int)v733 << 7; | 7260 pActors[PID_ID(a2)].pActorBuffs[1].Reset(); |
7136 pActors[v599].pActorBuffs[12].Apply( | 7261 pActors[PID_ID(a2)].pActorBuffs[12].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), |
7137 pParty->uTimePlayed + (signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), | |
7138 v731, 0, 0, 0); | 7262 v731, 0, 0, 0); |
7139 a1.stru_24.Reset(); | 7263 a1.stru_24.Reset(); |
7140 a1.spell_id = v3->spellnum; | 7264 a1.spell_id = v3->spellnum; |
7141 a1.spell_level = v2; | 7265 a1.spell_level = v2; |
7142 a1.spell_skill = v731; | 7266 a1.spell_skill = v731; |
7143 v60 = pObjectList->ObjectIDByItemID(a1.uType); | 7267 v60 = pObjectList->ObjectIDByItemID(a1.uType); |
7144 v61 = v599; | 7268 v61 = PID_ID(a2); |
7145 LABEL_1086: | 7269 LABEL_1086: |
7146 v600 = pActors[v61].vPosition.y; | 7270 v600 = pActors[v61].vPosition.y; |
7147 v601 = pActors[v61].vPosition.x; | 7271 v601 = pActors[v61].vPosition.x; |
7148 a1.uObjectDescID = v60; | 7272 a1.uObjectDescID = v60; |
7149 a1.vPosition.x = v601; | 7273 a1.vPosition.x = v601; |
7163 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); | 7287 a1.field_60_distance_related_prolly_lod = LOBYTE(v715.uDistance); |
7164 a1.uFacing = LOWORD(v715.uYawAngle); | 7288 a1.uFacing = LOWORD(v715.uYawAngle); |
7165 LOBYTE(a1.uAttributes) |= 0x80u; | 7289 LOBYTE(a1.uAttributes) |= 0x80u; |
7166 a1.uSoundID = LOWORD(v3->sound_id); | 7290 a1.uSoundID = LOWORD(v3->sound_id); |
7167 a1.Create(0, 0, 0, v3->uPlayerID + 1); | 7291 a1.Create(0, 0, 0, v3->uPlayerID + 1); |
7168 goto LABEL_1056; | 7292 LODWORD(v727) = 1; |
7293 goto play_sound_and_continue; | |
7294 | |
7169 case 96: | 7295 case 96: |
7170 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 7296 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
7171 goto play_sound_and_continue; | 7297 goto play_sound_and_continue; |
7172 HIDWORD(v733) = 0; | 7298 HIDWORD(v733) = 0; |
7173 memset(&achievedAwardsIndex, 0, 4000); | 7299 memset(&achievedAwardsIndex, 0, 4000); |
7209 || (v609 = (signed int)*(&pFontCChar + v608 + (unsigned __int8)pParty->field_709), v609 <= 0) | 7335 || (v609 = (signed int)*(&pFontCChar + v608 + (unsigned __int8)pParty->field_709), v609 <= 0) |
7210 || v609 >= 3 ) | 7336 || v609 >= 3 ) |
7211 { | 7337 { |
7212 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed | 7338 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed |
7213 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | 7339 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
7214 goto LABEL_203; | 7340 v3->spellnum = 0; |
7341 goto LABEL_1166; | |
7215 } | 7342 } |
7216 v610 = 76 * v609; | 7343 v610 = 76 * v609; |
7217 *((int *)&pParty->pPlayers[3].pInstalledBeacons[4].uBeaconTime + 19 * v609) = 0; | 7344 *((int *)&pParty->pPlayers[3].pInstalledBeacons[4].uBeaconTime + 19 * v609) = 0; |
7218 v611 = pIconsFrameTable->FindIcon("spell96"); | 7345 v611 = pIconsFrameTable->FindIcon("spell96"); |
7219 *(int *)((char *)&pParty->pPlayers[3].pInstalledBeacons[4].uBeaconTime + v610 + 4) = pIconsFrameTable->GetIconAnimLength(v611); | 7346 *(int *)((char *)&pParty->pPlayers[3].pInstalledBeacons[4].uBeaconTime + v610 + 4) = pIconsFrameTable->GetIconAnimLength(v611); |
7255 goto play_sound_and_continue; | 7382 goto play_sound_and_continue; |
7256 if ( v731 != 3 && v731 != 4 ) | 7383 if ( v731 != 3 && v731 != 4 ) |
7257 { | 7384 { |
7258 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); | 7385 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, v3->uPlayerID_2); |
7259 | 7386 |
7260 v732 = (int)v733 << 7; | |
7261 | |
7262 pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_PAIN_REFLECTION].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, v615, v716, 0); | 7387 pParty->pPlayers[v3->uPlayerID_2].pPlayerBuffs[PLAYER_BUFF_PAIN_REFLECTION].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335), v731, v615, v716, 0); |
7263 goto LABEL_1056; | 7388 LODWORD(v727) = 1; |
7389 goto play_sound_and_continue; | |
7264 } | 7390 } |
7265 a2 = 0; | 7391 a2 = 0; |
7266 v732 = (int)v733 << 7; | |
7267 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); | 7392 v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); |
7268 v619 = pParty->pPlayers;//[0].pPlayerBuffs[10]; | 7393 v619 = pParty->pPlayers;//[0].pPlayerBuffs[10]; |
7269 do | 7394 do |
7270 { | 7395 { |
7271 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, a2); | 7396 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, a2); |
7272 v619->pPlayerBuffs[PLAYER_BUFF_PAIN_REFLECTION].Apply(pParty->uTimePlayed + v717, v731, amount, v716, 0); | 7397 v619->pPlayerBuffs[PLAYER_BUFF_PAIN_REFLECTION].Apply(pParty->uTimePlayed + v717, v731, amount, v716, 0); |
7273 ++a2; | 7398 ++a2; |
7274 ++v619; | 7399 ++v619; |
7275 } | 7400 } |
7276 while ( v619 <= &pParty->pPlayers[3] ); | 7401 while ( v619 <= &pParty->pPlayers[3] ); |
7277 goto LABEL_1056; | 7402 LODWORD(v727) = 1; |
7403 goto play_sound_and_continue; | |
7404 | |
7278 case 99: | 7405 case 99: |
7406 { | |
7279 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 7407 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
7280 goto play_sound_and_continue; | 7408 goto play_sound_and_continue; |
7281 v726 = 0; | |
7282 pGame->GetIndoorCamera(); | 7409 pGame->GetIndoorCamera(); |
7283 v623 = (signed __int64)GetPickDepth(); | 7410 v623 = (signed __int64)GetPickDepth(); |
7284 HIDWORD(v733) = sub_46A6AC((int)dword_50BF30, 100, v623); | 7411 HIDWORD(v733) = sub_46A6AC((int)dword_50BF30, 100, v623); |
7285 v709 = 0; | 7412 v707.x = 0; |
7286 v708 = 0; | 7413 v707.y = 0; |
7287 v707 = 0; | 7414 v707.z = 0; |
7288 a1.stru_24.Reset(); | 7415 a1.stru_24.Reset(); |
7289 a1.spell_id = v3->spellnum; | 7416 a1.spell_id = v3->spellnum; |
7290 a1.spell_level = v2; | 7417 a1.spell_level = v2; |
7291 a1.spell_skill = v731; | 7418 a1.spell_skill = v731; |
7292 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); | 7419 a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType); |
7296 a1.field_60_distance_related_prolly_lod = 0; | 7423 a1.field_60_distance_related_prolly_lod = 0; |
7297 a1.uFacing = 0; | 7424 a1.uFacing = 0; |
7298 a1.spell_caster_pid = PID(OBJECT_Player, v3->uPlayerID); | 7425 a1.spell_caster_pid = PID(OBJECT_Player, v3->uPlayerID); |
7299 a1.uSoundID = LOWORD(v3->sound_id); | 7426 a1.uSoundID = LOWORD(v3->sound_id); |
7300 a2 = 0; | 7427 a2 = 0; |
7428 int _v726 = 0; | |
7301 if ( SHIDWORD(v733) > 0 ) | 7429 if ( SHIDWORD(v733) > 0 ) |
7302 { | 7430 { |
7303 v726 = (Player *)(HIDWORD(v733) * (7 * v2 + 25)); | 7431 _v726 = (HIDWORD(v733) * (7 * v2 + 25)); |
7304 do | 7432 do |
7305 { | 7433 { |
7306 v625 = dword_50BF30[a2]; | 7434 v625 = dword_50BF30[a2]; |
7307 a1.vPosition.x = pActors[v625].vPosition.x; | 7435 a1.vPosition.x = pActors[v625].vPosition.x; |
7308 a1.vPosition.y = pActors[v625].vPosition.y; | 7436 a1.vPosition.y = pActors[v625].vPosition.y; |
7309 v732 = pActors[v625].uActorHeight; | 7437 //v732 = pActors[v625].uActorHeight; |
7310 a1.vPosition.z = pActors[v625].vPosition.z - (unsigned int)(signed __int64)((double)v732 * unk_4D8548); | 7438 a1.vPosition.z = pActors[v625].vPosition.z - (unsigned int)(signed __int64)((double)pActors[v625].uActorHeight * unk_4D8548); |
7311 v626 = 8 * dword_50BF30[a2]; | 7439 a1.spell_target_pid = PID(OBJECT_Actor, dword_50BF30[a2]); |
7312 LOBYTE(v626) = v626 | OBJECT_Actor; | |
7313 a1.spell_target_pid = v626; | |
7314 v627 = a1.Create(0, 0, 0, 0); | 7440 v627 = a1.Create(0, 0, 0, 0); |
7315 v628 = a2; | 7441 v628 = a2; |
7316 DamageMonsterFromParty(8 * v627 | 2, dword_50BF30[a2], (Vec3_int_ *)&v707); | 7442 DamageMonsterFromParty(PID(OBJECT_Item, v627), dword_50BF30[a2], &v707); |
7317 a2 = v628 + 1; | 7443 a2 = v628 + 1; |
7318 } | 7444 } |
7319 while ( v628 + 1 < SHIDWORD(v733) ); | 7445 while ( v628 + 1 < SHIDWORD(v733) ); |
7320 } | 7446 } |
7321 v730 = 0; | 7447 v730 = 0; |
7334 v681[v631] = v629; | 7460 v681[v631] = v629; |
7335 } | 7461 } |
7336 ++v629; | 7462 ++v629; |
7337 } | 7463 } |
7338 while ( v629 <= 4 ); | 7464 while ( v629 <= 4 ); |
7339 v732 = (signed __int64)((double)(signed int)v726 / (double)v730); | 7465 v732 = (signed __int64)((double)(signed int)_v726 / (double)v730); |
7340 HIDWORD(v733) = 0; | 7466 HIDWORD(v733) = 0; |
7341 if ( v730 > 0 ) | 7467 if ( v730 > 0 ) |
7342 { | 7468 { |
7343 do | 7469 do |
7344 { | 7470 { |
7345 v632 = 4 * v681[HIDWORD(v733)] + 10965188; | 7471 //v632 = 4 * v681[HIDWORD(v733)] + 10965188; |
7346 v633 = pPlayers[v681[HIDWORD(v733)]]; | 7472 v726 = pPlayers[v681[HIDWORD(v733)]]; |
7347 v633->sHealth += v732; | 7473 //v633 = pPlayers[v681[HIDWORD(v733)]]; |
7348 v726 = *(Player **)v632; | 7474 v726->sHealth += v732; |
7349 v634 = v726->GetMaxHealth(); | 7475 //v726 = *(Player **)v632; |
7350 if ( v726->sHealth > v634 ) | 7476 //v634 = v726->GetMaxHealth(); |
7351 *(int *)(*(int *)v632 + 6460) = v726->GetMaxHealth(); | 7477 if ( v726->sHealth > v726->GetMaxHealth()) |
7478 v726->sHealth = v726->GetMaxHealth(); | |
7352 v635 = HIDWORD(v733); | 7479 v635 = HIDWORD(v733); |
7353 | 7480 |
7354 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, WORD2(v733)); | 7481 pGame->GetStru6()->SetPlayerBuffAnim(v3->spellnum, WORD2(v733)); |
7355 HIDWORD(v733) = v635 + 1; | 7482 HIDWORD(v733) = v635 + 1; |
7356 } | 7483 } |
7357 while ( v635 + 1 < v730 ); | 7484 while ( v635 + 1 < v730 ); |
7358 } | 7485 } |
7359 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0, 0x40u); | 7486 pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0, 0x40u); |
7360 goto LABEL_1056; | 7487 LODWORD(v727) = 1; |
7488 goto play_sound_and_continue; | |
7489 } | |
7490 | |
7361 case 98: | 7491 case 98: |
7492 { | |
7362 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | 7493 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) |
7363 { | 7494 { |
7364 ShowStatusBarString(pGlobalTXT_LocalizationStrings[499], 2); // Can't cast Armageddon indoors! | 7495 ShowStatusBarString(pGlobalTXT_LocalizationStrings[499], 2); // Can't cast Armageddon indoors! |
7365 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | 7496 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
7366 goto LABEL_203; | 7497 v3->spellnum = 0; |
7498 goto LABEL_1166; | |
7367 } | 7499 } |
7368 v640 = v731 - 2; | 7500 v640 = v731 - 2; |
7369 if ( !v640 || (v641 = v640 - 1) == 0 || (amount = 4, v641 != 1) ) | 7501 if ( !v640 || (v641 = v640 - 1) == 0 || (amount = 4, v641 != 1) ) |
7370 amount = 3; | 7502 amount = 3; |
7371 if ( pPlayer->uNumArmageddonCasts >= amount || pParty->armageddon_timer > 0 ) | 7503 if ( pPlayer->uNumArmageddonCasts >= amount || pParty->armageddon_timer > 0 ) |
7372 { | 7504 { |
7373 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed | 7505 ShowStatusBarString(pGlobalTXT_LocalizationStrings[428], 2); // Spell failed |
7374 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | 7506 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); |
7375 goto LABEL_203; | 7507 v3->spellnum = 0; |
7508 goto LABEL_1166; | |
7376 } | 7509 } |
7377 if ( !pPlayer->CanCastSpell(uRequiredMana) ) | 7510 if ( !pPlayer->CanCastSpell(uRequiredMana) ) |
7378 goto play_sound_and_continue; | 7511 goto play_sound_and_continue; |
7379 pParty->armageddon_timer = 256; | 7512 pParty->armageddon_timer = 256; |
7380 pParty->field_16140 = v2; | 7513 pParty->field_16140 = v2; |
7381 ++pPlayer->uNumArmageddonCasts; | 7514 ++pPlayer->uNumArmageddonCasts; |
7382 if ( pParty->bTurnBasedModeOn == 1 ) | 7515 if ( pParty->bTurnBasedModeOn == 1 ) |
7383 ++pTurnEngine->field_1C; | 7516 ++pTurnEngine->field_1C; |
7384 v726 = (Player *)50; | 7517 auto _v726 = 50; |
7385 do | 7518 do |
7386 { | 7519 { |
7387 v642 = rand() % 4096 - 2048; | 7520 v642 = rand() % 4096 - 2048; |
7388 v643 = rand(); | 7521 v643 = rand(); |
7389 v721 = v642 + pParty->vPosition.x; | 7522 v721 = v642 + pParty->vPosition.x; |
7390 y = (char *)(pParty->vPosition.y + v643 % 4096 - 2048); | 7523 y = (char *)(pParty->vPosition.y + v643 % 4096 - 2048); |
7391 v732 = GetTerrainHeightsAroundParty2(v642 + pParty->vPosition.x, (int)y, (int *)&v710, 0); | 7524 v732 = GetTerrainHeightsAroundParty2(v642 + pParty->vPosition.x, (int)y, (int *)&v710, 0); |
7392 v644 = rand(); | 7525 v644 = rand(); |
7393 sub_42F7EB_DropItemAt(0xFE6u, v721, (int)y, v732 + 16, v644 % 500 + 500, 1, 0, 0, 0); | 7526 sub_42F7EB_DropItemAt(0xFE6u, v721, (int)y, v732 + 16, v644 % 500 + 500, 1, 0, 0, 0); |
7394 v726 = (Player *)((char *)v726 - 1); | 7527 --_v726; |
7395 } | 7528 } |
7396 while ( *(float *)&v726 != 0.0 ); | 7529 while ( _v726 != 0 ); |
7397 goto LABEL_1056; | 7530 LODWORD(v727) = 1; |
7531 goto play_sound_and_continue; | |
7532 } | |
7533 | |
7398 default: | 7534 default: |
7399 goto play_sound_and_continue; | 7535 goto play_sound_and_continue; |
7400 } | 7536 } |
7401 while ( 2 ) | 7537 while ( 2 ) |
7402 { | 7538 { |
7409 goto LABEL_439; | 7545 goto LABEL_439; |
7410 } | 7546 } |
7411 } | 7547 } |
7412 else | 7548 else |
7413 { | 7549 { |
7414 v732 = amount << 7; | |
7415 v223 = ((Player *)v222)->DiscardConditionIfLastsLongerThan( | 7550 v223 = ((Player *)v222)->DiscardConditionIfLastsLongerThan( |
7416 2u, | 7551 2u, |
7417 pParty->uTimePlayed - (signed int)(signed __int64)((double)(amount << 7) * 0.033333335)); | 7552 pParty->uTimePlayed - (signed int)(signed __int64)((double)(amount << 7) * 0.033333335)); |
7418 v222 = (char *)HIDWORD(v733); | 7553 v222 = (char *)HIDWORD(v733); |
7419 if ( v223 ) | 7554 if ( v223 ) |
7421 ((Player *)v222)->PlaySound(SPEECH_103, 0); | 7556 ((Player *)v222)->PlaySound(SPEECH_103, 0); |
7422 } | 7557 } |
7423 v222 += 6972; | 7558 v222 += 6972; |
7424 HIDWORD(v733) = (int)v222; | 7559 HIDWORD(v733) = (int)v222; |
7425 if ( (signed int)v222 >= (signed int)pParty->pHirelings ) | 7560 if ( (signed int)v222 >= (signed int)pParty->pHirelings ) |
7426 goto LABEL_1056; | 7561 { |
7562 LODWORD(v727) = 1; | |
7563 goto play_sound_and_continue; | |
7564 } | |
7427 continue; | 7565 continue; |
7428 } | 7566 } |
7429 } | 7567 } |
7430 //----- (0042EB42) -------------------------------------------------------- | 7568 //----- (0042EB42) -------------------------------------------------------- |
7431 __int16 ObjectList::ObjectIDByItemID(unsigned __int16 uItemID) | 7569 __int16 ObjectList::ObjectIDByItemID(unsigned __int16 uItemID) |
7726 a3.x = actor->vPosition.x - pParty->vPosition.x; | 7864 a3.x = actor->vPosition.x - pParty->vPosition.x; |
7727 a3.y = actor->vPosition.y - pParty->vPosition.y; | 7865 a3.y = actor->vPosition.y - pParty->vPosition.y; |
7728 a3.z = actor->vPosition.z - pParty->vPosition.z; | 7866 a3.z = actor->vPosition.z - pParty->vPosition.z; |
7729 Vec3_int_::Normalize(&a3.x, &a3.y, &a3.z); | 7867 Vec3_int_::Normalize(&a3.x, &a3.y, &a3.z); |
7730 | 7868 |
7731 DamageMonsterFromParty((8 * (uActiveCharacter - 1)) | OBJECT_Player, target_id, &a3); | 7869 DamageMonsterFromParty(PID(OBJECT_Player, uActiveCharacter - 1), target_id, &a3); |
7732 if (player->WearsItem(ITEM_ARTIFACT_SPLITTER, 1) || player->WearsItem(ITEM_ARTIFACT_SPLITTER, 0)) | 7870 if (player->WearsItem(ITEM_ARTIFACT_SPLITTER, 1) || player->WearsItem(ITEM_ARTIFACT_SPLITTER, 0)) |
7733 _42FA66_do_explosive_impact( | 7871 _42FA66_do_explosive_impact( |
7734 actor->vPosition.x, | 7872 actor->vPosition.x, |
7735 actor->vPosition.y, | 7873 actor->vPosition.y, |
7736 actor->vPosition.z + actor->uActorHeight / 2, | 7874 actor->vPosition.z + actor->uActorHeight / 2, |
7854 v27 = v23 - v29; | 7992 v27 = v23 - v29; |
7855 do | 7993 do |
7856 { | 7994 { |
7857 v22 = *v28; | 7995 v22 = *v28; |
7858 v11 = *v28 & 0xFFFF; | 7996 v11 = *v28 & 0xFFFF; |
7859 if ( (*(char *)v28 & 7) == OBJECT_Actor) | 7997 if (PID_TYPE(v11) == OBJECT_Actor) |
7860 { | 7998 { |
7861 v12 = &pActors[(unsigned int)v11 >> 3]; | 7999 v12 = &pActors[PID_ID(v11)]; |
7862 v13 = v12->uAIState; | 8000 v13 = v12->uAIState; |
7863 if ( v13 != 5 ) | 8001 if ( v13 != 5 ) |
7864 { | 8002 { |
7865 if ( v13 != 4 | 8003 if ( v13 != 4 |
7866 && v13 != 11 | 8004 && v13 != 11 |
7867 && v13 != 19 | 8005 && v13 != 19 |
7868 && v13 != 17 | 8006 && v13 != 17 |
7869 && (!a3 || pActors[(unsigned int)v11 >> 3].GetActorsRelation(0)) ) | 8007 && (!a3 || pActors[PID_ID(v11)].GetActorsRelation(0)) ) |
7870 { | 8008 { |
7871 if ( (!a4 || MonsterStats::BelongsToSupertype(v12->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD)) | 8009 if ( (!a4 || MonsterStats::BelongsToSupertype(v12->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD)) |
7872 && v22 <= pick_depth << 16 ) | 8010 && v22 <= pick_depth << 16 ) |
7873 { | 8011 { |
7874 v14 = 0; | 8012 v14 = 0; |
8249 { | 8387 { |
8250 int v6; // edi@1 | 8388 int v6; // edi@1 |
8251 int v7; // esi@1 | 8389 int v7; // esi@1 |
8252 char *v8; // ecx@2 | 8390 char *v8; // ecx@2 |
8253 unsigned __int16 v9; // ax@5 | 8391 unsigned __int16 v9; // ax@5 |
8254 int v10; // eax@10 | 8392 //int v10; // eax@10 |
8255 signed int result; // eax@11 | 8393 signed int result; // eax@11 |
8256 __int16 v12; // ax@12 | 8394 //__int16 v12; // ax@12 |
8257 //SpriteObject a1a; // [sp+Ch] [bp-74h]@1 | 8395 //SpriteObject a1a; // [sp+Ch] [bp-74h]@1 |
8258 int v14; // [sp+7Ch] [bp-4h]@1 | 8396 int v14; // [sp+7Ch] [bp-4h]@1 |
8259 | 8397 |
8260 v6 = a1; | 8398 v6 = a1; |
8261 v7 = a2; | 8399 v7 = a2; |
8296 a1a.field_60_distance_related_prolly_lod = 0; | 8434 a1a.field_60_distance_related_prolly_lod = 0; |
8297 a1a.uFacing = 0; | 8435 a1a.uFacing = 0; |
8298 a1a.uSoundID = 0; | 8436 a1a.uSoundID = 0; |
8299 if ( a6 >= 1 || a6 <= 4 ) | 8437 if ( a6 >= 1 || a6 <= 4 ) |
8300 { | 8438 { |
8301 v10 = 8 * a6 - 8; | 8439 a1a.spell_caster_pid = PID(OBJECT_Player, a6 - 1); |
8302 LOBYTE(v10) = v10 | OBJECT_Player; | |
8303 a1a.spell_caster_pid = v10; | |
8304 } | 8440 } |
8305 else | 8441 else |
8306 { | 8442 { |
8307 a1a.spell_caster_pid = 0; | 8443 a1a.spell_caster_pid = 0; |
8308 } | 8444 } |
8309 result = a1a.Create(0, 0, 0, 0); | 8445 result = a1a.Create(0, 0, 0, 0); |
8310 if ( result != -1 ) | 8446 if ( result != -1 ) |
8311 { | 8447 { |
8312 v12 = 8 * result; | 8448 result = stru_50FE08.Add(PID(OBJECT_Item, result), |
8313 LOBYTE(v12) = v12 | 2; | |
8314 result = stru_50FE08.Add( | |
8315 v12, | |
8316 a5, | 8449 a5, |
8317 SLOWORD(a1a.vPosition.x), | 8450 SLOWORD(a1a.vPosition.x), |
8318 SLOWORD(a1a.vPosition.y), | 8451 SLOWORD(a1a.vPosition.y), |
8319 SLOWORD(a1a.vPosition.z), | 8452 SLOWORD(a1a.vPosition.z), |
8320 0, | 8453 0, |
8647 v6 = pPlayers[uActiveCharacter]; | 8780 v6 = pPlayers[uActiveCharacter]; |
8648 if ( !v6->uTimeToRecovery ) | 8781 if ( !v6->uTimeToRecovery ) |
8649 { | 8782 { |
8650 v24 = v6->GetAttackRecoveryTime(false); | 8783 v24 = v6->GetAttackRecoveryTime(false); |
8651 if ( !pParty->bTurnBasedModeOn ) | 8784 if ( !pParty->bTurnBasedModeOn ) |
8652 pPlayers[uActiveCharacter]->SetRecoveryTime( | 8785 pPlayers[uActiveCharacter]->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * (double)v24 * 2.133333333333333)); |
8653 (signed __int64)(flt_6BE3A4_debug_recmod1 * (double)v24 * 2.133333333333333)); | |
8654 pStru277->_427D48(uActiveCharacter); | 8786 pStru277->_427D48(uActiveCharacter); |
8655 pTurnEngine->_40471C(); | 8787 pTurnEngine->_40471C(); |
8656 } | 8788 } |
8657 } | 8789 } |
8658 break; | 8790 break; |
8660 //__debugbreak(); | 8792 //__debugbreak(); |
8661 if (pCurrentScreen == SCREEN_GAME) | 8793 if (pCurrentScreen == SCREEN_GAME) |
8662 { | 8794 { |
8663 if (pParty->bTurnBasedModeOn) | 8795 if (pParty->bTurnBasedModeOn) |
8664 { | 8796 { |
8665 if ( pTurnEngine->field_4 == OBJECT_Actor || (pTurnEngine->pQueue[0].uPackedID & 7) == OBJECT_Player) | 8797 if (pTurnEngine->field_4 == OBJECT_Actor || PID_TYPE(pTurnEngine->pQueue[0].uPackedID) == OBJECT_Player) |
8666 { | 8798 { |
8667 pParty->bTurnBasedModeOn = 0; | 8799 pParty->bTurnBasedModeOn = 0; |
8668 pTurnEngine->End(true); | 8800 pTurnEngine->End(true); |
8669 } | 8801 } |
8670 } | 8802 } |