Advertisement
Guest User

Untitled

a guest
Jun 3rd, 2012
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 55.36 KB | None | 0 0
  1. #define WIN32_LEAN_AND_MEAN
  2. #define _WIN32_WINNT 0x0501
  3. #define WINVER 0x0501
  4. #define _WIN32_IE 0x0600
  5. #include <windows.h>
  6. #include <commctrl.h>
  7. #include "resource.h"
  8. #include <stdlib.h>
  9. #include <atlstr.h>
  10. #pragma comment(linker,"\"/manifestdependency:type='win32' \
  11. name='Microsoft.Windows.Common-Controls' version='6.0.0.0' \
  12. processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
  13.  
  14. #pragma region Declarations
  15. #define WINDOW_WIDTH 500
  16. #define WINDOW_HEIGHT 670
  17. #define IDC_EXIT_BUTTON 9001
  18. #define IDC_LEVEL 9002
  19. #define IDC_LEVEL_LBL 9003
  20. #define IDC_STAT_STR 9004
  21. #define IDC_STAT_DEX 9005
  22. #define IDC_STAT_VIT 9006
  23. #define IDC_STAT_INT 9007
  24. #define IDC_STAT_STR_LBL 9008
  25. #define IDC_STAT_DEX_LBL 9009
  26. #define IDC_STAT_VIT_LBL 9010
  27. #define IDC_STAT_INT_LBL 9011
  28. #define IDC_STAT_HP 9012
  29. #define IDC_STAT_HP_LBL 9013
  30. #define IDC_RES_PERLIFE 9014
  31. #define IDC_RES_PERLIFE_LBL 9015
  32. #define IDC_RES_PHYS 9016
  33. #define IDC_RES_ALL 9017
  34. #define IDC_RES_FIRE 9018
  35. #define IDC_RES_COLD 9019
  36. #define IDC_RES_POISON 9020
  37. #define IDC_RES_ARCANE 9021
  38. #define IDC_RES_LIGHTNING 9065
  39. #define IDC_RES_MELEE 9022
  40. #define IDC_RES_RANGE 9023
  41. #define IDC_RES_PHYS_LBL 9024
  42. #define IDC_RES_ALL_LBL 9025
  43. #define IDC_RES_FIRE_LBL 9026
  44. #define IDC_RES_COLD_LBL 9027
  45. #define IDC_RES_POISON_LBL 9028
  46. #define IDC_RES_ARCANE_LBL 9029
  47. #define IDC_RES_LIGHTNING_LBL 9037
  48. #define IDC_RES_MELEE_LBL 9030
  49. #define IDC_RES_RANGE_LBL 9031
  50. #define IDC_STAT_ARMOR 9032
  51. #define IDC_STAT_ARMOR_LBL 9033
  52. #define IDC_STAT_EFFECTIVEHP1 9034
  53. #define IDC_STAT_EFFECTIVEHP1_LBL 9035
  54. #define IDC_ITEM1_RES_ALL 9036
  55. #define IDC_ITEM1_RES_FIRE 9037
  56. #define IDC_ITEM1_RES_COLD 9038
  57. #define IDC_ITEM1_RES_POISON 9039
  58. #define IDC_ITEM1_RES_ARCANE 9040
  59. #define IDC_ITEM1_RES_LIGHTNING 9041
  60. #define IDC_ITEM1_RES_MELEE 9042
  61. #define IDC_ITEM1_RES_RANGE 9043
  62. #define IDC_ITEM2_RES_ALL 9044
  63. #define IDC_ITEM2_RES_FIRE 9045
  64. #define IDC_ITEM2_RES_COLD 9046
  65. #define IDC_ITEM2_RES_POISON 9047
  66. #define IDC_ITEM2_RES_ARCANE 9048
  67. #define IDC_ITEM2_RES_LIGHTNING 9049
  68. #define IDC_ITEM2_RES_MELEE 9050
  69. #define IDC_ITEM2_RES_RANGE 9051
  70. #define IDC_ITEM1_STAT_STR 9052
  71. #define IDC_ITEM1_STAT_DEX 9053
  72. #define IDC_ITEM1_STAT_VIT 9054
  73. #define IDC_ITEM1_STAT_INT 9055
  74. #define IDC_ITEM1_STAT_ARMOR 9056
  75. #define IDC_ITEM2_STAT_STR 9057
  76. #define IDC_ITEM2_STAT_DEX 9058
  77. #define IDC_ITEM2_STAT_VIT 9059
  78. #define IDC_ITEM2_STAT_INT 9060
  79. #define IDC_ITEM2_STAT_ARMOR 9061
  80. #define IDC_ITEM1_LBL 9062
  81. #define IDC_ITEM2_LBL 9063
  82. #define IDC_ITEM_COMPARE_LBL 9064
  83. #define IDC_ITEM1_RES_ALL_LBL 9065
  84. #define IDC_ITEM1_RES_FIRE_LBL 9066
  85. #define IDC_ITEM1_RES_COLD_LBL 9067
  86. #define IDC_ITEM1_RES_POISON_LBL 9068
  87. #define IDC_ITEM1_RES_ARCANE_LBL 9069
  88. #define IDC_ITEM1_RES_LIGHTNING_LBL 9070
  89. #define IDC_ITEM1_RES_MELEE_LBL 9071
  90. #define IDC_ITEM1_RES_RANGE_LBL 9072
  91. #define IDC_ITEM1_STAT_ARMOR_LBL 9073
  92. #define IDC_ITEM1_STAT_STR_LBL 9074
  93. #define IDC_ITEM1_STAT_DEX_LBL 9075
  94. #define IDC_ITEM1_STAT_VIT_LBL 9076
  95. #define IDC_ITEM1_STAT_INT_LBL 9077
  96. #define IDC_ITEM2_RES_ALL_LBL 9078
  97. #define IDC_ITEM2_RES_FIRE_LBL 9079
  98. #define IDC_ITEM2_RES_COLD_LBL 9080
  99. #define IDC_ITEM2_RES_POISON_LBL 9081
  100. #define IDC_ITEM2_RES_ARCANE_LBL 9082
  101. #define IDC_ITEM2_RES_LIGHTNING_LBL 9083
  102. #define IDC_ITEM2_RES_MELEE_LBL 9084
  103. #define IDC_ITEM2_RES_RANGE_LBL 9085
  104. #define IDC_ITEM2_STAT_ARMOR_LBL 9086
  105. #define IDC_ITEM2_STAT_STR_LBL 9087
  106. #define IDC_ITEM2_STAT_DEX_LBL 9088
  107. #define IDC_ITEM2_STAT_VIT_LBL 9089
  108. #define IDC_ITEM2_STAT_INT_LBL 9090
  109. #pragma endregion Declarations
  110.  
  111. #pragma region Globals
  112. HWND hEdit,
  113.     hExitButton,
  114.     hPlayerLevel,
  115.     hPlayerLevelLbl,
  116.     hStatStr,
  117.     hStatDex,
  118.     hStatVit,
  119.     hStatInt,
  120.     hStatStrLbl,
  121.     hStatDexLbl,
  122.     hStatVitLbl,
  123.     hStatIntLbl,
  124.     hStatHP,
  125.     hStatHPLbl,
  126.     hResPerLife,
  127.     hResPerLifeLbl,
  128.     hResPhys,
  129.     hResAll,
  130.     hResFire,
  131.     hResCold,
  132.     hResPoison,
  133.     hResArcane,
  134.     hResLightning,
  135.     hResMelee,
  136.     hResRange,
  137.     hResPhysLbl,
  138.     hResAllLbl,
  139.     hResFireLbl,
  140.     hResColdLbl,
  141.     hResPoisonLbl,
  142.     hResArcaneLbl,
  143.     hResLightningLbl,
  144.     hResMeleeLbl,
  145.     hResRangeLbl,
  146.     hStatArmor,
  147.     hStatArmorLbl,
  148.     hStatEffectiveHP1,
  149.     hStatEffectiveHP1Lbl,
  150.     hItem1ResAll,
  151.     hItem1ResFire,
  152.     hItem1ResCold,
  153.     hItem1ResPoison,
  154.     hItem1ResArcane,
  155.     hItem1ResLightning,
  156.     hItem1ResMelee,
  157.     hItem1ResRange,
  158.     hItem1StatArmor,
  159.     hItem1StatStr,
  160.     hItem1StatDex,
  161.     hItem1StatVit,
  162.     hItem1StatInt,
  163.     hItem1ResAllLbl,
  164.     hItem1ResFireLbl,
  165.     hItem1ResColdLbl,
  166.     hItem1ResPoisonLbl,
  167.     hItem1ResArcaneLbl,
  168.     hItem1ResLightningLbl,
  169.     hItem1ResMeleeLbl,
  170.     hItem1ResRangeLbl,
  171.     hItem1StatArmorLbl,
  172.     hItem1StatStrLbl,
  173.     hItem1StatDexLbl,
  174.     hItem1StatVitLbl,
  175.     hItem1StatIntLbl,
  176.     hItem2ResAll,
  177.     hItem2ResFire,
  178.     hItem2ResCold,
  179.     hItem2ResPoison,
  180.     hItem2ResArcane,
  181.     hItem2ResLightning,
  182.     hItem2ResMelee,
  183.     hItem2ResRange,
  184.     hItem2StatArmor,
  185.     hItem2StatStr,
  186.     hItem2StatDex,
  187.     hItem2StatVit,
  188.     hItem2StatInt,
  189.     hItem2ResAllLbl,
  190.     hItem2ResFireLbl,
  191.     hItem2ResColdLbl,
  192.     hItem2ResPoisonLbl,
  193.     hItem2ResArcaneLbl,
  194.     hItem2ResLightningLbl,
  195.     hItem2ResMeleeLbl,
  196.     hItem2ResRangeLbl,
  197.     hItem2StatArmorLbl,
  198.     hItem2StatStrLbl,
  199.     hItem2StatDexLbl,
  200.     hItem2StatVitLbl,
  201.     hItem2StatIntLbl,
  202.     hItem1Lbl,
  203.     hItem2Lbl,
  204.     hItemCompareLbl;
  205. float pLevel = 1,
  206.     mLevel = 61,
  207.     pStr = 100,
  208.     pDex = 100,
  209.     pVit = 100,
  210.     pInt = 100,
  211.     pHP = 1000,
  212.     pPerLife = 1,
  213.     pArmor = 1000,
  214.     pEffHP1 = 1,
  215.     pEffHP2 = 1,
  216.     pEffHP3 = 1,
  217.     pResAll = 100,
  218.     pResFire = 100,
  219.     pResCold = 100,
  220.     pResPoison = 100,
  221.     pResArcane = 100,
  222.     pResLightning = 100,
  223.     pResMelee = 100,
  224.     pResRange = 100,
  225.     item1ResAll = 100,
  226.     item1ResFire = 100,
  227.     item1ResCold = 100,
  228.     item1ResPoison = 100,
  229.     item1ResArcane = 100,
  230.     item1ResLightning = 100,
  231.     item1ResMelee = 100,
  232.     item1ResRange = 100,
  233.     item1StatStr = 100,
  234.     item1StatDex = 100,
  235.     item1StatVit = 100,
  236.     item1StatInt = 100,
  237.     item1StatArmor = 1000,
  238.     item2ResAll = 100,
  239.     item2ResFire = 100,
  240.     item2ResCold = 100,
  241.     item2ResPoison = 100,
  242.     item2ResArcane = 100,
  243.     item2ResLightning = 100,
  244.     item2ResMelee = 100,
  245.     item2ResRange = 100,
  246.     item2StatStr = 100,
  247.     item2StatDex = 100,
  248.     item2StatVit = 100,
  249.     item2StatInt = 100,
  250.     item2StatArmor = 1000,
  251.     itemCompareStat = 0;
  252. HFONT hFont = CreateFont(18, 0, 0, 0, FW_MEDIUM, FALSE, FALSE, FALSE, ANSI_CHARSET, OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH|FF_DONTCARE, "Calibri");
  253. #pragma endregion Globals
  254.  
  255. LRESULT CALLBACK WinProc(HWND hWnd,UINT message,WPARAM wParam,LPARAM lParam);
  256.  
  257. int Round(float f) { return f - (int)f == 0 ? (int)f : (int)f + 1; }
  258.  
  259. int WINAPI WinMain(HINSTANCE hInst,HINSTANCE hPrevInst,LPSTR lpCmdLine,int nShowCmd)
  260. {
  261.     WNDCLASSEX wClass;
  262.     ZeroMemory(&wClass,sizeof(WNDCLASSEX));
  263.     wClass.cbClsExtra=NULL;
  264.     wClass.cbSize=sizeof(WNDCLASSEX);
  265.     wClass.cbWndExtra=NULL;
  266.     wClass.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH);
  267.     wClass.hCursor=LoadCursor(NULL,IDC_ARROW);
  268.     wClass.hInstance=hInst;
  269.     wClass.hIcon=LoadIcon(hInst, MAKEINTRESOURCE(IDI_ICON));
  270.     wClass.hIconSm=LoadIcon(hInst, MAKEINTRESOURCE(IDI_ICON));
  271.     wClass.lpfnWndProc=(WNDPROC)WinProc;
  272.     wClass.lpszClassName="Window Class";
  273.     wClass.lpszMenuName=NULL;
  274.     wClass.style=CS_HREDRAW|CS_VREDRAW;
  275.  
  276.     if(!RegisterClassEx(&wClass))
  277.     {
  278.         int nResult=GetLastError();
  279.         MessageBox(NULL,
  280.             "Window class creation failed\r\n",
  281.             "Window Class Failed",
  282.             MB_ICONERROR);
  283.     }
  284.  
  285.     HWND hWnd=CreateWindowEx(NULL,
  286.         "Window Class",
  287.         "D3 Tools",
  288.         WS_OVERLAPPED|WS_SYSMENU|WS_MINIMIZEBOX,
  289.         CW_USEDEFAULT,
  290.         CW_USEDEFAULT,
  291.         WINDOW_WIDTH,
  292.         WINDOW_HEIGHT,
  293.         NULL,
  294.         NULL,
  295.         hInst,
  296.         NULL);
  297.  
  298.     if(!hWnd)
  299.     {
  300.         int nResult=GetLastError();
  301.  
  302.         MessageBox(NULL,
  303.             "Window creation failed\r\n",
  304.             "Window Creation Failed",
  305.             MB_ICONERROR);
  306.     }
  307.  
  308.     ShowWindow(hWnd,nShowCmd);
  309.  
  310.     MSG msg;
  311.     ZeroMemory(&msg,sizeof(MSG));
  312.  
  313.     while(GetMessage(&msg,NULL,0,0))
  314.     {
  315.         TranslateMessage(&msg);
  316.         DispatchMessage(&msg);
  317.     }
  318.  
  319.     return 0;
  320. }
  321.  
  322. LRESULT CALLBACK WinProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
  323. {
  324.     RECT rc;
  325.     GetClientRect(hWnd, &rc);
  326.     int width = rc.right - rc.left;
  327.     int height = rc.bottom - rc.top;
  328.  
  329.     switch(msg)
  330.     {
  331.     case WM_CREATE:
  332.         {
  333.             hExitButton = CreateWindowEx(NULL,
  334.                 "BUTTON",
  335.                 "Exit",
  336.                 WS_TABSTOP|WS_VISIBLE|WS_CHILD|BS_DEFPUSHBUTTON,
  337.                 width - 110,
  338.                 height - 34,
  339.                 100,
  340.                 24,
  341.                 hWnd,
  342.                 (HMENU)IDC_EXIT_BUTTON,
  343.                 GetModuleHandle(NULL),
  344.                 NULL);
  345.             SendMessage(hExitButton, WM_SETFONT, (WPARAM)hFont, TRUE);
  346.  
  347.             hPlayerLevel = CreateWindowEx(WS_EX_CLIENTEDGE,
  348.                 "EDIT",
  349.                 "1",
  350.                 WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_MULTILINE|ES_NUMBER|ES_RIGHT,
  351.                 160,
  352.                 10,
  353.                 70,
  354.                 24,
  355.                 hWnd,
  356.                 (HMENU)IDC_LEVEL,
  357.                 GetModuleHandle(NULL),
  358.                 NULL);
  359.             SendMessage(hPlayerLevel, WM_SETFONT, (WPARAM)hFont, TRUE);
  360.  
  361.             hPlayerLevelLbl = CreateWindowEx(NULL,
  362.                 "STATIC",
  363.                 "Player Level:",
  364.                 WS_VISIBLE|WS_CHILD|SS_SIMPLE,
  365.                 10,
  366.                 13,
  367.                 120,
  368.                 24,
  369.                 hWnd,
  370.                 (HMENU)IDC_LEVEL_LBL,
  371.                 GetModuleHandle(NULL),
  372.                 NULL);
  373.             SendMessage(hPlayerLevelLbl, WM_SETFONT, (WPARAM)hFont, TRUE);
  374.  
  375.             hStatStr = CreateWindowEx(WS_EX_CLIENTEDGE,
  376.                 "EDIT",
  377.                 "100",
  378.                 WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_MULTILINE|ES_NUMBER|ES_RIGHT,
  379.                 160,
  380.                 36,
  381.                 70,
  382.                 24,
  383.                 hWnd,
  384.                 (HMENU)IDC_STAT_DEX,
  385.                 GetModuleHandle(NULL),
  386.                 NULL);
  387.             SendMessage(hStatStr, WM_SETFONT, (WPARAM)hFont, TRUE);
  388.  
  389.             hStatStrLbl = CreateWindowEx(NULL,
  390.                 "STATIC",
  391.                 "Player Strength:",
  392.                 WS_VISIBLE|WS_CHILD|SS_SIMPLE,
  393.                 10,
  394.                 39,
  395.                 120,
  396.                 24,
  397.                 hWnd,
  398.                 (HMENU)IDC_STAT_STR_LBL,
  399.                 GetModuleHandle(NULL),
  400.                 NULL);
  401.             SendMessage(hStatStrLbl, WM_SETFONT, (WPARAM)hFont, TRUE);
  402.  
  403.             hStatDex = CreateWindowEx(WS_EX_CLIENTEDGE,
  404.                 "EDIT",
  405.                 "100",
  406.                 WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_MULTILINE|ES_NUMBER|ES_RIGHT,
  407.                 160,
  408.                 62,
  409.                 70,
  410.                 24,
  411.                 hWnd,
  412.                 (HMENU)IDC_STAT_DEX,
  413.                 GetModuleHandle(NULL),
  414.                 NULL);
  415.             SendMessage(hStatDex, WM_SETFONT, (WPARAM)hFont, TRUE);
  416.  
  417.             hStatDexLbl = CreateWindowEx(NULL,
  418.                 "STATIC",
  419.                 "Player Dexterity:",
  420.                 WS_VISIBLE|WS_CHILD|SS_SIMPLE,
  421.                 10,
  422.                 65,
  423.                 120,
  424.                 24,
  425.                 hWnd,
  426.                 (HMENU)IDC_STAT_DEX_LBL,
  427.                 GetModuleHandle(NULL),
  428.                 NULL);
  429.             SendMessage(hStatDexLbl, WM_SETFONT, (WPARAM)hFont, TRUE);
  430.  
  431.             hStatVit = CreateWindowEx(WS_EX_CLIENTEDGE,
  432.                 "EDIT",
  433.                 "100",
  434.                 WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_MULTILINE|ES_NUMBER|ES_RIGHT,
  435.                 160,
  436.                 88,
  437.                 70,
  438.                 24,
  439.                 hWnd,
  440.                 (HMENU)IDC_STAT_VIT,
  441.                 GetModuleHandle(NULL),
  442.                 NULL);
  443.             SendMessage(hStatVit, WM_SETFONT, (WPARAM)hFont, TRUE);
  444.  
  445.             hStatVitLbl = CreateWindowEx(NULL,
  446.                 "STATIC",
  447.                 "Player Vitality:",
  448.                 WS_VISIBLE|WS_CHILD|SS_SIMPLE,
  449.                 10,
  450.                 91,
  451.                 120,
  452.                 24,
  453.                 hWnd,
  454.                 (HMENU)IDC_STAT_VIT_LBL,
  455.                 GetModuleHandle(NULL),
  456.                 NULL);
  457.             SendMessage(hStatVitLbl, WM_SETFONT, (WPARAM)hFont, TRUE);
  458.  
  459.             hStatInt = CreateWindowEx(WS_EX_CLIENTEDGE,
  460.                 "EDIT",
  461.                 "100",
  462.                 WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_MULTILINE|ES_NUMBER|ES_RIGHT,
  463.                 160,
  464.                 114,
  465.                 70,
  466.                 24,
  467.                 hWnd,
  468.                 (HMENU)IDC_STAT_INT,
  469.                 GetModuleHandle(NULL),
  470.                 NULL);
  471.             SendMessage(hStatInt, WM_SETFONT, (WPARAM)hFont, TRUE);
  472.  
  473.             hStatIntLbl = CreateWindowEx(NULL,
  474.                 "STATIC",
  475.                 "Player Intelligence:",
  476.                 WS_VISIBLE|WS_CHILD|SS_SIMPLE,
  477.                 10,
  478.                 117,
  479.                 120,
  480.                 24,
  481.                 hWnd,
  482.                 (HMENU)IDC_STAT_INT_LBL,
  483.                 GetModuleHandle(NULL),
  484.                 NULL);
  485.             SendMessage(hStatIntLbl, WM_SETFONT, (WPARAM)hFont, TRUE);
  486.  
  487.             hResPerLife = CreateWindowEx(WS_EX_CLIENTEDGE,
  488.                 "EDIT",
  489.                 "1",
  490.                 WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_MULTILINE|ES_NUMBER|ES_RIGHT,
  491.                 160,
  492.                 140,
  493.                 70,
  494.                 24,
  495.                 hWnd,
  496.                 (HMENU)IDC_RES_PERLIFE,
  497.                 GetModuleHandle(NULL),
  498.                 NULL);
  499.             SendMessage(hResPerLife, WM_SETFONT, (WPARAM)hFont, TRUE);
  500.  
  501.             hResPerLifeLbl = CreateWindowEx(NULL,
  502.                 "STATIC",
  503.                 "Percent Life:",
  504.                 WS_VISIBLE|WS_CHILD|SS_SIMPLE,
  505.                 10,
  506.                 143,
  507.                 120,
  508.                 24,
  509.                 hWnd,
  510.                 (HMENU)IDC_RES_PERLIFE_LBL,
  511.                 GetModuleHandle(NULL),
  512.                 NULL);
  513.             SendMessage(hResPerLifeLbl, WM_SETFONT, (WPARAM)hFont, TRUE);
  514.  
  515.             hStatArmor = CreateWindowEx(WS_EX_CLIENTEDGE,
  516.                 "EDIT",
  517.                 "1000",
  518.                 WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_MULTILINE|ES_NUMBER|ES_RIGHT,
  519.                 160,
  520.                 166,
  521.                 70,
  522.                 24,
  523.                 hWnd,
  524.                 (HMENU)IDC_STAT_ARMOR,
  525.                 GetModuleHandle(NULL),
  526.                 NULL);
  527.             SendMessage(hStatArmor, WM_SETFONT, (WPARAM)hFont, TRUE);
  528.  
  529.             hStatArmorLbl = CreateWindowEx(NULL,
  530.                 "STATIC",
  531.                 "Armor:",
  532.                 WS_VISIBLE|WS_CHILD|SS_SIMPLE,
  533.                 10,
  534.                 169,
  535.                 120,
  536.                 24,
  537.                 hWnd,
  538.                 (HMENU)IDC_STAT_ARMOR_LBL,
  539.                 GetModuleHandle(NULL),
  540.                 NULL);
  541.             SendMessage(hStatArmorLbl, WM_SETFONT, (WPARAM)hFont, TRUE);
  542.  
  543.             hStatHP = CreateWindowEx(WS_EX_CLIENTEDGE,
  544.                 "EDIT",
  545.                 "100",
  546.                 WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_MULTILINE|ES_NUMBER|ES_RIGHT|ES_READONLY,
  547.                 160,
  548.                 192,
  549.                 70,
  550.                 24,
  551.                 hWnd,
  552.                 (HMENU)IDC_STAT_HP,
  553.                 GetModuleHandle(NULL),
  554.                 NULL);
  555.             SendMessage(hStatHP, WM_SETFONT, (WPARAM)hFont, TRUE);
  556.  
  557.             hStatHPLbl = CreateWindowEx(NULL,
  558.                 "STATIC",
  559.                 "Maximum Life:",
  560.                 WS_VISIBLE|WS_CHILD|SS_SIMPLE,
  561.                 10,
  562.                 195,
  563.                 120,
  564.                 24,
  565.                 hWnd,
  566.                 (HMENU)IDC_STAT_HP_LBL,
  567.                 GetModuleHandle(NULL),
  568.                 NULL);
  569.             SendMessage(hStatHPLbl, WM_SETFONT, (WPARAM)hFont, TRUE);
  570.  
  571.             hResAll = CreateWindowEx(WS_EX_CLIENTEDGE,
  572.                 "EDIT",
  573.                 "100",
  574.                 WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_MULTILINE|ES_NUMBER|ES_RIGHT,
  575.                 415,
  576.                 10,
  577.                 70,
  578.                 24,
  579.                 hWnd,
  580.                 (HMENU)IDC_RES_ALL,
  581.                 GetModuleHandle(NULL),
  582.                 NULL);
  583.             SendMessage(hResAll, WM_SETFONT, (WPARAM)hFont, TRUE);
  584.  
  585.             hResAllLbl = CreateWindowEx(NULL,
  586.                 "STATIC",
  587.                 "Resist All:",
  588.                 WS_VISIBLE|WS_CHILD|SS_SIMPLE,
  589.                 265,
  590.                 13,
  591.                 130,
  592.                 24,
  593.                 hWnd,
  594.                 (HMENU)IDC_RES_ALL_LBL,
  595.                 GetModuleHandle(NULL),
  596.                 NULL);
  597.             SendMessage(hResAllLbl, WM_SETFONT, (WPARAM)hFont, TRUE);
  598.  
  599.             hResPhys = CreateWindowEx(WS_EX_CLIENTEDGE,
  600.                 "EDIT",
  601.                 "100",
  602.                 WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_MULTILINE|ES_NUMBER|ES_RIGHT,
  603.                 415,
  604.                 36,
  605.                 70,
  606.                 24,
  607.                 hWnd,
  608.                 (HMENU)IDC_RES_PHYS,
  609.                 GetModuleHandle(NULL),
  610.                 NULL);
  611.             SendMessage(hResPhys, WM_SETFONT, (WPARAM)hFont, TRUE);
  612.  
  613.             hResPhysLbl = CreateWindowEx(NULL,
  614.                 "STATIC",
  615.                 "Physical Resistance:",
  616.                 WS_VISIBLE|WS_CHILD|SS_SIMPLE,
  617.                 265,
  618.                 39,
  619.                 130,
  620.                 24,
  621.                 hWnd,
  622.                 (HMENU)IDC_RES_PHYS_LBL,
  623.                 GetModuleHandle(NULL),
  624.                 NULL);
  625.             SendMessage(hResPhysLbl, WM_SETFONT, (WPARAM)hFont, TRUE);
  626.  
  627.             hResFire = CreateWindowEx(WS_EX_CLIENTEDGE,
  628.                 "EDIT",
  629.                 "100",
  630.                 WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_MULTILINE|ES_NUMBER|ES_RIGHT,
  631.                 415,
  632.                 62,
  633.                 70,
  634.                 24,
  635.                 hWnd,
  636.                 (HMENU)IDC_RES_FIRE,
  637.                 GetModuleHandle(NULL),
  638.                 NULL);
  639.             SendMessage(hResFire, WM_SETFONT, (WPARAM)hFont, TRUE);
  640.  
  641.             hResFireLbl = CreateWindowEx(NULL,
  642.                 "STATIC",
  643.                 "Fire Resistance:",
  644.                 WS_VISIBLE|WS_CHILD|SS_SIMPLE,
  645.                 265,
  646.                 65,
  647.                 130,
  648.                 24,
  649.                 hWnd,
  650.                 (HMENU)IDC_RES_FIRE_LBL,
  651.                 GetModuleHandle(NULL),
  652.                 NULL);
  653.             SendMessage(hResFireLbl, WM_SETFONT, (WPARAM)hFont, TRUE);
  654.  
  655.             hResCold = CreateWindowEx(WS_EX_CLIENTEDGE,
  656.                 "EDIT",
  657.                 "100",
  658.                 WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_MULTILINE|ES_NUMBER|ES_RIGHT,
  659.                 415,
  660.                 88,
  661.                 70,
  662.                 24,
  663.                 hWnd,
  664.                 (HMENU)IDC_RES_COLD,
  665.                 GetModuleHandle(NULL),
  666.                 NULL);
  667.             SendMessage(hResCold, WM_SETFONT, (WPARAM)hFont, TRUE);
  668.  
  669.             hResColdLbl = CreateWindowEx(NULL,
  670.                 "STATIC",
  671.                 "Cold Resistance:",
  672.                 WS_VISIBLE|WS_CHILD|SS_SIMPLE,
  673.                 265,
  674.                 91,
  675.                 130,
  676.                 24,
  677.                 hWnd,
  678.                 (HMENU)IDC_RES_COLD_LBL,
  679.                 GetModuleHandle(NULL),
  680.                 NULL);
  681.             SendMessage(hResColdLbl, WM_SETFONT, (WPARAM)hFont, TRUE);
  682.  
  683.             hResPoison = CreateWindowEx(WS_EX_CLIENTEDGE,
  684.                 "EDIT",
  685.                 "100",
  686.                 WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_MULTILINE|ES_NUMBER|ES_RIGHT,
  687.                 415,
  688.                 114,
  689.                 70,
  690.                 24,
  691.                 hWnd,
  692.                 (HMENU)IDC_RES_POISON,
  693.                 GetModuleHandle(NULL),
  694.                 NULL);
  695.             SendMessage(hResPoison, WM_SETFONT, (WPARAM)hFont, TRUE);
  696.  
  697.             hResPoisonLbl = CreateWindowEx(NULL,
  698.                 "STATIC",
  699.                 "Poison Resistance:",
  700.                 WS_VISIBLE|WS_CHILD|SS_SIMPLE,
  701.                 265,
  702.                 117,
  703.                 130,
  704.                 24,
  705.                 hWnd,
  706.                 (HMENU)IDC_RES_POISON_LBL,
  707.                 GetModuleHandle(NULL),
  708.                 NULL);
  709.             SendMessage(hResPoisonLbl, WM_SETFONT, (WPARAM)hFont, TRUE);
  710.  
  711.             hResArcane = CreateWindowEx(WS_EX_CLIENTEDGE,
  712.                 "EDIT",
  713.                 "100",
  714.                 WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_MULTILINE|ES_NUMBER|ES_RIGHT,
  715.                 415,
  716.                 140,
  717.                 70,
  718.                 24,
  719.                 hWnd,
  720.                 (HMENU)IDC_RES_ARCANE,
  721.                 GetModuleHandle(NULL),
  722.                 NULL);
  723.             SendMessage(hResArcane, WM_SETFONT, (WPARAM)hFont, TRUE);
  724.  
  725.             hResArcaneLbl = CreateWindowEx(NULL,
  726.                 "STATIC",
  727.                 "Arcane Resistance:",
  728.                 WS_VISIBLE|WS_CHILD|SS_SIMPLE,
  729.                 265,
  730.                 143,
  731.                 130,
  732.                 24,
  733.                 hWnd,
  734.                 (HMENU)IDC_RES_ARCANE_LBL,
  735.                 GetModuleHandle(NULL),
  736.                 NULL);
  737.             SendMessage(hResArcaneLbl, WM_SETFONT, (WPARAM)hFont, TRUE);
  738.  
  739.             hResLightning = CreateWindowEx(WS_EX_CLIENTEDGE,
  740.                 "EDIT",
  741.                 "100",
  742.                 WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_MULTILINE|ES_NUMBER|ES_RIGHT,
  743.                 415,
  744.                 166,
  745.                 70,
  746.                 24,
  747.                 hWnd,
  748.                 (HMENU)IDC_RES_LIGHTNING,
  749.                 GetModuleHandle(NULL),
  750.                 NULL);
  751.             SendMessage(hResLightning, WM_SETFONT, (WPARAM)hFont, TRUE);
  752.  
  753.             hResLightningLbl = CreateWindowEx(NULL,
  754.                 "STATIC",
  755.                 "Lightning Resistance:",
  756.                 WS_VISIBLE|WS_CHILD|SS_SIMPLE,
  757.                 265,
  758.                 169,
  759.                 130,
  760.                 24,
  761.                 hWnd,
  762.                 (HMENU)IDC_RES_LIGHTNING_LBL,
  763.                 GetModuleHandle(NULL),
  764.                 NULL);
  765.             SendMessage(hResLightningLbl, WM_SETFONT, (WPARAM)hFont, TRUE);
  766.  
  767.             hResMelee = CreateWindowEx(WS_EX_CLIENTEDGE,
  768.                 "EDIT",
  769.                 "100",
  770.                 WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_MULTILINE|ES_NUMBER|ES_RIGHT,
  771.                 415,
  772.                 192,
  773.                 70,
  774.                 24,
  775.                 hWnd,
  776.                 (HMENU)IDC_RES_MELEE,
  777.                 GetModuleHandle(NULL),
  778.                 NULL);
  779.             SendMessage(hResMelee, WM_SETFONT, (WPARAM)hFont, TRUE);
  780.  
  781.             hResMeleeLbl = CreateWindowEx(NULL,
  782.                 "STATIC",
  783.                 "Melee Resistance:",
  784.                 WS_VISIBLE|WS_CHILD|SS_SIMPLE,
  785.                 265,
  786.                 195,
  787.                 130,
  788.                 24,
  789.                 hWnd,
  790.                 (HMENU)IDC_RES_MELEE_LBL,
  791.                 GetModuleHandle(NULL),
  792.                 NULL);
  793.             SendMessage(hResMeleeLbl, WM_SETFONT, (WPARAM)hFont, TRUE);
  794.  
  795.             hResRange = CreateWindowEx(WS_EX_CLIENTEDGE,
  796.                 "EDIT",
  797.                 "100",
  798.                 WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_MULTILINE|ES_NUMBER|ES_RIGHT,
  799.                 415,
  800.                 218,
  801.                 70,
  802.                 24,
  803.                 hWnd,
  804.                 (HMENU)IDC_RES_RANGE,
  805.                 GetModuleHandle(NULL),
  806.                 NULL);
  807.             SendMessage(hResRange, WM_SETFONT, (WPARAM)hFont, TRUE);
  808.  
  809.             hResRangeLbl = CreateWindowEx(NULL,
  810.                 "STATIC",
  811.                 "Range Resistance:",
  812.                 WS_VISIBLE|WS_CHILD|SS_SIMPLE,
  813.                 265,
  814.                 218,
  815.                 130,
  816.                 24,
  817.                 hWnd,
  818.                 (HMENU)IDC_RES_RANGE_LBL,
  819.                 GetModuleHandle(NULL),
  820.                 NULL);
  821.             SendMessage(hResRangeLbl, WM_SETFONT, (WPARAM)hFont, TRUE);
  822.  
  823.             hStatEffectiveHP1 = CreateWindowEx(WS_EX_CLIENTEDGE,
  824.                 "EDIT",
  825.                 "100",
  826.                 WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_MULTILINE|ES_NUMBER|ES_RIGHT|ES_READONLY,
  827.                 160,
  828.                 218,
  829.                 70,
  830.                 24,
  831.                 hWnd,
  832.                 (HMENU)IDC_STAT_EFFECTIVEHP1,
  833.                 GetModuleHandle(NULL),
  834.                 NULL);
  835.             SendMessage(hStatEffectiveHP1, WM_SETFONT, (WPARAM)hFont, TRUE);
  836.  
  837.             hStatEffectiveHP1Lbl = CreateWindowEx(NULL,
  838.                 "STATIC",
  839.                 "Effective HP:",
  840.                 WS_VISIBLE|WS_CHILD|SS_SIMPLE,
  841.                 10,
  842.                 221,
  843.                 120,
  844.                 24,
  845.                 hWnd,
  846.                 (HMENU)IDC_STAT_EFFECTIVEHP1_LBL,
  847.                 GetModuleHandle(NULL),
  848.                 NULL);
  849.             SendMessage(hStatEffectiveHP1Lbl, WM_SETFONT, (WPARAM)hFont, TRUE);
  850.  
  851.             hItem1Lbl = CreateWindowEx(NULL,
  852.                 "STATIC",
  853.                 "Item 1:",
  854.                 WS_VISIBLE|WS_CHILD|SS_SIMPLE,
  855.                 10,
  856.                 250,
  857.                 120,
  858.                 24,
  859.                 hWnd,
  860.                 (HMENU)IDC_ITEM1_LBL,
  861.                 GetModuleHandle(NULL),
  862.                 NULL);
  863.             SendMessage(hItem1Lbl, WM_SETFONT, (WPARAM)hFont, TRUE);
  864.  
  865.             hItem1ResAll = CreateWindowEx(WS_EX_CLIENTEDGE,
  866.                 "EDIT",
  867.                 "100",
  868.                 WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_MULTILINE|ES_NUMBER|ES_RIGHT,
  869.                 160,
  870.                 276,
  871.                 70,
  872.                 24,
  873.                 hWnd,
  874.                 (HMENU)IDC_ITEM1_RES_ALL,
  875.                 GetModuleHandle(NULL),
  876.                 NULL);
  877.             SendMessage(hItem1ResAll, WM_SETFONT, (WPARAM)hFont, TRUE);
  878.  
  879.             hItem1ResAllLbl = CreateWindowEx(NULL,
  880.                 "STATIC",
  881.                 "Resist All:",
  882.                 WS_VISIBLE|WS_CHILD|SS_SIMPLE,
  883.                 10,
  884.                 279,
  885.                 120,
  886.                 24,
  887.                 hWnd,
  888.                 (HMENU)IDC_ITEM1_RES_ALL_LBL,
  889.                 GetModuleHandle(NULL),
  890.                 NULL);
  891.             SendMessage(hItem1ResAllLbl, WM_SETFONT, (WPARAM)hFont, TRUE);
  892.  
  893.             hItem1ResFire = CreateWindowEx(WS_EX_CLIENTEDGE,
  894.                 "EDIT",
  895.                 "100",
  896.                 WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_MULTILINE|ES_NUMBER|ES_RIGHT,
  897.                 160,
  898.                 303,
  899.                 70,
  900.                 24,
  901.                 hWnd,
  902.                 (HMENU)IDC_ITEM1_RES_FIRE,
  903.                 GetModuleHandle(NULL),
  904.                 NULL);
  905.             SendMessage(hItem1ResFire, WM_SETFONT, (WPARAM)hFont, TRUE);
  906.  
  907.             hItem1ResFireLbl = CreateWindowEx(NULL,
  908.                 "STATIC",
  909.                 "Fire Resistance:",
  910.                 WS_VISIBLE|WS_CHILD|SS_SIMPLE,
  911.                 10,
  912.                 306,
  913.                 120,
  914.                 24,
  915.                 hWnd,
  916.                 (HMENU)IDC_ITEM1_RES_FIRE_LBL,
  917.                 GetModuleHandle(NULL),
  918.                 NULL);
  919.             SendMessage(hItem1ResFireLbl, WM_SETFONT, (WPARAM)hFont, TRUE);
  920.  
  921.             hItem1ResCold = CreateWindowEx(WS_EX_CLIENTEDGE,
  922.                 "EDIT",
  923.                 "100",
  924.                 WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_MULTILINE|ES_NUMBER|ES_RIGHT,
  925.                 160,
  926.                 329,
  927.                 70,
  928.                 24,
  929.                 hWnd,
  930.                 (HMENU)IDC_ITEM1_RES_COLD,
  931.                 GetModuleHandle(NULL),
  932.                 NULL);
  933.             SendMessage(hItem1ResCold, WM_SETFONT, (WPARAM)hFont, TRUE);
  934.  
  935.             hItem1ResColdLbl = CreateWindowEx(NULL,
  936.                 "STATIC",
  937.                 "Cold Resistance:",
  938.                 WS_VISIBLE|WS_CHILD|SS_SIMPLE,
  939.                 10,
  940.                 332,
  941.                 120,
  942.                 24,
  943.                 hWnd,
  944.                 (HMENU)IDC_ITEM1_RES_COLD_LBL,
  945.                 GetModuleHandle(NULL),
  946.                 NULL);
  947.             SendMessage(hItem1ResColdLbl, WM_SETFONT, (WPARAM)hFont, TRUE);
  948.  
  949.             hItem1ResPoison = CreateWindowEx(WS_EX_CLIENTEDGE,
  950.                 "EDIT",
  951.                 "100",
  952.                 WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_MULTILINE|ES_NUMBER|ES_RIGHT,
  953.                 160,
  954.                 355,
  955.                 70,
  956.                 24,
  957.                 hWnd,
  958.                 (HMENU)IDC_ITEM1_RES_POISON,
  959.                 GetModuleHandle(NULL),
  960.                 NULL);
  961.             SendMessage(hItem1ResPoison, WM_SETFONT, (WPARAM)hFont, TRUE);
  962.  
  963.             hItem1ResPoisonLbl = CreateWindowEx(NULL,
  964.                 "STATIC",
  965.                 "Poison Resistance:",
  966.                 WS_VISIBLE|WS_CHILD|SS_SIMPLE,
  967.                 10,
  968.                 358,
  969.                 120,
  970.                 24,
  971.                 hWnd,
  972.                 (HMENU)IDC_ITEM1_RES_POISON_LBL,
  973.                 GetModuleHandle(NULL),
  974.                 NULL);
  975.             SendMessage(hItem1ResPoisonLbl, WM_SETFONT, (WPARAM)hFont, TRUE);
  976.  
  977.             hItem1ResArcane = CreateWindowEx(WS_EX_CLIENTEDGE,
  978.                 "EDIT",
  979.                 "100",
  980.                 WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_MULTILINE|ES_NUMBER|ES_RIGHT,
  981.                 160,
  982.                 381,
  983.                 70,
  984.                 24,
  985.                 hWnd,
  986.                 (HMENU)IDC_ITEM1_RES_ARCANE,
  987.                 GetModuleHandle(NULL),
  988.                 NULL);
  989.             SendMessage(hItem1ResArcane, WM_SETFONT, (WPARAM)hFont, TRUE);
  990.  
  991.             hItem1ResArcaneLbl = CreateWindowEx(NULL,
  992.                 "STATIC",
  993.                 "Arcane Resistance:",
  994.                 WS_VISIBLE|WS_CHILD|SS_SIMPLE,
  995.                 10,
  996.                 384,
  997.                 120,
  998.                 24,
  999.                 hWnd,
  1000.                 (HMENU)IDC_ITEM1_RES_ARCANE_LBL,
  1001.                 GetModuleHandle(NULL),
  1002.                 NULL);
  1003.             SendMessage(hItem1ResArcaneLbl, WM_SETFONT, (WPARAM)hFont, TRUE);
  1004.  
  1005.             hItem1ResLightning = CreateWindowEx(WS_EX_CLIENTEDGE,
  1006.                 "EDIT",
  1007.                 "100",
  1008.                 WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_MULTILINE|ES_NUMBER|ES_RIGHT,
  1009.                 160,
  1010.                 407,
  1011.                 70,
  1012.                 24,
  1013.                 hWnd,
  1014.                 (HMENU)IDC_ITEM1_RES_LIGHTNING,
  1015.                 GetModuleHandle(NULL),
  1016.                 NULL);
  1017.             SendMessage(hItem1ResLightning, WM_SETFONT, (WPARAM)hFont, TRUE);
  1018.  
  1019.             hItem1ResLightningLbl = CreateWindowEx(NULL,
  1020.                 "STATIC",
  1021.                 "Lightning Resistance:",
  1022.                 WS_VISIBLE|WS_CHILD|SS_SIMPLE,
  1023.                 10,
  1024.                 410,
  1025.                 150,
  1026.                 24,
  1027.                 hWnd,
  1028.                 (HMENU)IDC_ITEM1_RES_LIGHTNING_LBL,
  1029.                 GetModuleHandle(NULL),
  1030.                 NULL);
  1031.             SendMessage(hItem1ResLightningLbl, WM_SETFONT, (WPARAM)hFont, TRUE);
  1032.  
  1033.             hItem1StatArmor = CreateWindowEx(WS_EX_CLIENTEDGE,
  1034.                 "EDIT",
  1035.                 "1000",
  1036.                 WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_MULTILINE|ES_NUMBER|ES_RIGHT,
  1037.                 160,
  1038.                 433,
  1039.                 70,
  1040.                 24,
  1041.                 hWnd,
  1042.                 (HMENU)IDC_ITEM1_STAT_ARMOR,
  1043.                 GetModuleHandle(NULL),
  1044.                 NULL);
  1045.             SendMessage(hItem1StatArmor, WM_SETFONT, (WPARAM)hFont, TRUE);
  1046.  
  1047.             hItem1StatArmorLbl = CreateWindowEx(NULL,
  1048.                 "STATIC",
  1049.                 "Armor:",
  1050.                 WS_VISIBLE|WS_CHILD|SS_SIMPLE,
  1051.                 10,
  1052.                 436,
  1053.                 150,
  1054.                 24,
  1055.                 hWnd,
  1056.                 (HMENU)IDC_ITEM1_STAT_ARMOR_LBL,
  1057.                 GetModuleHandle(NULL),
  1058.                 NULL);
  1059.             SendMessage(hItem1StatArmorLbl, WM_SETFONT, (WPARAM)hFont, TRUE);
  1060.  
  1061.             hItem1StatStr = CreateWindowEx(WS_EX_CLIENTEDGE,
  1062.                 "EDIT",
  1063.                 "100",
  1064.                 WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_MULTILINE|ES_NUMBER|ES_RIGHT,
  1065.                 160,
  1066.                 459,
  1067.                 70,
  1068.                 24,
  1069.                 hWnd,
  1070.                 (HMENU)IDC_ITEM1_STAT_STR,
  1071.                 GetModuleHandle(NULL),
  1072.                 NULL);
  1073.             SendMessage(hItem1StatStr, WM_SETFONT, (WPARAM)hFont, TRUE);
  1074.  
  1075.             hItem1StatStrLbl = CreateWindowEx(NULL,
  1076.                 "STATIC",
  1077.                 "Strength:",
  1078.                 WS_VISIBLE|WS_CHILD|SS_SIMPLE,
  1079.                 10,
  1080.                 462,
  1081.                 150,
  1082.                 24,
  1083.                 hWnd,
  1084.                 (HMENU)IDC_ITEM1_STAT_STR_LBL,
  1085.                 GetModuleHandle(NULL),
  1086.                 NULL);
  1087.             SendMessage(hItem1StatStrLbl, WM_SETFONT, (WPARAM)hFont, TRUE);
  1088.  
  1089.             hItem1StatDex = CreateWindowEx(WS_EX_CLIENTEDGE,
  1090.                 "EDIT",
  1091.                 "100",
  1092.                 WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_MULTILINE|ES_NUMBER|ES_RIGHT,
  1093.                 160,
  1094.                 485,
  1095.                 70,
  1096.                 24,
  1097.                 hWnd,
  1098.                 (HMENU)IDC_ITEM1_STAT_VIT,
  1099.                 GetModuleHandle(NULL),
  1100.                 NULL);
  1101.             SendMessage(hItem1StatDex, WM_SETFONT, (WPARAM)hFont, TRUE);
  1102.  
  1103.             hItem1StatDexLbl = CreateWindowEx(NULL,
  1104.                 "STATIC",
  1105.                 "Dexterity:",
  1106.                 WS_VISIBLE|WS_CHILD|SS_SIMPLE,
  1107.                 10,
  1108.                 488,
  1109.                 150,
  1110.                 24,
  1111.                 hWnd,
  1112.                 (HMENU)IDC_ITEM1_STAT_DEX_LBL,
  1113.                 GetModuleHandle(NULL),
  1114.                 NULL);
  1115.             SendMessage(hItem1StatDexLbl, WM_SETFONT, (WPARAM)hFont, TRUE);
  1116.  
  1117.             hItem1StatVit = CreateWindowEx(WS_EX_CLIENTEDGE,
  1118.                 "EDIT",
  1119.                 "100",
  1120.                 WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_MULTILINE|ES_NUMBER|ES_RIGHT,
  1121.                 160,
  1122.                 511,
  1123.                 70,
  1124.                 24,
  1125.                 hWnd,
  1126.                 (HMENU)IDC_ITEM1_STAT_VIT,
  1127.                 GetModuleHandle(NULL),
  1128.                 NULL);
  1129.             SendMessage(hItem1StatVit, WM_SETFONT, (WPARAM)hFont, TRUE);
  1130.  
  1131.             hItem1StatVitLbl = CreateWindowEx(NULL,
  1132.                 "STATIC",
  1133.                 "Vitality:",
  1134.                 WS_VISIBLE|WS_CHILD|SS_SIMPLE,
  1135.                 10,
  1136.                 514,
  1137.                 150,
  1138.                 24,
  1139.                 hWnd,
  1140.                 (HMENU)IDC_ITEM1_STAT_VIT_LBL,
  1141.                 GetModuleHandle(NULL),
  1142.                 NULL);
  1143.             SendMessage(hItem1StatVitLbl, WM_SETFONT, (WPARAM)hFont, TRUE);
  1144.  
  1145.             hItem1StatInt = CreateWindowEx(WS_EX_CLIENTEDGE,
  1146.                 "EDIT",
  1147.                 "100",
  1148.                 WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_MULTILINE|ES_NUMBER|ES_RIGHT,
  1149.                 160,
  1150.                 537,
  1151.                 70,
  1152.                 24,
  1153.                 hWnd,
  1154.                 (HMENU)IDC_ITEM1_STAT_INT,
  1155.                 GetModuleHandle(NULL),
  1156.                 NULL);
  1157.             SendMessage(hItem1StatInt, WM_SETFONT, (WPARAM)hFont, TRUE);
  1158.  
  1159.             hItem1StatIntLbl = CreateWindowEx(NULL,
  1160.                 "STATIC",
  1161.                 "Intelligence:",
  1162.                 WS_VISIBLE|WS_CHILD|SS_SIMPLE,
  1163.                 10,
  1164.                 540,
  1165.                 150,
  1166.                 24,
  1167.                 hWnd,
  1168.                 (HMENU)IDC_ITEM1_STAT_INT_LBL,
  1169.                 GetModuleHandle(NULL),
  1170.                 NULL);
  1171.             SendMessage(hItem1StatIntLbl, WM_SETFONT, (WPARAM)hFont, TRUE);
  1172.  
  1173.             hItem2Lbl = CreateWindowEx(NULL,
  1174.                 "STATIC",
  1175.                 "Item 2:",
  1176.                 WS_VISIBLE|WS_CHILD|SS_SIMPLE,
  1177.                 265,
  1178.                 250,
  1179.                 120,
  1180.                 24,
  1181.                 hWnd,
  1182.                 (HMENU)IDC_ITEM2_LBL,
  1183.                 GetModuleHandle(NULL),
  1184.                 NULL);
  1185.             SendMessage(hItem2Lbl, WM_SETFONT, (WPARAM)hFont, TRUE);
  1186.  
  1187.             hItem2ResAll = CreateWindowEx(WS_EX_CLIENTEDGE,
  1188.                 "EDIT",
  1189.                 "100",
  1190.                 WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_MULTILINE|ES_NUMBER|ES_RIGHT,
  1191.                 415,
  1192.                 276,
  1193.                 70,
  1194.                 24,
  1195.                 hWnd,
  1196.                 (HMENU)IDC_ITEM2_RES_ALL,
  1197.                 GetModuleHandle(NULL),
  1198.                 NULL);
  1199.             SendMessage(hItem2ResAll, WM_SETFONT, (WPARAM)hFont, TRUE);
  1200.  
  1201.             hItem2ResAllLbl = CreateWindowEx(NULL,
  1202.                 "STATIC",
  1203.                 "Resist All:",
  1204.                 WS_VISIBLE|WS_CHILD|SS_SIMPLE,
  1205.                 265,
  1206.                 279,
  1207.                 120,
  1208.                 24,
  1209.                 hWnd,
  1210.                 (HMENU)IDC_ITEM2_RES_ALL_LBL,
  1211.                 GetModuleHandle(NULL),
  1212.                 NULL);
  1213.             SendMessage(hItem2ResAllLbl, WM_SETFONT, (WPARAM)hFont, TRUE);
  1214.  
  1215.             hItem2ResFire = CreateWindowEx(WS_EX_CLIENTEDGE,
  1216.                 "EDIT",
  1217.                 "100",
  1218.                 WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_MULTILINE|ES_NUMBER|ES_RIGHT,
  1219.                 415,
  1220.                 303,
  1221.                 70,
  1222.                 24,
  1223.                 hWnd,
  1224.                 (HMENU)IDC_ITEM2_RES_FIRE,
  1225.                 GetModuleHandle(NULL),
  1226.                 NULL);
  1227.             SendMessage(hItem2ResFire, WM_SETFONT, (WPARAM)hFont, TRUE);
  1228.  
  1229.             hItem2ResFireLbl = CreateWindowEx(NULL,
  1230.                 "STATIC",
  1231.                 "Fire Resistance:",
  1232.                 WS_VISIBLE|WS_CHILD|SS_SIMPLE,
  1233.                 265,
  1234.                 306,
  1235.                 120,
  1236.                 24,
  1237.                 hWnd,
  1238.                 (HMENU)IDC_ITEM2_RES_FIRE_LBL,
  1239.                 GetModuleHandle(NULL),
  1240.                 NULL);
  1241.             SendMessage(hItem2ResFireLbl, WM_SETFONT, (WPARAM)hFont, TRUE);
  1242.  
  1243.             hItem2ResCold = CreateWindowEx(WS_EX_CLIENTEDGE,
  1244.                 "EDIT",
  1245.                 "100",
  1246.                 WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_MULTILINE|ES_NUMBER|ES_RIGHT,
  1247.                 415,
  1248.                 329,
  1249.                 70,
  1250.                 24,
  1251.                 hWnd,
  1252.                 (HMENU)IDC_ITEM2_RES_COLD,
  1253.                 GetModuleHandle(NULL),
  1254.                 NULL);
  1255.             SendMessage(hItem2ResCold, WM_SETFONT, (WPARAM)hFont, TRUE);
  1256.  
  1257.             hItem2ResColdLbl = CreateWindowEx(NULL,
  1258.                 "STATIC",
  1259.                 "Cold Resistance:",
  1260.                 WS_VISIBLE|WS_CHILD|SS_SIMPLE,
  1261.                 265,
  1262.                 332,
  1263.                 120,
  1264.                 24,
  1265.                 hWnd,
  1266.                 (HMENU)IDC_ITEM2_RES_COLD_LBL,
  1267.                 GetModuleHandle(NULL),
  1268.                 NULL);
  1269.             SendMessage(hItem2ResColdLbl, WM_SETFONT, (WPARAM)hFont, TRUE);
  1270.  
  1271.             hItem2ResPoison = CreateWindowEx(WS_EX_CLIENTEDGE,
  1272.                 "EDIT",
  1273.                 "100",
  1274.                 WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_MULTILINE|ES_NUMBER|ES_RIGHT,
  1275.                 415,
  1276.                 355,
  1277.                 70,
  1278.                 24,
  1279.                 hWnd,
  1280.                 (HMENU)IDC_ITEM2_RES_POISON,
  1281.                 GetModuleHandle(NULL),
  1282.                 NULL);
  1283.             SendMessage(hItem2ResPoison, WM_SETFONT, (WPARAM)hFont, TRUE);
  1284.  
  1285.             hItem2ResPoisonLbl = CreateWindowEx(NULL,
  1286.                 "STATIC",
  1287.                 "Poison Resistance:",
  1288.                 WS_VISIBLE|WS_CHILD|SS_SIMPLE,
  1289.                 265,
  1290.                 358,
  1291.                 120,
  1292.                 24,
  1293.                 hWnd,
  1294.                 (HMENU)IDC_ITEM2_RES_POISON_LBL,
  1295.                 GetModuleHandle(NULL),
  1296.                 NULL);
  1297.             SendMessage(hItem2ResPoisonLbl, WM_SETFONT, (WPARAM)hFont, TRUE);
  1298.  
  1299.             hItem2ResArcane = CreateWindowEx(WS_EX_CLIENTEDGE,
  1300.                 "EDIT",
  1301.                 "100",
  1302.                 WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_MULTILINE|ES_NUMBER|ES_RIGHT,
  1303.                 415,
  1304.                 381,
  1305.                 70,
  1306.                 24,
  1307.                 hWnd,
  1308.                 (HMENU)IDC_ITEM2_RES_ARCANE,
  1309.                 GetModuleHandle(NULL),
  1310.                 NULL);
  1311.             SendMessage(hItem2ResArcane, WM_SETFONT, (WPARAM)hFont, TRUE);
  1312.  
  1313.             hItem2ResArcaneLbl = CreateWindowEx(NULL,
  1314.                 "STATIC",
  1315.                 "Arcane Resistance:",
  1316.                 WS_VISIBLE|WS_CHILD|SS_SIMPLE,
  1317.                 265,
  1318.                 384,
  1319.                 120,
  1320.                 24,
  1321.                 hWnd,
  1322.                 (HMENU)IDC_ITEM2_RES_ARCANE_LBL,
  1323.                 GetModuleHandle(NULL),
  1324.                 NULL);
  1325.             SendMessage(hItem2ResArcaneLbl, WM_SETFONT, (WPARAM)hFont, TRUE);
  1326.  
  1327.             hItem2ResLightning = CreateWindowEx(WS_EX_CLIENTEDGE,
  1328.                 "EDIT",
  1329.                 "100",
  1330.                 WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_MULTILINE|ES_NUMBER|ES_RIGHT,
  1331.                 415,
  1332.                 407,
  1333.                 70,
  1334.                 24,
  1335.                 hWnd,
  1336.                 (HMENU)IDC_ITEM2_RES_LIGHTNING,
  1337.                 GetModuleHandle(NULL),
  1338.                 NULL);
  1339.             SendMessage(hItem2ResLightning, WM_SETFONT, (WPARAM)hFont, TRUE);
  1340.  
  1341.             hItem2ResLightningLbl = CreateWindowEx(NULL,
  1342.                 "STATIC",
  1343.                 "Lightning Resistance:",
  1344.                 WS_VISIBLE|WS_CHILD|SS_SIMPLE,
  1345.                 265,
  1346.                 410,
  1347.                 150,
  1348.                 24,
  1349.                 hWnd,
  1350.                 (HMENU)IDC_ITEM2_RES_LIGHTNING_LBL,
  1351.                 GetModuleHandle(NULL),
  1352.                 NULL);
  1353.             SendMessage(hItem2ResLightningLbl, WM_SETFONT, (WPARAM)hFont, TRUE);
  1354.  
  1355.             hItem2StatArmor = CreateWindowEx(WS_EX_CLIENTEDGE,
  1356.                 "EDIT",
  1357.                 "1000",
  1358.                 WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_MULTILINE|ES_NUMBER|ES_RIGHT,
  1359.                 415,
  1360.                 433,
  1361.                 70,
  1362.                 24,
  1363.                 hWnd,
  1364.                 (HMENU)IDC_ITEM2_STAT_ARMOR,
  1365.                 GetModuleHandle(NULL),
  1366.                 NULL);
  1367.             SendMessage(hItem2StatArmor, WM_SETFONT, (WPARAM)hFont, TRUE);
  1368.  
  1369.             hItem2StatArmorLbl = CreateWindowEx(NULL,
  1370.                 "STATIC",
  1371.                 "Armor:",
  1372.                 WS_VISIBLE|WS_CHILD|SS_SIMPLE,
  1373.                 265,
  1374.                 436,
  1375.                 150,
  1376.                 24,
  1377.                 hWnd,
  1378.                 (HMENU)IDC_ITEM2_STAT_ARMOR_LBL,
  1379.                 GetModuleHandle(NULL),
  1380.                 NULL);
  1381.             SendMessage(hItem2StatArmorLbl, WM_SETFONT, (WPARAM)hFont, TRUE);
  1382.  
  1383.             hItem2StatStr = CreateWindowEx(WS_EX_CLIENTEDGE,
  1384.                 "EDIT",
  1385.                 "100",
  1386.                 WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_MULTILINE|ES_NUMBER|ES_RIGHT,
  1387.                 415,
  1388.                 459,
  1389.                 70,
  1390.                 24,
  1391.                 hWnd,
  1392.                 (HMENU)IDC_ITEM2_STAT_STR,
  1393.                 GetModuleHandle(NULL),
  1394.                 NULL);
  1395.             SendMessage(hItem2StatStr, WM_SETFONT, (WPARAM)hFont, TRUE);
  1396.  
  1397.             hItem2StatStrLbl = CreateWindowEx(NULL,
  1398.                 "STATIC",
  1399.                 "Strength:",
  1400.                 WS_VISIBLE|WS_CHILD|SS_SIMPLE,
  1401.                 265,
  1402.                 462,
  1403.                 150,
  1404.                 24,
  1405.                 hWnd,
  1406.                 (HMENU)IDC_ITEM2_STAT_STR_LBL,
  1407.                 GetModuleHandle(NULL),
  1408.                 NULL);
  1409.             SendMessage(hItem2StatStrLbl, WM_SETFONT, (WPARAM)hFont, TRUE);
  1410.  
  1411.             hItem2StatDex = CreateWindowEx(WS_EX_CLIENTEDGE,
  1412.                 "EDIT",
  1413.                 "100",
  1414.                 WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_MULTILINE|ES_NUMBER|ES_RIGHT,
  1415.                 415,
  1416.                 485,
  1417.                 70,
  1418.                 24,
  1419.                 hWnd,
  1420.                 (HMENU)IDC_ITEM2_STAT_VIT,
  1421.                 GetModuleHandle(NULL),
  1422.                 NULL);
  1423.             SendMessage(hItem2StatDex, WM_SETFONT, (WPARAM)hFont, TRUE);
  1424.  
  1425.             hItem2StatDexLbl = CreateWindowEx(NULL,
  1426.                 "STATIC",
  1427.                 "Dexterity:",
  1428.                 WS_VISIBLE|WS_CHILD|SS_SIMPLE,
  1429.                 265,
  1430.                 488,
  1431.                 150,
  1432.                 24,
  1433.                 hWnd,
  1434.                 (HMENU)IDC_ITEM2_STAT_DEX_LBL,
  1435.                 GetModuleHandle(NULL),
  1436.                 NULL);
  1437.             SendMessage(hItem2StatDexLbl, WM_SETFONT, (WPARAM)hFont, TRUE);
  1438.  
  1439.             hItem2StatVit = CreateWindowEx(WS_EX_CLIENTEDGE,
  1440.                 "EDIT",
  1441.                 "100",
  1442.                 WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_MULTILINE|ES_NUMBER|ES_RIGHT,
  1443.                 415,
  1444.                 511,
  1445.                 70,
  1446.                 24,
  1447.                 hWnd,
  1448.                 (HMENU)IDC_ITEM2_STAT_VIT,
  1449.                 GetModuleHandle(NULL),
  1450.                 NULL);
  1451.             SendMessage(hItem2StatVit, WM_SETFONT, (WPARAM)hFont, TRUE);
  1452.  
  1453.             hItem2StatVitLbl = CreateWindowEx(NULL,
  1454.                 "STATIC",
  1455.                 "Vitality:",
  1456.                 WS_VISIBLE|WS_CHILD|SS_SIMPLE,
  1457.                 265,
  1458.                 514,
  1459.                 150,
  1460.                 24,
  1461.                 hWnd,
  1462.                 (HMENU)IDC_ITEM2_STAT_VIT_LBL,
  1463.                 GetModuleHandle(NULL),
  1464.                 NULL);
  1465.             SendMessage(hItem2StatVitLbl, WM_SETFONT, (WPARAM)hFont, TRUE);
  1466.  
  1467.             hItem2StatInt = CreateWindowEx(WS_EX_CLIENTEDGE,
  1468.                 "EDIT",
  1469.                 "100",
  1470.                 WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_MULTILINE|ES_NUMBER|ES_RIGHT,
  1471.                 415,
  1472.                 537,
  1473.                 70,
  1474.                 24,
  1475.                 hWnd,
  1476.                 (HMENU)IDC_ITEM2_STAT_INT,
  1477.                 GetModuleHandle(NULL),
  1478.                 NULL);
  1479.             SendMessage(hItem2StatInt, WM_SETFONT, (WPARAM)hFont, TRUE);
  1480.  
  1481.             hItem2StatIntLbl = CreateWindowEx(NULL,
  1482.                 "STATIC",
  1483.                 "Intelligence:",
  1484.                 WS_VISIBLE|WS_CHILD|SS_SIMPLE,
  1485.                 265,
  1486.                 540,
  1487.                 150,
  1488.                 24,
  1489.                 hWnd,
  1490.                 (HMENU)IDC_ITEM2_STAT_INT_LBL,
  1491.                 GetModuleHandle(NULL),
  1492.                 NULL);
  1493.             SendMessage(hItem2StatIntLbl, WM_SETFONT, (WPARAM)hFont, TRUE);
  1494.  
  1495.             hItemCompareLbl = CreateWindowEx(NULL,
  1496.                 "STATIC",
  1497.                 "Comparative Change In Effective Health: +0",
  1498.                 WS_VISIBLE|WS_CHILD|SS_SIMPLE,
  1499.                 100,
  1500.                 580,
  1501.                 400,
  1502.                 24,
  1503.                 hWnd,
  1504.                 (HMENU)IDC_ITEM_COMPARE_LBL,
  1505.                 GetModuleHandle(NULL),
  1506.                 NULL);
  1507.             SendMessage(hItemCompareLbl, WM_SETFONT, (WPARAM)hFont, TRUE);
  1508.         }
  1509.         return 0;
  1510.         break;
  1511.  
  1512.     case WM_CTLCOLORSTATIC:
  1513.         return 0;
  1514.         break;
  1515.  
  1516.     case WM_COMMAND:
  1517.         {
  1518.             switch(LOWORD(wParam))
  1519.             {
  1520.             case IDC_EXIT_BUTTON:
  1521.                 {
  1522.                     PostQuitMessage(0);
  1523.                 }
  1524.                 return 0;
  1525.                 break;
  1526.             case IDC_LEVEL:
  1527.                 {
  1528.                     if (HIWORD(wParam) == EN_CHANGE)
  1529.                     {
  1530.                         char buffer[10];
  1531.                         GetWindowText(hPlayerLevel, buffer, sizeof(buffer));
  1532.                         pLevel = (float)atoi(buffer);
  1533.                         if (pLevel != NULL)
  1534.                         {
  1535.                             if (pLevel > 60 || pLevel < 1)
  1536.                             {
  1537.                                 MessageBox(hWnd, "Please enter a player level within 1-60!", "Player Level Out Of Bounds", MB_ICONERROR);
  1538.                                 SetWindowText(hPlayerLevel, "1");
  1539.                                 pLevel = 1;
  1540.                             }
  1541.                             if (pVit != NULL && pPerLife != NULL && pHP != NULL && hStatHP != NULL)
  1542.                             {
  1543.                                 pHP = pLevel > 36 ? (36 + 4 * pLevel + (pLevel - 25) * pVit) * (1 + pPerLife / 100) : (36 + 4 * pLevel + 10 * pVit) * (1 + pPerLife / 100);
  1544.  
  1545.                                 _itoa_s(Round(pHP), buffer, 10);
  1546.                                 SetWindowText(hStatHP, buffer);
  1547.                             }
  1548.                         }
  1549.                     }
  1550.                 }
  1551.                 return 0;
  1552.                 break;
  1553.             case IDC_STAT_STR:
  1554.                 {
  1555.                     if (HIWORD(wParam) == EN_CHANGE)
  1556.                     {
  1557.                         char buffer[10];
  1558.                         GetWindowText(hStatStr, buffer, sizeof(buffer));
  1559.                         pStr = (float)atoi(buffer);
  1560.                         if (pStr != NULL)
  1561.                         {
  1562.                             if (pStr < 1)
  1563.                             {
  1564.                                 MessageBox(hWnd, "Please enter a strength level greater than 1!", "Player Strength Out Of Bounds", MB_ICONERROR);
  1565.                                 SetWindowText(hStatStr, "100");
  1566.                                 pStr = 100;
  1567.                             }
  1568.                         }
  1569.                     }
  1570.                 }
  1571.                 return 0;
  1572.                 break;
  1573.             case IDC_STAT_DEX:
  1574.                 {
  1575.                     if (HIWORD(wParam) == EN_CHANGE)
  1576.                     {
  1577.                         char buffer[10];
  1578.                         GetWindowText(hStatDex, buffer, sizeof(buffer));
  1579.                         pDex = (float)atoi(buffer);
  1580.                         if (pDex != NULL)
  1581.                         {
  1582.                             if (pDex < 1)
  1583.                             {
  1584.                                 MessageBox(hWnd, "Please enter a dexterity level greater than 1!", "Player Dexterity Out Of Bounds", MB_ICONERROR);
  1585.                                 SetWindowText(hStatDex, "100");
  1586.                                 pDex = 100;
  1587.                             }
  1588.                         }
  1589.                     }
  1590.                 }
  1591.                 return 0;
  1592.                 break;
  1593.             case IDC_STAT_VIT:
  1594.                 {
  1595.                     if (HIWORD(wParam) == EN_CHANGE)
  1596.                     {
  1597.                         char buffer[10];
  1598.                         GetWindowText(hStatVit, buffer, sizeof(buffer));
  1599.                         pVit = (float)atoi(buffer);
  1600.                         if (pVit != NULL)
  1601.                         {
  1602.                             if (pVit < 1)
  1603.                             {
  1604.                                 MessageBox(hWnd, "Please enter a vitality level greater than 1!", "Player Vitality Out Of Bounds", MB_ICONERROR);
  1605.                                 SetWindowText(hStatVit, "100");
  1606.                                 pVit = 100;
  1607.                             }
  1608.                             if (pPerLife != NULL && pLevel != NULL && pHP != NULL && hStatHP != NULL)
  1609.                             {
  1610.                                 pHP = pLevel > 36 ? (36 + 4 * pLevel + (pLevel - 25) * pVit) * (1 + pPerLife / 100) : (36 + 4 * pLevel + 10 * pVit) * (1 + pPerLife / 100);
  1611.                                 _itoa_s(Round(pHP), buffer, 10);
  1612.                                 SetWindowText(hStatHP, buffer);
  1613.                             }
  1614.                         }
  1615.                     }
  1616.                 }
  1617.                 return 0;
  1618.                 break;
  1619.             case IDC_STAT_INT:
  1620.                 {
  1621.                     if (HIWORD(wParam) == EN_CHANGE)
  1622.                     {
  1623.                         char buffer[10];
  1624.                         GetWindowText(hStatInt, buffer, sizeof(buffer));
  1625.                         pInt = (float)atoi(buffer);
  1626.                         if (pInt != NULL)
  1627.                         {
  1628.                             if (pInt < 1)
  1629.                             {
  1630.                                 MessageBox(hWnd, "Please enter a intelligence level greater than 1!", "Player Intelligence Out Of Bounds", MB_ICONERROR);
  1631.                                 SetWindowText(hStatInt, "100");
  1632.                                 pInt = 100;
  1633.                             }
  1634.                         }
  1635.                     }
  1636.                 }
  1637.                 return 0;
  1638.                 break;
  1639.             case IDC_RES_PERLIFE:
  1640.                 {
  1641.                     if (HIWORD(wParam) == EN_CHANGE)
  1642.                     {
  1643.                         char buffer[10];
  1644.                         GetWindowText(hResPerLife, buffer, sizeof(buffer));
  1645.                         pPerLife = (float)atoi(buffer);
  1646.                         if (pPerLife < 0)
  1647.                         {
  1648.                             MessageBox(hWnd, "Please enter a non-negative percent life bonus value!", "Percent Life Bonus Out Of Bounds", MB_ICONERROR);
  1649.                             SetWindowText(hResPerLife, "1");
  1650.                             pPerLife = 1;
  1651.                             return 0;
  1652.                             break;
  1653.                         }
  1654.  
  1655.                         if (pVit != NULL && pLevel != NULL && pHP != NULL && hStatHP != NULL)
  1656.                         {
  1657.                             pHP = pLevel > 36 ? (36 + 4 * pLevel + (pLevel - 25) * pVit) * (1 + pPerLife / 100) : (36 + 4 * pLevel + 10 * pVit) * (1 + pPerLife / 100);
  1658.                             _itoa_s(Round(pHP), buffer, 10);
  1659.                             SetWindowText(hStatHP, buffer);
  1660.                         }
  1661.                     }
  1662.                 }
  1663.                 return 0;
  1664.                 break;
  1665.             case IDC_STAT_ARMOR:
  1666.                 {
  1667.                     if (HIWORD(wParam) == EN_CHANGE)
  1668.                     {
  1669.                         char buffer[10];
  1670.                         GetWindowText(hStatArmor, buffer, sizeof(buffer));
  1671.                         pArmor = (float)atoi(buffer);
  1672.                         if (pArmor < 0)
  1673.                         {
  1674.                             MessageBox(hWnd, "Please enter a non-negative armor value!", "Armor Out Of Bounds", MB_ICONERROR);
  1675.                             SetWindowText(hStatArmor, "1000");
  1676.                             pArmor = 1000;
  1677.                             return 0;
  1678.                             break;
  1679.                         }
  1680.                     }
  1681.                 }
  1682.                 return 0;
  1683.                 break;
  1684.             case IDC_RES_ALL:
  1685.                 {
  1686.                     if (HIWORD(wParam) == EN_CHANGE)
  1687.                     {
  1688.                         char buffer[10];
  1689.                         GetWindowText(hResAll, buffer, sizeof(buffer));
  1690.                         pResAll = (float)atoi(buffer);
  1691.                         if (pResAll < 0)
  1692.                         {
  1693.                             MessageBox(hWnd, "Please enter a non-negative resist all value!", "Resist All Out Of Bounds", MB_ICONERROR);
  1694.                             SetWindowText(hResAll, "100");
  1695.                             pResAll = 100;
  1696.                             return 0;
  1697.                             break;
  1698.                         }
  1699.                     }
  1700.                 }
  1701.             case IDC_RES_FIRE:
  1702.                 {
  1703.                     if (HIWORD(wParam) == EN_CHANGE)
  1704.                     {
  1705.                         char buffer[10];
  1706.                         GetWindowText(hResFire, buffer, sizeof(buffer));
  1707.                         pResFire = (float)atoi(buffer);
  1708.                         if (pResFire < 0)
  1709.                         {
  1710.                             MessageBox(hWnd, "Please enter a non-negative fire resist value!", "Fire Resist Out Of Bounds", MB_ICONERROR);
  1711.                             SetWindowText(hResFire, "100");
  1712.                             pResFire = 100;
  1713.                             return 0;
  1714.                             break;
  1715.                         }
  1716.                     }
  1717.                 }
  1718.             case IDC_RES_COLD:
  1719.                 {
  1720.                     if (HIWORD(wParam) == EN_CHANGE)
  1721.                     {
  1722.                         char buffer[10];
  1723.                         GetWindowText(hResCold, buffer, sizeof(buffer));
  1724.                         pResCold = (float)atoi(buffer);
  1725.                         if (pResCold < 0)
  1726.                         {
  1727.                             MessageBox(hWnd, "Please enter a non-negative cold resist value!", "Cold Resist Out Of Bounds", MB_ICONERROR);
  1728.                             SetWindowText(hResCold, "100");
  1729.                             pResCold = 100;
  1730.                             return 0;
  1731.                             break;
  1732.                         }
  1733.                     }
  1734.                 }
  1735.             case IDC_RES_POISON:
  1736.                 {
  1737.                     if (HIWORD(wParam) == EN_CHANGE)
  1738.                     {
  1739.                         char buffer[10];
  1740.                         GetWindowText(hResPoison, buffer, sizeof(buffer));
  1741.                         pResPoison = (float)atoi(buffer);
  1742.                         if (pResPoison < 0)
  1743.                         {
  1744.                             MessageBox(hWnd, "Please enter a non-negative poison resist value!", "Poison Resist Out Of Bounds", MB_ICONERROR);
  1745.                             SetWindowText(hResPoison, "100");
  1746.                             pResPoison = 100;
  1747.                             return 0;
  1748.                             break;
  1749.                         }
  1750.                     }
  1751.                 }
  1752.             case IDC_RES_ARCANE:
  1753.                 {
  1754.                     if (HIWORD(wParam) == EN_CHANGE)
  1755.                     {
  1756.                         char buffer[10];
  1757.                         GetWindowText(hResArcane, buffer, sizeof(buffer));
  1758.                         pResArcane = (float)atoi(buffer);
  1759.                         if (pResArcane < 0)
  1760.                         {
  1761.                             MessageBox(hWnd, "Please enter a non-negative arcane resist value!", "Arcane Resist Out Of Bounds", MB_ICONERROR);
  1762.                             SetWindowText(hResArcane, "100");
  1763.                             pResArcane = 100;
  1764.                             return 0;
  1765.                             break;
  1766.                         }
  1767.                     }
  1768.                 }
  1769.             case IDC_RES_LIGHTNING:
  1770.                 {
  1771.                     if (HIWORD(wParam) == EN_CHANGE)
  1772.                     {
  1773.                         char buffer[10];
  1774.                         GetWindowText(hResLightning, buffer, sizeof(buffer));
  1775.                         pResLightning = (float)atoi(buffer);
  1776.                         if (pResLightning < 0)
  1777.                         {
  1778.                             MessageBox(hWnd, "Please enter a non-negative lightning resist value!", "Lightning Resist Out Of Bounds", MB_ICONERROR);
  1779.                             SetWindowText(hResLightning, "100");
  1780.                             pResLightning = 100;
  1781.                             return 0;
  1782.                             break;
  1783.                         }
  1784.                     }
  1785.                 }
  1786.             case IDC_RES_MELEE:
  1787.                 {
  1788.                     if (HIWORD(wParam) == EN_CHANGE)
  1789.                     {
  1790.                         char buffer[10];
  1791.                         GetWindowText(hResMelee, buffer, sizeof(buffer));
  1792.                         pResMelee = (float)atoi(buffer);
  1793.                         if (pResMelee < 0)
  1794.                         {
  1795.                             MessageBox(hWnd, "Please enter a non-negative melee resist value!", "Melee Resist Out Of Bounds", MB_ICONERROR);
  1796.                             SetWindowText(hResMelee, "100");
  1797.                             pResMelee = 100;
  1798.                             return 0;
  1799.                             break;
  1800.                         }
  1801.                     }
  1802.                 }
  1803.             case IDC_RES_RANGE:
  1804.                 {
  1805.                     if (HIWORD(wParam) == EN_CHANGE)
  1806.                     {
  1807.                         char buffer[10];
  1808.                         GetWindowText(hResRange, buffer, sizeof(buffer));
  1809.                         pResRange = (float)atoi(buffer);
  1810.                         if (pResRange < 0)
  1811.                         {
  1812.                             MessageBox(hWnd, "Please enter a non-negative range resist value!", "Range Resist Out Of Bounds", MB_ICONERROR);
  1813.                             SetWindowText(hResRange, "100");
  1814.                             pResRange = 100;
  1815.                             return 0;
  1816.                             break;
  1817.                         }
  1818.                     }
  1819.                 }
  1820.             case IDC_ITEM1_RES_ALL:
  1821.                 {
  1822.                     if (HIWORD(wParam) == EN_CHANGE)
  1823.                     {
  1824.                         char buffer[10];
  1825.                         GetWindowText(hItem1ResAll, buffer, sizeof(buffer));
  1826.                         item1ResAll = (float)atoi(buffer);
  1827.                         if (item1ResAll < 0)
  1828.                         {
  1829.                             MessageBox(hWnd, "Please enter a non-negative resist all value!", "Resist All Out Of Bounds", MB_ICONERROR);
  1830.                             SetWindowText(hItem1ResAll, "100");
  1831.                             item1ResAll = 100;
  1832.                             return 0;
  1833.                             break;
  1834.                         }
  1835.                     }
  1836.                 }
  1837.             case IDC_ITEM1_RES_FIRE:
  1838.                 {
  1839.                     if (HIWORD(wParam) == EN_CHANGE)
  1840.                     {
  1841.                         char buffer[10];
  1842.                         GetWindowText(hItem1ResFire, buffer, sizeof(buffer));
  1843.                         item1ResFire = (float)atoi(buffer);
  1844.                         if (item1ResFire < 0)
  1845.                         {
  1846.                             MessageBox(hWnd, "Please enter a non-negative fire resistance value!", "Fire Resist Out Of Bounds", MB_ICONERROR);
  1847.                             SetWindowText(hItem1ResFire, "100");
  1848.                             item1ResFire = 100;
  1849.                             return 0;
  1850.                             break;
  1851.                         }
  1852.                     }
  1853.                 }
  1854.             case IDC_ITEM1_RES_COLD:
  1855.                 {
  1856.                     if (HIWORD(wParam) == EN_CHANGE)
  1857.                     {
  1858.                         char buffer[10];
  1859.                         GetWindowText(hItem1ResCold, buffer, sizeof(buffer));
  1860.                         item1ResCold = (float)atoi(buffer);
  1861.                         if (item1ResCold < 0)
  1862.                         {
  1863.                             MessageBox(hWnd, "Please enter a non-negative cold resistance value!", "Cold Resist Out Of Bounds", MB_ICONERROR);
  1864.                             SetWindowText(hItem1ResCold, "100");
  1865.                             item1ResCold = 100;
  1866.                             return 0;
  1867.                             break;
  1868.                         }
  1869.                     }
  1870.                 }
  1871.             case IDC_ITEM1_RES_POISON:
  1872.                 {
  1873.                     if (HIWORD(wParam) == EN_CHANGE)
  1874.                     {
  1875.                         char buffer[10];
  1876.                         GetWindowText(hItem1ResPoison, buffer, sizeof(buffer));
  1877.                         item1ResPoison = (float)atoi(buffer);
  1878.                         if (item1ResPoison < 0)
  1879.                         {
  1880.                             MessageBox(hWnd, "Please enter a non-negative poison resistance value!", "Poison Resist Out Of Bounds", MB_ICONERROR);
  1881.                             SetWindowText(hItem1ResPoison, "100");
  1882.                             item1ResPoison = 100;
  1883.                             return 0;
  1884.                             break;
  1885.                         }
  1886.                     }
  1887.                 }
  1888.             case IDC_ITEM1_RES_ARCANE:
  1889.                 {
  1890.                     if (HIWORD(wParam) == EN_CHANGE)
  1891.                     {
  1892.                         char buffer[10];
  1893.                         GetWindowText(hItem1ResArcane, buffer, sizeof(buffer));
  1894.                         item1ResArcane = (float)atoi(buffer);
  1895.                         if (item1ResArcane < 0)
  1896.                         {
  1897.                             MessageBox(hWnd, "Please enter a non-negative arcane resistance value!", "Arcane Resist Out Of Bounds", MB_ICONERROR);
  1898.                             SetWindowText(hItem1ResArcane, "100");
  1899.                             item1ResArcane = 100;
  1900.                             return 0;
  1901.                             break;
  1902.                         }
  1903.                     }
  1904.                 }
  1905.             case IDC_ITEM1_RES_LIGHTNING:
  1906.                 {
  1907.                     if (HIWORD(wParam) == EN_CHANGE)
  1908.                     {
  1909.                         char buffer[10];
  1910.                         GetWindowText(hItem1ResLightning, buffer, sizeof(buffer));
  1911.                         item1ResLightning = (float)atoi(buffer);
  1912.                         if (item1ResLightning < 0)
  1913.                         {
  1914.                             MessageBox(hWnd, "Please enter a non-negative lightning resistance value!", "Lightning Resist Out Of Bounds", MB_ICONERROR);
  1915.                             SetWindowText(hItem1ResLightning, "100");
  1916.                             item1ResLightning = 100;
  1917.                             return 0;
  1918.                             break;
  1919.                         }
  1920.                     }
  1921.                 }
  1922.             case IDC_ITEM1_RES_MELEE:
  1923.                 {
  1924.                     if (HIWORD(wParam) == EN_CHANGE)
  1925.                     {
  1926.                         char buffer[10];
  1927.                         GetWindowText(hItem1ResMelee, buffer, sizeof(buffer));
  1928.                         item1ResMelee = (float)atoi(buffer);
  1929.                         if (item1ResMelee < 0)
  1930.                         {
  1931.                             MessageBox(hWnd, "Please enter a non-negative melee resistance value!", "Melee Resist Out Of Bounds", MB_ICONERROR);
  1932.                             SetWindowText(hItem1ResMelee, "100");
  1933.                             item1ResMelee = 100;
  1934.                             return 0;
  1935.                             break;
  1936.                         }
  1937.                     }
  1938.                 }
  1939.             case IDC_ITEM1_RES_RANGE:
  1940.                 {
  1941.                     if (HIWORD(wParam) == EN_CHANGE)
  1942.                     {
  1943.                         char buffer[10];
  1944.                         GetWindowText(hItem1ResRange, buffer, sizeof(buffer));
  1945.                         item1ResRange = (float)atoi(buffer);
  1946.                         if (item1ResRange < 0)
  1947.                         {
  1948.                             MessageBox(hWnd, "Please enter a non-negative range resistance value!", "Range Resist Out Of Bounds", MB_ICONERROR);
  1949.                             SetWindowText(hItem1ResRange, "100");
  1950.                             item1ResRange = 100;
  1951.                             return 0;
  1952.                             break;
  1953.                         }
  1954.                     }
  1955.                 }
  1956.             case IDC_ITEM1_STAT_ARMOR:
  1957.                 {
  1958.                     if (HIWORD(wParam) == EN_CHANGE)
  1959.                     {
  1960.                         char buffer[10];
  1961.                         GetWindowText(hItem1StatArmor, buffer, sizeof(buffer));
  1962.                         item1StatArmor = (float)atoi(buffer);
  1963.                         if (item1StatArmor < 0)
  1964.                         {
  1965.                             MessageBox(hWnd, "Please enter a non-negative armor value!", "Armor Out Of Bounds", MB_ICONERROR);
  1966.                             SetWindowText(hItem1StatArmor, "100");
  1967.                             item1StatArmor = 100;
  1968.                         }
  1969.                     }
  1970.                 }
  1971.             case IDC_ITEM1_STAT_STR:
  1972.                 {
  1973.                     if (HIWORD(wParam) == EN_CHANGE)
  1974.                     {
  1975.                         char buffer[10];
  1976.                         GetWindowText(hItem1StatStr, buffer, sizeof(buffer));
  1977.                         item1StatStr = (float)atoi(buffer);
  1978.                         if(item1StatStr < 0)
  1979.                         {
  1980.                             MessageBox(hWnd, "Please enter a non-negative strength value!", "Strength Out Of Bounds", MB_ICONERROR);
  1981.                             SetWindowText(hItem1StatStr, "100");
  1982.                             item1StatStr = 100;
  1983.                         }
  1984.                     }
  1985.                 }
  1986.             case IDC_ITEM1_STAT_DEX:
  1987.                 {
  1988.                     if (HIWORD(wParam) == EN_CHANGE)
  1989.                     {
  1990.                         char buffer[10];
  1991.                         GetWindowText(hItem1StatDex, buffer, sizeof(buffer));
  1992.                         item1StatDex = (float)atoi(buffer);
  1993.                         if(item1StatDex < 0)
  1994.                         {
  1995.                             MessageBox(hWnd, "Please enter a non-negative dexterity value!", "Dexterity Out Of Bounds", MB_ICONERROR);
  1996.                             SetWindowText(hItem1StatDex, "100");
  1997.                             item1StatDex = 100;
  1998.                         }
  1999.                     }
  2000.                 }
  2001.             case IDC_ITEM1_STAT_VIT:
  2002.                 {
  2003.                     if (HIWORD(wParam) == EN_CHANGE)
  2004.                     {
  2005.                         char buffer[10];
  2006.                         GetWindowText(hItem1StatVit, buffer, sizeof(buffer));
  2007.                         item1StatVit = (float)atoi(buffer);
  2008.                         if(item1StatVit < 0)
  2009.                         {
  2010.                             MessageBox(hWnd, "Please enter a non-negative vitality value!", "Vitality Out Of Bounds", MB_ICONERROR);
  2011.                             SetWindowText(hItem1StatVit, "100");
  2012.                             item1StatVit = 100;
  2013.                         }
  2014.                     }
  2015.                 }
  2016.             case IDC_ITEM1_STAT_INT:
  2017.                 {
  2018.                     if (HIWORD(wParam) == EN_CHANGE)
  2019.                     {
  2020.                         char buffer[10];
  2021.                         GetWindowText(hItem1StatInt, buffer, sizeof(buffer));
  2022.                         item1StatInt = (float)atoi(buffer);
  2023.                         if(item1StatInt < 0)
  2024.                         {
  2025.                             MessageBox(hWnd, "Please enter a non-negative strength value!", "Strength Out Of Bounds", MB_ICONERROR);
  2026.                             SetWindowText(hItem1StatInt, "100");
  2027.                             item1StatInt = 100;
  2028.                         }
  2029.                     }
  2030.                 }
  2031.  
  2032.             case IDC_ITEM2_RES_ALL:
  2033.                 {
  2034.                     if (HIWORD(wParam) == EN_CHANGE)
  2035.                     {
  2036.                         char buffer[10];
  2037.                         GetWindowText(hItem2ResAll, buffer, sizeof(buffer));
  2038.                         item2ResAll = (float)atoi(buffer);
  2039.                         if (item2ResAll < 0)
  2040.                         {
  2041.                             MessageBox(hWnd, "Please enter a non-negative resist all value!", "Resist All Out Of Bounds", MB_ICONERROR);
  2042.                             SetWindowText(hItem2ResAll, "100");
  2043.                             item2ResAll = 100;
  2044.                             return 0;
  2045.                             break;
  2046.                         }
  2047.                     }
  2048.                 }
  2049.             case IDC_ITEM2_RES_FIRE:
  2050.                 {
  2051.                     if (HIWORD(wParam) == EN_CHANGE)
  2052.                     {
  2053.                         char buffer[10];
  2054.                         GetWindowText(hItem2ResFire, buffer, sizeof(buffer));
  2055.                         item2ResFire = (float)atoi(buffer);
  2056.                         if (item2ResFire < 0)
  2057.                         {
  2058.                             MessageBox(hWnd, "Please enter a non-negative fire resistance value!", "Fire Resist Out Of Bounds", MB_ICONERROR);
  2059.                             SetWindowText(hItem2ResFire, "100");
  2060.                             item2ResFire = 100;
  2061.                             return 0;
  2062.                             break;
  2063.                         }
  2064.                     }
  2065.                 }
  2066.             case IDC_ITEM2_RES_COLD:
  2067.                 {
  2068.                     if (HIWORD(wParam) == EN_CHANGE)
  2069.                     {
  2070.                         char buffer[10];
  2071.                         GetWindowText(hItem2ResCold, buffer, sizeof(buffer));
  2072.                         item2ResCold = (float)atoi(buffer);
  2073.                         if (item2ResCold < 0)
  2074.                         {
  2075.                             MessageBox(hWnd, "Please enter a non-negative cold resistance value!", "Cold Resist Out Of Bounds", MB_ICONERROR);
  2076.                             SetWindowText(hItem2ResCold, "100");
  2077.                             item2ResCold = 100;
  2078.                             return 0;
  2079.                             break;
  2080.                         }
  2081.                     }
  2082.                 }
  2083.             case IDC_ITEM2_RES_POISON:
  2084.                 {
  2085.                     if (HIWORD(wParam) == EN_CHANGE)
  2086.                     {
  2087.                         char buffer[10];
  2088.                         GetWindowText(hItem2ResPoison, buffer, sizeof(buffer));
  2089.                         item2ResPoison = (float)atoi(buffer);
  2090.                         if (item2ResPoison < 0)
  2091.                         {
  2092.                             MessageBox(hWnd, "Please enter a non-negative poison resistance value!", "Poison Resist Out Of Bounds", MB_ICONERROR);
  2093.                             SetWindowText(hItem2ResPoison, "100");
  2094.                             item2ResPoison = 100;
  2095.                             return 0;
  2096.                             break;
  2097.                         }
  2098.                     }
  2099.                 }
  2100.             case IDC_ITEM2_RES_ARCANE:
  2101.                 {
  2102.                     if (HIWORD(wParam) == EN_CHANGE)
  2103.                     {
  2104.                         char buffer[10];
  2105.                         GetWindowText(hItem2ResArcane, buffer, sizeof(buffer));
  2106.                         item2ResArcane = (float)atoi(buffer);
  2107.                         if (item2ResArcane < 0)
  2108.                         {
  2109.                             MessageBox(hWnd, "Please enter a non-negative arcane resistance value!", "Arcane Resist Out Of Bounds", MB_ICONERROR);
  2110.                             SetWindowText(hItem2ResArcane, "100");
  2111.                             item2ResArcane = 100;
  2112.                             return 0;
  2113.                             break;
  2114.                         }
  2115.                     }
  2116.                 }
  2117.             case IDC_ITEM2_RES_LIGHTNING:
  2118.                 {
  2119.                     if (HIWORD(wParam) == EN_CHANGE)
  2120.                     {
  2121.                         char buffer[10];
  2122.                         GetWindowText(hItem2ResLightning, buffer, sizeof(buffer));
  2123.                         item2ResLightning = (float)atoi(buffer);
  2124.                         if (item2ResLightning < 0)
  2125.                         {
  2126.                             MessageBox(hWnd, "Please enter a non-negative lightning resistance value!", "Lightning Resist Out Of Bounds", MB_ICONERROR);
  2127.                             SetWindowText(hItem2ResLightning, "100");
  2128.                             item2ResLightning = 100;
  2129.                             return 0;
  2130.                             break;
  2131.                         }
  2132.                     }
  2133.                 }
  2134.             case IDC_ITEM2_RES_MELEE:
  2135.                 {
  2136.                     if (HIWORD(wParam) == EN_CHANGE)
  2137.                     {
  2138.                         char buffer[10];
  2139.                         GetWindowText(hItem2ResMelee, buffer, sizeof(buffer));
  2140.                         item2ResMelee = (float)atoi(buffer);
  2141.                         if (item2ResMelee < 0)
  2142.                         {
  2143.                             MessageBox(hWnd, "Please enter a non-negative melee resistance value!", "Melee Resist Out Of Bounds", MB_ICONERROR);
  2144.                             SetWindowText(hItem2ResMelee, "100");
  2145.                             item2ResMelee = 100;
  2146.                             return 0;
  2147.                             break;
  2148.                         }
  2149.                     }
  2150.                 }
  2151.             case IDC_ITEM2_RES_RANGE:
  2152.                 {
  2153.                     if (HIWORD(wParam) == EN_CHANGE)
  2154.                     {
  2155.                         char buffer[10];
  2156.                         GetWindowText(hItem2ResRange, buffer, sizeof(buffer));
  2157.                         item2ResRange = (float)atoi(buffer);
  2158.                         if (item2ResRange < 0)
  2159.                         {
  2160.                             MessageBox(hWnd, "Please enter a non-negative range resistance value!", "Range Resist Out Of Bounds", MB_ICONERROR);
  2161.                             SetWindowText(hItem2ResRange, "100");
  2162.                             item2ResRange = 100;
  2163.                             return 0;
  2164.                             break;
  2165.                         }
  2166.                     }
  2167.                 }
  2168.             case IDC_ITEM2_STAT_ARMOR:
  2169.                 {
  2170.                     if (HIWORD(wParam) == EN_CHANGE)
  2171.                     {
  2172.                         char buffer[10];
  2173.                         GetWindowText(hItem2StatArmor, buffer, sizeof(buffer));
  2174.                         item2StatArmor = (float)atoi(buffer);
  2175.                         if (item2StatArmor < 0)
  2176.                         {
  2177.                             MessageBox(hWnd, "Please enter a non-negative armor value!", "Armor Out Of Bounds", MB_ICONERROR);
  2178.                             SetWindowText(hItem2StatArmor, "100");
  2179.                             item2StatArmor = 100;
  2180.                         }
  2181.                     }
  2182.                 }
  2183.             case IDC_ITEM2_STAT_STR:
  2184.                 {
  2185.                     if (HIWORD(wParam) == EN_CHANGE)
  2186.                     {
  2187.                         char buffer[10];
  2188.                         GetWindowText(hItem2StatStr, buffer, sizeof(buffer));
  2189.                         item2StatStr = (float)atoi(buffer);
  2190.                         if(item2StatStr < 0)
  2191.                         {
  2192.                             MessageBox(hWnd, "Please enter a non-negative strength value!", "Strength Out Of Bounds", MB_ICONERROR);
  2193.                             SetWindowText(hItem2StatStr, "100");
  2194.                             item2StatStr = 100;
  2195.                         }
  2196.                     }
  2197.                 }
  2198.             case IDC_ITEM2_STAT_DEX:
  2199.                 {
  2200.                     if (HIWORD(wParam) == EN_CHANGE)
  2201.                     {
  2202.                         char buffer[10];
  2203.                         GetWindowText(hItem2StatDex, buffer, sizeof(buffer));
  2204.                         item2StatDex = (float)atoi(buffer);
  2205.                         if(item2StatDex < 0)
  2206.                         {
  2207.                             MessageBox(hWnd, "Please enter a non-negative dexterity value!", "Dexterity Out Of Bounds", MB_ICONERROR);
  2208.                             SetWindowText(hItem2StatDex, "100");
  2209.                             item2StatDex = 100;
  2210.                         }
  2211.                     }
  2212.                 }
  2213.             case IDC_ITEM2_STAT_VIT:
  2214.                 {
  2215.                     if (HIWORD(wParam) == EN_CHANGE)
  2216.                     {
  2217.                         char buffer[10];
  2218.                         GetWindowText(hItem2StatVit, buffer, sizeof(buffer));
  2219.                         item2StatVit = (float)atoi(buffer);
  2220.                         if(item2StatVit < 0)
  2221.                         {
  2222.                             MessageBox(hWnd, "Please enter a non-negative vitality value!", "Vitality Out Of Bounds", MB_ICONERROR);
  2223.                             SetWindowText(hItem2StatVit, "100");
  2224.                             item2StatVit = 100;
  2225.                         }
  2226.                     }
  2227.                 }
  2228.             case IDC_ITEM2_STAT_INT:
  2229.                 {
  2230.                     if (HIWORD(wParam) == EN_CHANGE)
  2231.                     {
  2232.                         char buffer[10];
  2233.                         GetWindowText(hItem2StatInt, buffer, sizeof(buffer));
  2234.                         item2StatInt = (float)atoi(buffer);
  2235.                         if(item2StatInt < 0)
  2236.                         {
  2237.                             MessageBox(hWnd, "Please enter a non-negative strength value!", "Strength Out Of Bounds", MB_ICONERROR);
  2238.                             SetWindowText(hItem2StatInt, "100");
  2239.                             item2StatInt = 100;
  2240.                         }
  2241.                     }
  2242.                 }
  2243.             }
  2244.         }
  2245.         break;
  2246.  
  2247.     case WM_DESTROY:
  2248.         {
  2249.             PostQuitMessage(0);
  2250.         }
  2251.         return 0;
  2252.         break;
  2253.     }
  2254.    
  2255.     char buffer[10];
  2256.     pEffHP1 = pHP * (1 + pArmor / (50 * mLevel + pArmor)) * (1 + pResAll / (5 * mLevel + pResAll)) * (1 + pResFire / (5 * mLevel + pResFire)) * (1 + pResCold / (5 * mLevel + pResCold)) * (1 + pResPoison / (5 * mLevel + pResPoison)) * (1 + pResArcane / (5 * mLevel + pResArcane)) * (1 + pResMelee / (5 * mLevel + pResMelee)) * (1 + pResRange / (5 * mLevel + pResRange));
  2257.     _itoa_s(Round(pEffHP1), buffer, 10);
  2258.     SetWindowText(hStatEffectiveHP1, buffer);
  2259.  
  2260.     pEffHP2 = pHP * (1 + (item1StatArmor + item1StatStr) / (50 * mLevel + (item1StatArmor + item1StatStr))) * (1 + (item1ResAll + item1StatInt / 10) / (5 * mLevel + (item1ResAll + item1StatInt / 10))) * (1 + (item1ResFire + item1StatInt / 10) / (5 * mLevel + (item1ResFire + item1StatInt / 10))) * (1 + (item1ResCold + item1StatInt / 10) / (5 * mLevel + (item1ResCold + item1StatInt / 10))) * (1 + (item1ResPoison + item1StatInt / 10) / (5 * mLevel + (item1ResPoison + item1StatInt / 10))) * (1 + (item1ResArcane + item1StatInt / 10) / (5 * mLevel + (item1ResArcane + item1StatInt / 10)) * (1 + (item1ResMelee + item1StatInt / 10) / (5 * mLevel + (item1ResMelee + item1StatInt / 10)))) * (1 + (item1ResRange + item1StatInt / 10) / (5 * mLevel + (item1ResRange + item1StatInt / 10)));
  2261.     pEffHP3 = pHP * (1 + (item2StatArmor + item2StatStr) / (50 * mLevel + (item2StatArmor + item2StatStr))) * (1 + (item2ResAll + item2StatInt / 10) / (5 * mLevel + (item2ResAll + item2StatInt / 10))) * (1 + (item2ResFire + item2StatInt / 10) / (5 * mLevel + (item2ResFire + item2StatInt / 10))) * (1 + (item2ResCold + item2StatInt / 10) / (5 * mLevel + (item2ResCold + item2StatInt / 10))) * (1 + (item2ResPoison + item2StatInt / 10) / (5 * mLevel + (item2ResPoison + item2StatInt / 10))) * (1 + (item2ResArcane + item2StatInt / 10) / (5 * mLevel + (item2ResArcane + item2StatInt / 10)) * (1 + (item2ResMelee + item2StatInt / 10) / (5 * mLevel + (item2ResMelee + item2StatInt / 10)))) * (1 + (item2ResRange + item2StatInt / 10) / (5 * mLevel + (item2ResRange + item2StatInt / 10)));
  2262.     CString str;
  2263.     _itoa_s(Round(pEffHP2 - pEffHP3), buffer, 10);
  2264.     if (pEffHP2 > pEffHP3)
  2265.         str.Format("Comparative Change In Effective Health: +%f", pEffHP2 - pEffHP3);
  2266.     else
  2267.         str.Format("Comparative Change In Effective Health: -%f", pEffHP3 - pEffHP2);
  2268.     SetWindowText(hItemCompareLbl, str);
  2269.  
  2270.     return DefWindowProc(hWnd,msg,wParam,lParam);
  2271. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement