1 #define _CRTDBG_MAP_ALLOC
2 #define _CRT_SECURE_NO_WARNINGS
56 memset(&popup_window, 0, 0x54u);
90 unsigned int uHeight) {
91 unsigned int uNumTiles;
97 render->SetUIClipRect(uX, uY, uX + uWidth, uY + uHeight);
102 uNumTiles = uWidth / parchment_width;
103 if (uWidth % parchment_width) ++uNumTiles;
105 for (
uint j = 0; j <= uHeight / parchment_height; j++) {
106 coord_x = uX - parchment_width;
107 for (
uint i = uNumTiles + 1; i; --i) {
108 coord_x += parchment_width;
109 render->DrawTextureNew(coord_x / 640.0
f, coord_y / 480.0
f,
112 coord_y += parchment_height;
116 render->DrawTextureAlphaNew(
119 render->DrawTextureAlphaNew(
122 render->DrawTextureAlphaNew(
137 render->DrawTextureAlphaNew(
x / 640.0
f, uY / 480.0
f,
139 render->DrawTextureAlphaNew(
156 render->DrawTextureAlphaNew(uX / 640.0
f,
y / 480.0
f,
158 render->DrawTextureAlphaNew(
164 render->ResetUIClipRect();
187 if (!inspect_item->
uItemID)
return;
189 auto inspect_item_image =
192 iteminfo_window.
sHint.clear();
203 v78 = 100 - inspect_item_image->GetWidth();
204 v81 = 144 - inspect_item_image->GetHeight();
205 if (v78 > 0) v78 = v78 / 2;
266 render->DrawTransparentRedShade(
267 (iteminfo_window.
uFrameX + v78) / 640.0f,
268 (v81 + iteminfo_window.
uFrameY + 30) / 480.0f, inspect_item_image);
281 render->ResetUIClipRect();
283 if (inspect_item_image) {
284 inspect_item_image->Release();
285 inspect_item_image =
nullptr;
302 render->DrawTextureAlphaNew(
303 (iteminfo_window.
uFrameX + v78) / 640.0f,
304 (v81 + iteminfo_window.
uFrameY + 30) / 480.0f, inspect_item_image);
316 render->ResetUIClipRect();
318 if (inspect_item_image) {
319 inspect_item_image->Release();
320 inspect_item_image =
nullptr;
329 strcpy(out_text, str.c_str());
336 sprintf(out_text + 100,
"%s: +%d %s: %dd%d",
345 strcat(out_text + 100, mod);
351 sprintf(out_text + 100,
"%s: +%d %s: %dd%d",
360 strcat(out_text + 100, mod);
414 for (
uint i = 1; i <= 3; i++) {
430 if ((
signed int)Str > (
signed int)iteminfo_window.
uFrameHeight)
461 render->DrawTextureAlphaNew((iteminfo_window.
uFrameX + v78) / 640.0f,
464 inspect_item_image->GetHeight()) /
469 v34 = (int)(v85 + 35);
471 for (
uint i = 1; i <= 3; i++) {
497 render->ResetUIClipRect();
505 String txt4 =
"Duration:";
532 txt4.data(), 0, 0, 0);
540 txt2.data(), 0, 0, 0);
547 render->ResetUIClipRect();
553 int tempatt = (inspect_item->
uAttributes & 0xFFFF0000) | r_mask;
559 render->ResetUIClipRect();
564 bool monster_full_informations =
false;
565 static Actor pMonsterInfoUI_Doll;
575 if (
pActors[uActorID].pMonsterInfo.uID ==
579 memcpy(&pMonsterInfoUI_Doll, &
pActors[uActorID],
580 sizeof(pMonsterInfoUI_Doll));
583 v9 = rand() % 256 + 128;
606 [(
signed __int16)pMonsterInfoUI_Doll
607 .uCurrentActionAnimation]]
614 (pWindow->
uFrameY + 52) + 128};
622 render->ResetUIClipRect();
623 render->FillRectFast(doll_rect.
x, doll_rect.
y, 128, 128,
Color16(0, 0, 0));
625 doll_rect.
x - 1, doll_rect.
y - 1, doll_rect.
z + 1, doll_rect.
y - 1,
628 doll_rect.
x - 1, doll_rect.
w + 1, doll_rect.
x - 1, doll_rect.
y - 1,
631 doll_rect.
z + 1, doll_rect.
w + 1, doll_rect.
x - 1, doll_rect.
w + 1,
634 doll_rect.
z + 1, doll_rect.
y - 1, doll_rect.
z + 1, doll_rect.
w + 1,
638 render->DrawMonsterPortrait(doll_rect, Portrait_Sprite, Popup_Y_Offset);
643 if (
pActors[uActorID].sNPC_ID) {
653 if (
pActors[uActorID].dword_000334_unique_name)
667 bool normal_level =
false;
668 bool expert_level =
false;
669 bool master_level =
false;
670 bool grandmaster_level =
false;
671 bool for_effects =
false;
673 int skill_points = 0;
674 unsigned int skill_level = 0;
685 if (skill_level == 0) {
686 if (skill_points + 10 >=
pActors[uActorID].pMonsterInfo.uLevel)
688 }
else if (skill_level == 1) {
689 if (2 * skill_points + 10 >=
690 pActors[uActorID].pMonsterInfo.uLevel) {
694 }
else if (skill_level == 2) {
695 if (3 * skill_points + 10 >=
696 pActors[uActorID].pMonsterInfo.uLevel) {
701 }
else if (skill_level == 3) {
705 grandmaster_level = 1;
715 if (normal_level | expert_level | master_level | grandmaster_level) {
716 if (
pActors[uActorID].pMonsterInfo.uLevel >=
731 if (monster_full_informations ==
true) {
735 grandmaster_level = 1;
740 const char *pText =
nullptr;
741 int pTextColorID = 0;
744 if (!for_effects &&
false) {
751 for (
uint i = 1; i <= 21; ++i) {
752 if (
pActors[uActorID].pActorBuffs[i].Active()) {
841 if (_stricmp(pText,
"")) {
850 if (!_stricmp(pText,
""))
860 pActors[uActorID].pMonsterInfo.uHP);
862 Color16(0xE1u, 255, 0x9Bu), str, 0, 0, 0);
865 pActors[uActorID].pMonsterInfo.uAC);
872 Color16(0xE1u, 255, 0x9Bu), str, 0, 0, 0);
880 Color16(0xE1u, 255, 0x9Bu), txt2, 0, 0, 0);
884 const char *content[11] = {0};
901 content[
pActors[uActorID].pMonsterInfo.uAttack1Type]);
903 Color16(0xE1u, 255, 0x9Bu), txt3, 0, 0, 0);
906 if (
pActors[uActorID].pMonsterInfo.uAttack1DamageBonus)
909 pActors[uActorID].pMonsterInfo.uAttack1DamageDiceRolls,
910 pActors[uActorID].pMonsterInfo.uAttack1DamageDiceSides,
911 pActors[uActorID].pMonsterInfo.uAttack1DamageBonus);
915 pActors[uActorID].pMonsterInfo.uAttack1DamageDiceRolls,
916 pActors[uActorID].pMonsterInfo.uAttack1DamageDiceSides);
922 Color16(0xE1u, 255, 0x9Bu), txt3, 0, 0, 0);
928 Color16(0xE1u, 255, 0x9Bu), txt4, 0, 0, 0);
937 Color16(0xE1u, 255, 0x9Bu), txt5, 0, 0, 0);
941 if (
pActors[uActorID].pMonsterInfo.uSpell1ID &&
942 pActors[uActorID].pMonsterInfo.uSpell2ID)
944 if (
pActors[uActorID].pMonsterInfo.uSpell1ID) {
946 "%s\f%05u\t070%s\n", pText, 0,
950 Color16(0xE1u, 255, 0x9Bu), txt6, 0, 0, 0);
953 if (
pActors[uActorID].pMonsterInfo.uSpell2ID) {
955 "\f%05u\t070%s\n", 0,
959 Color16(0xE1u, 255, 0x9Bu), txt6, 0, 0, 0);
962 if (!
pActors[uActorID].pMonsterInfo.uSpell1ID &&
963 !
pActors[uActorID].pMonsterInfo.uSpell2ID) {
968 Color16(0xE1u, 255, 0x9Bu), txt6, 0, 0, 0);
979 const char *string_name[10] = {0};
991 unsigned char resistances[11] = {0};
992 resistances[0] =
pActors[uActorID].pMonsterInfo.uResFire;
993 resistances[1] =
pActors[uActorID].pMonsterInfo.uResAir;
994 resistances[2] =
pActors[uActorID].pMonsterInfo.uResWater;
995 resistances[3] =
pActors[uActorID].pMonsterInfo.uResEarth;
996 resistances[4] =
pActors[uActorID].pMonsterInfo.uResMind;
997 resistances[5] =
pActors[uActorID].pMonsterInfo.uResSpirit;
998 resistances[6] =
pActors[uActorID].pMonsterInfo.uResBody;
999 resistances[7] =
pActors[uActorID].pMonsterInfo.uResLight;
1000 resistances[8] =
pActors[uActorID].pMonsterInfo.uResPhysical;
1001 resistances[9] =
pActors[uActorID].pMonsterInfo.uResDark;
1003 if (grandmaster_level) {
1004 for (
uint i = 0; i < 10; i++) {
1005 if (resistances[i] == 200) {
1015 StringPrintf(
"%s\f%05u\t070%s\n", string_name[i], 0, pText);
1017 Color16(0xE1u, 255, 0x9Bu), txt7, 0, 0, 0);
1021 for (
uint i = 0; i < 10; ++i) {
1022 auto txt8 =
StringPrintf(
"%s\f%05u\t070%s\n", string_name[i], 0,
1025 Color16(0xE1u, 255, 0x9Bu), txt8, 0, 0, 0);
1034 pActors[uActorID].sCurrentHP);
1064 char static_sub_417BB5_out_string[1200];
1067 strcpy(a2,
"%s\n\n");
1068 sprintf(Source,
"\f%05d",
1070 uPlayerSkillType, 1));
1072 strcat(a2,
"%s\t%03d:\t%03d%s\t000\n");
1073 sprintf(Source,
"\f%05d",
1075 uPlayerSkillType, 2));
1077 strcat(a2,
"%s\t%03d:\t%03d%s\t000\n");
1078 sprintf(Source,
"\f%05d",
1080 uPlayerSkillType, 3));
1082 strcat(a2,
"%s\t%03d:\t%03d%s\t000\n");
1083 sprintf(Source,
"\f%05d",
1085 uPlayerSkillType, 4));
1087 strcat(a2,
"%s\t%03d:\t%03d%s\t000\n");
1088 if ((
pParty->
pPlayers[uPlayerID].pActiveSkills[uPlayerSkillType] & 0x3F) ==
1089 (
pParty->
pPlayers[uPlayerID].GetActualSkillLevel(uPlayerSkillType) &
1091 sprintf(static_sub_417BB5_out_string, a2,
1104 sprintf(Source,
"\f%05d",
Color16(0xFFu, 0xFFu, 0xFFu));
1106 strcat(a2,
"%s: +%d");
1108 static_sub_417BB5_out_string, a2,
1119 (
pParty->
pPlayers[uPlayerID].GetActualSkillLevel(uPlayerSkillType) &
1124 return String(static_sub_417BB5_out_string);
1128 unsigned int pX = 0;
1129 unsigned int pY = 0;
1132 if (pX < 24 || pX > 455 || pY < 18 || pY > 36) {
1135 pX <= pButton->uZ && pY >= pButton->
uY && pY <= pButton->uW) {
1155 signed int pTextColor;
1156 const char *pHourWord;
1157 const char *pDayWord;
1174 switch (pStringNum) {
1206 for (
uint i = 0; i < 18; ++i) {
1211 auto condition_time =
1215 pHour = condition_time.GetHoursOfDay();
1216 pDay = condition_time.GetDays();
1222 if (pHour && pHour <= 1)
1229 str +=
StringPrintf(
"%lu %s, %lu %s", pDay, pDayWord, pHour,
1264 }
while (v15 <= 10000);
1271 LSTR_XP_UNTIL_NEXT_LEVEL,
1274 str1 +=
"\n" + str2;
1286 sprintf(recov,
"\n\nRecovery time: %d", meleerecov);
1303 sprintf(recovm,
"\n\nRecovery time: %d", missrecov);
1392 spell_info_window.
uFrameX = 90;
1393 spell_info_window.
uFrameZ = 417;
1395 spell_info_window.
sHint.clear();
1409 "%s\n\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%"
1410 "s\t000\n%s\t%03d:\t%03d%s",
1450 .mana_per_skill[skill_level - 1]);
1470 unsigned int pX = mouse_x;
1471 unsigned int pY = mouse_y;
1476 if (pt.
x < 1 || pt.
y < 1 || pt.
x > 638 || pt.
y > 478) {
1483 for (
uint i = 0; i < 4; ++i) {
1486 (
signed int)pY > 375 && (
signed int)pY < 466) {
1501 static String hint_reference;
1507 popup_window.
sHint = hint_reference;
1511 if ((
signed int)pX <= 320)
1512 popup_window.
uFrameX = pX + 30;
1514 popup_window.
uFrameX = pX - 414;
1522 int inventoryYCoord = (pY - 34) / 32;
1523 int inventoryXCoord = (pX - 42) / 32;
1524 int invMatrixIndex =
1525 inventoryXCoord + (chestheight * inventoryYCoord);
1527 if (inventoryYCoord >= 0 && inventoryYCoord < chestheight &&
1528 inventoryXCoord >= 0 && inventoryXCoord < chestwidth) {
1530 if (chestindex < 0) {
1531 invMatrixIndex = (-(chestindex + 1));
1536 int itemindex = chestindex - 1;
1550 popup_window.
ptr_1C = (
void *)((
signed int)pX / 118);
1551 if ((
signed int)pX / 118 < 4) {
1552 popup_window.
sHint.clear();
1563 if (pX >= 476 && pX <= 636 && pY >= 240 && pY <= 300) {
1564 popup_window.
sHint.clear();
1571 }
else if ((
int)pX < 485 || (
int)pX > 548 ||
1574 if (!((
signed int)pX < 566 || (
signed int)pX > 629 ||
1575 (
signed int)pY < 156 || (
signed int)pY > 229)) {
1593 popup_window.
sHint.clear();
1596 popup_window.
uFrameX = pX - 350;
1597 if ((
signed int)pX <= 320) popup_window.
uFrameX = pX + 30;
1602 v5 = vis->get_picked_object_zbuf_val();
1613 ->pObjects[
pSpriteObjects[PID_ID((
unsigned __int16)v5)].uObjectDescID].uFlags & 0x10)) {
1631 popup_window.
uFrameX = pX + 5;
1632 popup_window.
uFrameY = pY + 5;
1643 else if ((
signed int)pY >= 345)
1667 if ((
signed int)pY < 345 && (
signed int)pX < 469)
1672 popup_window.
sHint.clear();
1676 (
signed int)pX > (
signed int)pButton->
uX &&
1677 (
signed int)pX < (
signed int)pButton->
uZ &&
1678 (
signed int)pY > (
signed int)pButton->
uY &&
1679 (
signed int)pY < (
signed int)pButton->
uW) {
1680 switch (pButton->
msg) {
1682 popup_window.
sHint =
1709 .GetSkillIdxByOrder(pButton->
msg_param +
1716 .GetSkillIdxByOrder(pButton->
msg_param +
1721 popup_window.
sHint =
1756 static String hint_reference;
1761 .GetSkillIdxByOrder(pButton->
msg -
1764 popup_window.
sHint = hint_reference;
1767 .GetSkillIdxByOrder(pButton->
msg -
1773 if (!popup_window.
sHint.empty()) {
1775 popup_window.
sHint.clear();
1799 Color16(0xFF, 0xFF, 0x9B), pStr);
1819 unsigned int potion2_id;
1820 signed int potionID;
1825 unsigned int damage_level;
1829 signed int inventoryXCoord;
1830 int inventoryYCoord;
1841 static int RingsX[6] = {0x1EA, 0x21A, 0x248, 0x1EA, 0x21A, 0x248};
1842 static int RingsY[6] = {0x0CA, 0x0CA, 0x0CA, 0x0FA, 0x0FA, 0x0FA};
1844 static int glovex = 586;
1845 static int glovey = 88;
1847 static int amuletx = 493;
1848 static int amulety = 91;
1854 inventoryYCoord = (pY - 17) / 32;
1855 inventoryXCoord = (pX - 14) / 32;
1856 int invMatrixIndex =
1857 inventoryXCoord + (14 * inventoryYCoord);
1859 if (pX <= 13 || pX >= 462) {
1870 if (item_pid == -1)
return;
1876 if (mousex < 490 || mousex > 618)
return;
1878 if (mousey < 88 || mousey > 282)
return;
1880 if (mousex >= amuletx && mousex <= (amuletx + slot) &&
1881 mousey >= amulety && mousey <= (amulety + 2 * slot)) {
1887 if (mousex >= glovex && mousex <= (glovex + slot) &&
1888 mousey >= glovey && mousey <= (glovey + 2 * slot)) {
1894 for (
int i = 0; i < 6; ++i) {
1895 if (mousex >= RingsX[i] && mousex <= (RingsX[i] + slot) &&
1896 mousey >= RingsY[i] && mousey <= (RingsY[i] + slot)) {
1930 static String hint_reference;
1936 message_window.
sHint = hint_reference;
1940 message_window.
uFrameX = pX + 30;
1942 message_window.
uFrameX = pX - 414;
1948 int alchemy_skill_points =
1950 int alchemy_skill_level =
1970 if (v31 < 0.0) v31 = 0.0;
2118 if (alchemy_skill_points) {
2123 alchemy_skill_level == 1)
2127 alchemy_skill_level <= 2)
2130 alchemy_skill_level <= 3)
2163 if (damage_level > 0) {
2167 if (damage_level == 1) {
2170 }
else if (damage_level == 2) {
2174 }
else if (damage_level == 3) {
2178 }
else if (damage_level >= 4) {
2191 int rot_x, rot_y, rot_z;
2193 &rot_x, &rot_y, &rot_z);
2208 if (alchemy_skill_points) {
2230 ->pOwnItems[bottle - 1]
2256 if (a1 == 0)
return Color16(0, 0, 0);
2257 if (a1 < 12)
return Color16(255, 85, 0);
2258 if (a1 < 23)
return Color16(150, 212, 255);
2259 if (a1 < 34)
return Color16(0, 128, 255);
2260 if (a1 < 45)
return Color16(128, 128, 128);
2261 if (a1 < 56)
return Color16(225, 225, 225);
2262 if (a1 < 67)
return Color16(235, 15, 255);
2263 if (a1 < 78)
return Color16(255, 128, 0);
2264 if (a1 < 89)
return Color16(255, 255, 155);
2266 return Color16(192, 192, 240);
2273 int effectiveLevel = 0;
2274 for (
int i = 0; i <
level; ++i)
2275 effectiveLevel += i + 1;
2276 return (
unsigned __int64)(1000 * effectiveLevel);