48 signed int spell_pointed_target;
54 int spell_spray_angle_start;
55 int spell_spray_angle_end;
56 double spell_recharge_factor;
92 unsigned __int64 v685;
93 unsigned __int64 v687;
111 bool spell_sound_flag =
false;
119 signed int spell_targeted_at = 0;
135 if (pCastSpell->
uFlags & ON_CAST_CastingInProgress) {
147 if (spell_targeted_at == 0) {
156 5120, 1, target_undead);
161 pActors[PID_ID(spell_pointed_target)].CanAct())
171 spell_targeted_at, &target_direction,
208 assert(
false &&
"Unknown spell");
213 if (
engine->config->debug_all_magic) {
268 "Unknown spell effect #101 (prolly flaming bow arrow");
273 if (skill_level >= 3) amount = 2;
302 for (
int i = 0; i < amount; ++i) {
368 switch (skill_level) {
387 skill_level, amount, 0, 0);
388 spell_sound_flag =
true;
394 switch (skill_level) {
415 object->spell_caster_pid ==
419 if (_v733 > amount) {
459 spell_sound_flag =
true;
465 monster_id = PID_ID(spell_targeted_at);
467 if (!spell_targeted_at) {
501 spell_sound_flag =
true;
507 monster_id = PID_ID(spell_targeted_at);
540 spell_sound_flag =
true;
547 !spell_targeted_at ||
563 pActors[PID_ID(spell_targeted_at)].vPosition.x;
565 pActors[PID_ID(spell_targeted_at)].vPosition.y;
567 pActors[PID_ID(spell_targeted_at)].vPosition.z;
581 int obj_id = pSpellSprite.
Create(0, 0, 0, 0);
583 pActors[PID_ID(spell_targeted_at)].pMonsterInfo.uID,
592 PID_ID(spell_targeted_at), &v691);
593 spell_sound_flag =
true;
650 spell_sound_flag =
true;
692 spell_sound_flag =
true;
742 spell_sound_flag =
true;
750 monster_id = PID_ID(spell_targeted_at);
757 skill_level, 0, 0, 0);
758 pActors[monster_id].uAttributes |= ACTOR_AGGRESSOR;
759 pActors[monster_id].vVelocity.x = 0;
760 pActors[monster_id].vVelocity.y = 0;
763 spell_sound_flag =
true;
769 switch (skill_level) {
771 spellduration = 180 * spell_level;
775 spellduration = 300 * spell_level;
779 spellduration = 300 * spell_level;
783 spellduration = 300 * spell_level;
791 monster_id = PID_ID(spell_targeted_at);
797 skill_level, amount, 0, 0);
798 pActors[monster_id].uAttributes |= ACTOR_AGGRESSOR;
801 spell_sound_flag =
true;
807 monster_id = PID_ID(spell_targeted_at);
810 uint power = 300 * spell_level;
811 if (skill_level == 2)
812 power = 600 * spell_level;
813 else if (skill_level == 3)
823 skill_level, 0, 0, 0);
833 pActors[monster_id].uActorHeight;
837 pActors[monster_id].vPosition.y,
850 spell_sound_flag =
true;
889 spell_sound_flag =
true;
895 switch (skill_level) {
897 spellduration = 3600 * spell_level;
901 spellduration = 3600 * spell_level;
905 spellduration = 3600 * spell_level;
917 .pInventoryItemList[spell_targeted_at - 1];
929 if (skill_level != 4) {
937 spell_sound_flag =
true;
953 switch (skill_level) {
976 skill_level, amount, 0, 0);
977 spell_sound_flag =
true;
988 switch (skill_level) {
993 amount = skill_level * spell_level;
1034 skill_level, amount, 0, 0);
1035 spell_sound_flag =
true;
1041 switch (skill_level) {
1043 spellduration = 60 * (spell_level + 60);
1046 spellduration = 60 * (spell_level + 60);
1049 spellduration = 180 * (spell_level + 20);
1052 spellduration = 240 * (spell_level + 15);
1058 spell_sound_flag =
true;
1059 for (
uint pl_id = 0; pl_id < 4; pl_id++) {
1063 spell_sound_flag =
false;
1065 if (spell_sound_flag) {
1069 skill_level, 0, 0, 0);
1085 switch (skill_level) {
1087 spellduration = 300 * (spell_level + 12);
1090 spellduration = 300 * (spell_level + 12);
1093 spellduration = 900 * (spell_level + 4);
1096 spellduration = 3600 * (spell_level + 1);
1101 amount = spell_level + 5;
1103 if (skill_level == 1) {
1112 1, amount, spell_overlay_id, 0);
1113 spell_sound_flag =
true;
1116 for (
uint pl_id = 0; pl_id < 4; pl_id++) {
1120 10000, pl_id + 310, 0, 65536);
1124 skill_level, amount, spell_overlay_id, 0);
1126 spell_sound_flag =
true;
1134 int monster_id = PID_ID(spell_targeted_at);
1135 dist_X = abs(
pActors[monster_id].vPosition.x -
1137 dist_Y = abs(
pActors[monster_id].vPosition.y -
1139 dist_Z = abs(
pActors[monster_id].vPosition.z -
1142 if ((
double)
count <= 307.2) {
1161 pActors[monster_id].vPosition.x;
1163 pActors[monster_id].vPosition.y;
1165 pActors[monster_id].vPosition.z -
1166 (
int)((double)
pActors[monster_id].uActorHeight *
1173 spell_sound_flag =
true;
1188 switch (skill_level) {
1190 spellduration = 300 * (spell_level + 12);
1193 spellduration = 300 * (spell_level + 12);
1196 spellduration = 900 * (spell_level + 4);
1199 spellduration = 3600 * (spell_level + 1);
1210 amount = spell_level + 5;
1214 amount = spell_level + 5;
1233 skill_level, amount, 0, 0);
1234 spell_sound_flag =
true;
1240 if (skill_level == 4)
1241 spellduration = 600 * spell_level;
1243 spellduration = 60 * spell_level;
1256 skill_level, spell_level, 0, 0);
1257 spell_sound_flag =
true;
1266 if (skill_level == 4)
1279 obj_type = PID_TYPE(spell_targeted_at);
1280 monster_id = PID_ID(spell_targeted_at);
1284 dist_X =
pActors[monster_id].vPosition.x;
1285 dist_Y =
pActors[monster_id].vPosition.y;
1286 dist_Z =
pActors[monster_id].vPosition.z;
1296 unsigned __int64 k = 0;
1298 if (meteor_num > 0) {
1299 v730 = obj_type ==
OBJECT_Actor ? spell_targeted_at : 0;
1300 for (meteor_num; meteor_num; meteor_num--) {
1301 spell_targeted_at = rand() % 1000;
1302 if (sqrt(((
double)spell_targeted_at - 2500) *
1303 ((
double)spell_targeted_at - 2500) +
1304 j * j + k * k) <= 1.0) {
1305 HEXRAYS_LODWORD(v687) = 0;
1306 HEXRAYS_HIDWORD(v687) = 0;
1309 (
signed __int64)sqrt((
float)(j * j + k * k)),
1310 (
double)spell_targeted_at - 2500);
1322 pSpellSprite.
vPosition.z = spell_targeted_at + dist_Z;
1335 if (pSpellSprite.
Create(v687, HEXRAYS_SHIDWORD(v687),
1340 j = rand() % 1024 - 512;
1341 k = rand() % 1024 - 512;
1344 spell_sound_flag =
true;
1359 int mon_num =
render->GetActorsInViewport(4096);
1377 for (
uint i = 0; i < mon_num; i++) {
1384 (
unsigned int)(
signed __int64)((double)
pActors
1400 spell_sound_flag =
true;
1406 spellduration = 3600 * spell_level;
1408 for (
uint pl_id = 0; pl_id < 4; pl_id++)
1414 skill_level, 0, spell_overlay_id, 0);
1415 spell_sound_flag =
true;
1421 switch (skill_level) {
1423 spellduration = 300 * spell_level;
1426 spellduration = 600 * spell_level;
1429 spellduration = 3600 * spell_level;
1432 spellduration = 3600 * spell_level;
1438 for (
uint pl_id = 0; pl_id < 4; pl_id++)
1452 skill_level, 0, 0, 0);
1453 spell_sound_flag =
true;
1459 switch (skill_level) {
1501 spell_spray_angle_start = (int)_v726 / -2;
1502 spell_spray_angle_end = (int)_v726 / 2;
1503 while (spell_spray_angle_start <= spell_spray_angle_end) {
1504 pSpellSprite.
uFacing = spell_spray_angle_start + (short)target_direction.
uYawAngle;
1513 spell_spray_angle_start += _v726 / (amount - 1);
1515 spell_sound_flag =
true;
1529 for (
uint pl_id = 0; pl_id < 4; pl_id++)
1533 spell_sound_flag =
true;
1539 switch (skill_level) {
1541 spellduration = 600 * spell_level;
1542 amount = spell_level;
1545 spellduration = 600 * spell_level;
1546 amount = 2 * spell_level;
1549 spellduration = 600 * spell_level;
1550 amount = 3 * spell_level;
1553 spellduration = 3600 * spell_level;
1554 amount = 4 * spell_level;
1579 skill_level, amount, 0, 0);
1580 spell_sound_flag =
true;
1599 if (skill_level == 1 || skill_level == 2 || skill_level == 3)
1604 for (
uint pl_id = 0; pl_id < 4; pl_id++)
1611 skill_level, amount, spell_overlay_id,
1613 spell_sound_flag =
true;
1627 obj_type = PID_TYPE(spell_targeted_at);
1628 monster_id = PID_ID(spell_targeted_at);
1630 dist_X =
pActors[monster_id].vPosition.x;
1631 dist_Y =
pActors[monster_id].vPosition.y;
1632 dist_Z =
pActors[monster_id].vPosition.z;
1642 unsigned __int64 k = 0;
1644 v730 = obj_type ==
OBJECT_Actor ? spell_targeted_at : 0;
1645 for (
uint star_num = 20; star_num; star_num--) {
1646 spell_targeted_at = rand() % 1000;
1647 if (sqrt(((
double)spell_targeted_at + (
double)dist_Z -
1648 (
double)(dist_Z + 2500)) *
1649 ((
double)spell_targeted_at + (
double)dist_Z -
1650 (
double)(dist_Z + 2500)) +
1651 j * j + k * k) <= 1.0) {
1652 HEXRAYS_LODWORD(v685) = 0;
1653 HEXRAYS_HIDWORD(v685) = 0;
1656 (
signed __int64)sqrt((
float)(j * j + k * k)),
1657 ((
double)spell_targeted_at + (
double)dist_Z -
1658 (
double)(dist_Z + 2500)));
1671 (int)(spell_targeted_at + (dist_Z + 2500));
1684 if (pSpellSprite.
Create(v685, HEXRAYS_SHIDWORD(v685),
1689 j = rand() % 1024 - 512;
1690 k = rand() % 1024 - 512;
1692 spell_sound_flag =
true;
1698 switch (skill_level) {
1700 amount = 180 * spell_level;
1703 amount = 3600 * spell_level;
1706 amount = 86400 * spell_level;
1715 for (
int i = 0; i < 4; i++) {
1716 if (skill_level == 4) {
1727 .DiscardConditionIfLastsLongerThan(
1733 spell_sound_flag =
true;
1739 switch (skill_level) {
1814 spell_spray_angle_start = _v733 / -2;
1815 spell_spray_angle_end = _v733 / 2;
1816 if (spell_spray_angle_start <= spell_spray_angle_end) {
1818 pSpellSprite.
uFacing = spell_spray_angle_start +
1830 spell_spray_angle_start += _v733 / (amount - 1);
1831 }
while (spell_spray_angle_start <=
1832 spell_spray_angle_end);
1835 spell_sound_flag =
true;
1847 switch (skill_level) {
1850 spellduration = 600 * spell_level;
1854 spellduration = 3600 * spell_level;
1869 skill_level, amount, spell_overlay_id,
1871 if (skill_level == 4)
1873 spell_sound_flag =
true;
1881 .pInventoryItemList[spell_targeted_at];
1892 if (skill_level == 1 || skill_level == 2)
1893 spell_recharge_factor =
1894 (double)spell_level * 0.0099999998 + 0.5;
1895 else if (skill_level == 3)
1896 spell_recharge_factor = (double)spell_level * 0.0099999998 + 0.69999999;
1897 else if (skill_level == 4)
1898 spell_recharge_factor = (double)spell_level * 0.0099999998 + 0.80000001;
1900 spell_recharge_factor = 0.0;
1901 if (spell_recharge_factor > 1.0) spell_recharge_factor = 1.0;
1902 int uNewCharges = v730c->
uMaxCharges * spell_recharge_factor;
1905 if (uNewCharges <= 0) {
1914 spell_level = spell_level;
1919 spell_sound_flag =
true;
1926 amount = 10 * spell_level;
1927 bool item_not_broken =
true;
1928 int rnd = rand() % 100;
1930 spell_item_to_enchant =
1934 if ((skill_level == 1 ||
1936 skill_level == 3 || skill_level == 4) &&
1937 spell_item_to_enchant->
uItemID <= 134 &&
1941 !spell_item_to_enchant->
IsBroken()) {
1942 if ((spell_item_to_enchant->
GetValue() < 450 &&
1943 (skill_level == 1 || skill_level == 2)) ||
1944 (spell_item_to_enchant->
GetValue() < 450 &&
1945 (skill_level == 3 || skill_level == 4) &&
1948 (spell_item_to_enchant->
GetValue() < 250 &&
1949 (skill_level == 3 || skill_level == 4) &&
1956 item_not_broken =
false;
1958 if (rnd >= 10 * spell_level) {
1965 (skill_level == 3 || skill_level == 4)) ||
1966 spell_item_to_enchant->
GetValue() < 450 ||
1967 (spell_item_to_enchant->
GetValue() < 250 &&
1968 (skill_level == 3 || skill_level == 4) &&
1999 spell_item_to_enchant
2006 spell_sound_flag =
true;
2008 }
else if (skill_level == 3 ||
2017 ->pSpecialEnchantments_count > 0) {
2025 ->pSpecialEnchantments
2028 if (!v259 || v259 == 1) {
2034 [spell_item_to_enchant
2042 *(
int *)v261 = _v733;
2048 v262 = rand() % v725;
2055 [spell_item_to_enchant
2060 for (
int *ii = v679;;
2062 v267 = (int)(ii + 1);
2064 v268 = *(
int *)v267;
2065 *(
int *)(spell_item_to_enchant +
2071 [spell_item_to_enchant
2074 if (v264 >= v265)
break;
2080 ->pSpecialEnchantments_count > 0) {
2089 ->pSpecialEnchantments[v278]
2091 if (!v279 || v279 == 1) {
2097 [spell_item_to_enchant
2109 v282 = rand() % _v733;
2116 [spell_item_to_enchant
2119 for (
l = v679; v284 < v285; ++
l) {
2120 spell_item_to_enchant
2127 [spell_item_to_enchant
2128 ->GetItemEquipType()];
2132 spell_item_to_enchant
2133 ->special_enchantment +
2137 spell_sound_flag =
true;
2144 if (spell_sound_flag == 0) {
2147 if (item_not_broken ==
false)
2164 amount = 10 * spell_level;
2169 rand() % 100 >= amount && skill_level != 4) {
2180 spell_sound_flag =
true;
2196 (
signed int)(604800 * spell_level);
2202 pCastSpell->
uFlags |= ON_CAST_NoRecoverySpell;
2208 switch (skill_level) {
2210 amount = 3600 * spell_level;
2213 amount = 3600 * spell_level;
2216 amount = 86400 * spell_level;
2227 if (skill_level == 4) {
2231 spell_sound_flag =
true;
2236 .DiscardConditionIfLastsLongerThan(
2241 spell_sound_flag =
true;
2279 spell_sound_flag =
true;
2321 spell_sound_flag =
true;
2327 switch (skill_level) {
2329 amount = 600 * spell_level;
2332 amount = 1800 * spell_level;
2336 amount = 3600 * spell_level;
2352 skill_level, 0, 0, 0);
2353 spell_sound_flag =
true;
2359 switch (skill_level) {
2361 amount = spell_level;
2364 amount = 2 * spell_level;
2367 amount = 4 * spell_level;
2370 amount = 6 * spell_level;
2384 skill_level, amount, 0, 0);
2385 spell_sound_flag =
true;
2392 skill_level, amount, 0, 0);
2393 pActors[monster_id].uAttributes |= ACTOR_AGGRESSOR;
2398 spell_sound_flag =
true;
2404 switch (skill_level) {
2406 amount = 3600 * spell_level;
2409 amount = 3600 * spell_level;
2412 amount = 86400 * spell_level;
2424 spell_sound_flag =
true;
2427 if (skill_level == 4) {
2433 .DiscardConditionIfLastsLongerThan(
2440 spell_sound_flag =
true;
2446 spell_sound_flag =
true;
2452 if (skill_level == 4)
2453 spellduration = 900 * (spell_level + 4);
2455 spellduration = 300 * (spell_level + 12);
2457 if (skill_level == 1 || skill_level == 2) {
2464 skill_level, 0, 0, 0);
2465 spell_sound_flag =
true;
2468 for (
uint pl_id = 0; pl_id < 4; pl_id++) {
2475 skill_level, 0, 0, 0);
2477 spell_sound_flag =
true;
2483 if (skill_level == 1 || skill_level == 2)
2484 spellduration = 60 * (spell_level + 3);
2486 spellduration = 300 * spell_level + 180;
2488 int mon_num =
render->GetActorsInViewport(4096);
2508 for (spell_targeted_at = 0; spell_targeted_at < mon_num;
2509 ++spell_targeted_at) {
2512 [spell_targeted_at]]
2517 [spell_targeted_at]]
2521 [spell_targeted_at]]
2525 [spell_targeted_at]]
2528 [spell_targeted_at]]
2534 pSpellSprite.
Create(0, 0, 0, 0);
2540 skill_level, 0, 0, 0);
2543 spell_sound_flag =
true;
2549 if (skill_level == 4)
2552 amount = 86400 * spell_level;
2559 spell_sound_flag =
true;
2563 if (skill_level == 4) {
2572 .DiscardConditionIfLastsLongerThan(
2576 .DiscardConditionIfLastsLongerThan(
2583 spell_sound_flag =
true;
2589 if (skill_level == 4)
2590 amount = 4 * spell_level;
2592 amount = 3 * spell_level;
2594 int active_pl_num = 0;
2595 signed int shared_life_count = amount;
2598 for (
uint pl_id = 1; pl_id <= 4; pl_id++) {
2608 pl_array[active_pl_num++] = pl_id;
2610 for (
uint i = 0; i < active_pl_num; i++)
2611 shared_life_count +=
pPlayers[pl_array[i]]->sHealth;
2612 mean_life = (
int64_t)((
double)shared_life_count /
2613 (double)active_pl_num);
2614 for (
uint i = 0; i < active_pl_num; i++) {
2615 pPlayers[pl_array[i]]->sHealth = mean_life;
2616 if (
pPlayers[pl_array[i]]->sHealth >
2617 pPlayers[pl_array[i]]->GetMaxHealth())
2619 pPlayers[pl_array[i]]->GetMaxHealth();
2620 if (
pPlayers[pl_array[i]]->sHealth > 0)
2623 pCastSpell->
uSpellID, pl_array[i] - 1);
2625 spell_sound_flag =
true;
2631 switch (skill_level) {
2633 amount = 180 * spell_level;
2636 amount = 10800 * spell_level;
2639 amount = 259200 * spell_level;
2659 if (skill_level == 4) {
2671 .DiscardConditionIfLastsLongerThan(
2676 .DiscardConditionIfLastsLongerThan(
2681 .DiscardConditionIfLastsLongerThan(
2692 spell_sound_flag =
true;
2698 switch (skill_level) {
2700 amount = 3600 * spell_level;
2703 amount = 3600 * spell_level;
2706 amount = 86400 * spell_level;
2720 spell_sound_flag =
true;
2723 if (skill_level == 4) {
2727 spell_sound_flag =
true;
2732 .DiscardConditionIfLastsLongerThan(
2736 spell_sound_flag =
true;
2742 switch (skill_level) {
2744 amount = 180 * spell_level;
2747 amount = 3600 * spell_level;
2750 amount = 86400 * spell_level;
2764 spell_sound_flag =
true;
2767 if (skill_level == 4) {
2771 spell_sound_flag =
true;
2776 .DiscardConditionIfLastsLongerThan(
2780 spell_sound_flag =
true;
2788 monster_id = PID_ID(spell_targeted_at);
2789 if (!
pActors[monster_id].ActorHasItem())
2790 pActors[monster_id].SetRandomGoldIfTheresNoItem();
2794 [
pActors[monster_id].ActorHasItems[3].uItemID]
2796 gold_num =
pActors[monster_id]
2798 .special_enchantment;
2801 if (
pActors[monster_id].uCarriedItemID) {
2804 for (
uint i = 0; i < 4; ++i) {
2805 if (
pActors[monster_id].ActorHasItems[i].uItemID >
2813 &
pActors[monster_id].ActorHasItems[i],
2815 spell_level = spell_level;
2822 "(%s), and %d gold",
2860 spell_sound_flag =
true;
2866 switch (skill_level) {
2868 amount = 300 * spell_level;
2871 amount = 300 * spell_level;
2874 amount = 600 * spell_level;
2883 monster_id = PID_ID(spell_targeted_at);
2886 if (
pActors[monster_id].DoesDmgTypeDoDamage(
2898 skill_level, 0, 0, 0);
2899 pActors[monster_id].pMonsterInfo.uHostilityType =
2911 pActors[monster_id].uActorHeight;
2915 pActors[monster_id].vPosition.y,
2928 spell_sound_flag =
true;
2935 amount = 600 * spell_level;
2937 monster_id = PID_ID(spell_targeted_at);
2940 pActors[monster_id].pMonsterInfo.uID,
2943 if (
pActors[monster_id].DoesDmgTypeDoDamage(
2955 skill_level, 0, 0, 0);
2966 pActors[monster_id].uActorHeight;
2970 pActors[monster_id].vPosition.y,
2983 spell_sound_flag =
true;
2988 if (skill_level == 4)
2989 amount = 300 * spell_level;
2991 amount = 180 * spell_level;
2993 int mon_num =
render->GetActorsInViewport(4096);
3013 for (spell_targeted_at = 0; spell_targeted_at < mon_num;
3014 ++spell_targeted_at) {
3017 [spell_targeted_at]]
3035 [spell_targeted_at]]
3041 pSpellSprite.
Create(0, 0, 0, 0);
3050 skill_level, 0, 0, 0);
3053 spell_sound_flag =
true;
3059 if (skill_level == 4)
3062 amount = 86400 * spell_level;
3074 if (skill_level == 4)
3080 .DiscardConditionIfLastsLongerThan(
3087 spell_sound_flag =
true;
3093 switch (skill_level) {
3095 amount = 2 * spell_level;
3098 amount = 2 * spell_level;
3101 amount = 3 * spell_level;
3104 amount = 4 * spell_level;
3110 int obj_id = PID_ID(spell_targeted_at);
3114 .containing_item.uItemID]
3118 .containing_item.special_enchantment,
3125 .containing_item.uItemID]
3126 .pUnidentifiedName));
3141 spell_targeted_at, 1);
3143 .containing_item.uItemID]
3164 .pFaces[obj_id & 0x3F]
3168 spell_sound_flag =
true;
3174 switch (skill_level) {
3176 amount = 180 * spell_level;
3179 amount = 3600 * spell_level;
3182 amount = 86400 * spell_level;
3196 if (skill_level == 4) {
3200 spell_sound_flag =
true;
3204 .DiscardConditionIfLastsLongerThan(
3208 spell_sound_flag =
true;
3214 switch (skill_level) {
3216 amount = 2 * spell_level + 5;
3219 amount = 3 * spell_level + 5;
3222 amount = 4 * spell_level + 5;
3225 amount = 5 * spell_level + 5;
3242 pActors[monster_id].sCurrentHP += amount;
3243 if (
pActors[monster_id].sCurrentHP >
3244 pActors[monster_id].pMonsterInfo.uHP)
3245 pActors[monster_id].sCurrentHP =
3246 pActors[monster_id].pMonsterInfo.uHP;
3249 spell_sound_flag =
true;
3255 switch (skill_level) {
3257 amount = 3600 * spell_level;
3260 amount = 3600 * spell_level;
3263 amount = 86400 * spell_level;
3285 if (skill_level == 4) {
3295 spell_sound_flag =
true;
3300 .DiscardConditionIfLastsLongerThan(
3305 .DiscardConditionIfLastsLongerThan(
3310 .DiscardConditionIfLastsLongerThan(
3315 spell_sound_flag =
true;
3334 skill_level, spell_level, 0, 0);
3335 spell_sound_flag =
true;
3342 if (skill_level == 4) {
3351 for (
uint pl_id = 0; pl_id < 4; pl_id++) {
3357 4, spell_level, spell_level, 0);
3359 spell_sound_flag =
true;
3368 skill_level, spell_level, spell_level, 0);
3369 spell_sound_flag =
true;
3376 for (
uint pl_id = 0; pl_id < 4; ++pl_id) {
3381 spell_sound_flag =
true;
3391 int mon_num =
render->GetActorsInViewport(4096);
3411 for (spell_targeted_at = 0; spell_targeted_at < mon_num;
3412 ++spell_targeted_at) {
3426 [spell_targeted_at]]
3437 for (spell_targeted_at = 0; spell_targeted_at < mon_num;
3438 ++spell_targeted_at) {
3451 (
unsigned int)(
signed __int64)((double)
pActors
3453 [spell_targeted_at]]
3459 pSpellSprite.
Create(0, 0, 0, 0);
3460 for (
int i = 0; i < 22; ++i)
3466 spell_sound_flag =
true;
3472 switch (skill_level) {
3474 spellduration = 300 * spell_level;
3478 spellduration = 300 * spell_level;
3482 spellduration = 900 * spell_level;
3486 spellduration = 900 * spell_level;
3499 pActors[monster_id].uSummonerID)
3502 if (mon_num >= amount) {
3513 skill_level, spellduration);
3514 spell_sound_flag =
true;
3520 switch (skill_level) {
3522 spellduration = 10800 * spell_level;
3523 amount = 3 * spell_level + 10;
3526 spellduration = 10800 * spell_level;
3527 amount = 3 * spell_level + 10;
3530 spellduration = 14400 * spell_level;
3531 amount = 4 * spell_level + 10;
3534 spellduration = 18000 * spell_level;
3535 amount = 5 * spell_level + 10;
3552 skill_level, amount, 0, 0);
3553 spell_sound_flag =
true;
3567 int mon_num =
render->GetActorsInViewport(4096);
3587 for (
uint monster_id = 0; monster_id < mon_num; monster_id++) {
3609 spell_sound_flag =
true;
3615 switch (skill_level) {
3617 spellduration = 14400 * spell_level;
3618 amount = 4 * spell_level;
3621 spellduration = 14400 * spell_level;
3622 amount = 4 * spell_level;
3625 spellduration = 14400 * spell_level;
3626 amount = 4 * spell_level;
3629 spellduration = 18000 * spell_level;
3630 amount = 5 * spell_level;
3647 skill_level, amount, 0, 0);
3651 skill_level, amount, 0, 0);
3655 skill_level, amount, 0, 0);
3659 skill_level, amount, 0, 0);
3663 skill_level, amount, 0, 0);
3667 skill_level, amount, 0, 0);
3671 skill_level, spell_level + 5, 0, 0);
3675 skill_level, spell_level + 5, 0, 0);
3676 spell_sound_flag =
true;
3682 switch (skill_level) {
3703 bool player_weak =
false;
3704 for (
uint pl_id = 0; pl_id < 4; pl_id++) {
3717 300 * amount * spell_level + 60)),
3718 skill_level, spell_level + 5, 0, 0);
3728 skill_level, spell_level + 5, 0, 0);
3732 skill_level, 0, 0, 0);
3736 skill_level, spell_level + 5, 0, 0);
3741 60 * (spell_level * spellduration + 60))),
3742 skill_level, spell_level + 5, 0, 0);
3743 spell_sound_flag =
true;
3758 for (
uint pl_id = 0; pl_id < 4; pl_id++) {
3759 for (
uint buff_id = 0; buff_id <= 19; buff_id++)
3761 .conditions_times[buff_id]
3776 spell_sound_flag =
true;
3782 switch (skill_level) {
3784 amount = 2 * spell_level;
3787 amount = 3 * spell_level;
3790 amount = 4 * spell_level;
3793 amount = 5 * spell_level;
3810 .GetSexByVoice() != 0) +
3819 if (monster_id == -1) {
3827 if (
pActors[monster_id].sCurrentHP > 0 ||
3856 pActors[monster_id].vPosition.z -
3857 (
int)((double)
pActors[monster_id].uActorHeight * -0.8);
3859 pSpellSprite.
Create(0, 0, 0, 0);
3860 if (
pActors[monster_id].pMonsterInfo.uLevel > amount)
break;
3862 pActors[monster_id].pMonsterInfo.uHostilityType =
3864 pActors[monster_id].pMonsterInfo.uTreasureDropChance = 0;
3865 pActors[monster_id].pMonsterInfo.uTreasureDiceRolls = 0;
3866 pActors[monster_id].pMonsterInfo.uTreasureDiceSides = 0;
3867 pActors[monster_id].pMonsterInfo.uTreasureLevel = 0;
3868 pActors[monster_id].pMonsterInfo.uTreasureType = 0;
3869 pActors[monster_id].uAlly = 9999;
3870 pActors[monster_id].ResetAggressor();
3871 pActors[monster_id].uGroup = 0;
3875 if (
pActors[monster_id].sCurrentHP > 10 * amount)
3876 pActors[monster_id].sCurrentHP = 10 * amount;
3877 spell_sound_flag =
true;
3884 if (skill_level == 4)
3887 spellduration = 3600 * spell_level;
3890 .pInventoryItemList[spell_targeted_at];
3914 if (skill_level != 4) {
3921 spell_sound_flag =
true;
3927 switch (skill_level) {
3970 spell_spray_angle_start = (
signed int)_v726 / -2;
3971 spell_spray_angle_end = (
signed int)_v726 / 2;
3972 if (spell_spray_angle_start <= spell_spray_angle_end) {
3974 pSpellSprite.
uFacing = spell_spray_angle_start +
3986 spell_spray_angle_start += _v726 / (amount - 1);
3987 }
while (spell_spray_angle_start <= spell_spray_angle_end);
3989 spell_sound_flag =
true;
3996 switch (skill_level) {
3998 spellduration = 180 * spell_level;
4001 spellduration = 180 * spell_level;
4004 spellduration = 300 * spell_level;
4007 spellduration = 29030400;
4013 monster_id = PID_ID(spell_targeted_at);
4015 pActors[monster_id].pMonsterInfo.uID,
4018 if (!
pActors[monster_id].DoesDmgTypeDoDamage(
4031 skill_level, 0, 0, 0);
4041 pActors[monster_id].uActorHeight;
4045 pActors[monster_id].vPosition.y,
4058 spell_sound_flag =
true;
4067 for (
uint npc_id = 0; npc_id < 2;
4097 for (
uint pl_id = 0; pl_id < 4; pl_id++) {
4108 spell_sound_flag =
true;
4113 switch (skill_level) {
4115 spellduration = 300 * (spell_level + 12);
4118 spellduration = 300 * (spell_level + 12);
4121 spellduration = 300 * (spell_level + 12);
4124 spellduration = 900 * (spell_level + 4);
4129 amount = spell_level + 5;
4131 if (skill_level != 3 && skill_level != 4) {
4138 skill_level, amount, 0, 0);
4139 spell_sound_flag =
true;
4142 for (
uint pl_id = 0; pl_id < 4; pl_id++) {
4149 skill_level, amount, 0, 0);
4151 spell_sound_flag =
true;
4158 int mon_num =
render->GetActorsInViewport(
4179 amount = (mon_num * (7 * spell_level + 25));
4180 for (
uint monster_id = 0; monster_id < mon_num;
4205 for (
uint pl_id = 1; pl_id <= 4; ++pl_id) {
4224 pl_array[pl_num++] = pl_id;
4227 for (
uint j = 0; j < pl_num; j++) {
4229 (
signed __int64)((
double)(
signed int)amount /
4231 if (
pPlayers[pl_array[j]]->sHealth >
4232 pPlayers[pl_array[j]]->GetMaxHealth())
4234 pPlayers[pl_array[j]]->GetMaxHealth();
4236 pCastSpell->
uSpellID, pl_array[j]);
4240 spell_sound_flag =
true;
4254 if (skill_level == 4)
4274 for (
uint i = 0; i < 50; i++) {
4275 v642 = rand() % 4096 - 2048;
4277 bool bOnWater =
false;
4285 rand() % 500 + 500, 1, 0, 0, 0);
4287 spell_sound_flag =
true;
4294 if (~pCastSpell->
uFlags & ON_CAST_NoRecoverySpell) {
4316 if (spell_sound_flag) {
4330 __int16 skill_level,
uint16_t uFlags,
4331 int spell_sound_id) {
4370 unsigned int uPlayerID,
4371 unsigned int a4, __int16
flags,
4373 unsigned __int16 v9;
4375 unsigned __int8 v11;
4376 unsigned __int8 v12;
4377 unsigned __int16 v13;
4391 assert(uPlayerID < 4);
4393 if (!(
flags & 0x10)) {
4399 flags |= ON_CAST_MonsterSparkles;
4406 flags |= ON_CAST_Enchantment;
4436 if (!a6)
flags |= ON_CAST_TargetCrosshair;
4443 flags |= ON_CAST_TargetCrosshair;
4447 flags |= ON_CAST_Telekenesis;
4451 if (a4 && ~a4 & 0x01C0) {
4452 flags |= ON_CAST_WholeParty_BigImprovementAnim;
4456 flags |= ON_CAST_WholeParty_BigImprovementAnim;
4467 v11 = ((v10 - 3) & 0x80000000u) != 0;
4470 flags |= ON_CAST_WholeParty_BigImprovementAnim;
4481 v11 = ((v10 - 3) & 0x80000000u) != 0;
4484 flags |= ON_CAST_WholeParty_BigImprovementAnim;
4494 v11 = ((v14 - 4) & 0x80000000u) != 0;
4497 flags |= ON_CAST_WholeParty_BigImprovementAnim;
4513 flags |= ON_CAST_WholeParty_BigImprovementAnim;
4517 flags |= ON_CAST_DarkSacrifice;
4525 if (
flags & ON_CAST_CastingInProgress) {
4537 if (
flags & ON_CAST_WholeParty_BigImprovementAnim) {
4546 165, 422, 35, 0, 2, 0,
4549 280, 422, 35, 0, 2, 0,
4552 390, 422, 35, 0, 2, 0,
4557 if (
flags & ON_CAST_TargetCrosshair) {
4570 if (
flags & ON_CAST_Telekenesis) {
4583 if (
flags & ON_CAST_Enchantment) {
4593 if (
flags & ON_CAST_MonsterSparkles) {
4599 0x34u, 0x1A6u, 0x23u, 0, 2, 0,
4602 0xA5u, 0x1A6u, 0x23u, 0, 2, 0,
4605 0x118u, 0x1A6u, 0x23u, 0, 2, 0,
4608 0x186u, 0x1A6u, 0x23u, 0, 2, 0,
4622 "", {{ui_btn_npc_left}});
4626 "", {{ui_btn_npc_right}});