mirror of
https://gitlab.com/hashborgir/d2tweaks-rnd2k.git
synced 2025-05-02 09:05:33 +00:00
Stats display refactor using ini file done.
This commit is contained in:
parent
f8349e6ba1
commit
7fd617abd7
Binary file not shown.
@ -1,3 +1,11 @@
|
|||||||
loot_filter.cpp
|
autosort_client.cpp
|
||||||
loot_filter_settings_toggle_menu.cpp
|
D:\VSCode\d2tweaks-rnd2k\src\d2tweaks\client\modules\autosort\autosort_client.cpp(197,15): warning C4018: '<': signed/unsigned mismatch
|
||||||
|
D:\VSCode\d2tweaks-rnd2k\src\d2tweaks\client\modules\autosort\autosort_client.cpp(197,66): warning C4018: '<=': signed/unsigned mismatch
|
||||||
|
D:\VSCode\d2tweaks-rnd2k\src\d2tweaks\client\modules\autosort\autosort_client.cpp(252,41): warning C4244: '=': conversion from 'double' to 'int32_t', possible loss of data
|
||||||
|
D:\VSCode\d2tweaks-rnd2k\src\d2tweaks\client\modules\autosort\autosort_client.cpp(255,43): warning C4244: '=': conversion from 'double' to 'int32_t', possible loss of data
|
||||||
|
D:\VSCode\d2tweaks-rnd2k\src\d2tweaks\client\modules\autosort\autosort_client.cpp(258,41): warning C4244: '=': conversion from 'double' to 'int32_t', possible loss of data
|
||||||
|
D:\VSCode\d2tweaks-rnd2k\src\d2tweaks\client\modules\autosort\autosort_client.cpp(261,43): warning C4244: '=': conversion from 'double' to 'int32_t', possible loss of data
|
||||||
|
D:\VSCode\d2tweaks-rnd2k\src\d2tweaks\client\modules\autosort\autosort_client.cpp(264,41): warning C4244: '=': conversion from 'double' to 'int32_t', possible loss of data
|
||||||
|
D:\VSCode\d2tweaks-rnd2k\src\d2tweaks\client\modules\autosort\autosort_client.cpp(282,41): warning C4244: '=': conversion from 'double' to 'int32_t', possible loss of data
|
||||||
|
D:\VSCode\d2tweaks-rnd2k\src\d2tweaks\client\modules\autosort\autosort_client.cpp(288,41): warning C4244: '=': conversion from 'double' to 'int32_t', possible loss of data
|
||||||
D2tweaks.vcxproj -> D:\Diablo II\MODS\ironman-dev\D2tweaks.dll
|
D2tweaks.vcxproj -> D:\Diablo II\MODS\ironman-dev\D2tweaks.dll
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
build/Debug/vendor/D2Template/D2Template.obj
vendored
BIN
build/Debug/vendor/D2Template/D2Template.obj
vendored
Binary file not shown.
BIN
build/Debug/vendor/DllNotify/DllNotify.obj
vendored
BIN
build/Debug/vendor/DllNotify/DllNotify.obj
vendored
Binary file not shown.
BIN
build/Debug/vendor/minhook/src/buffer.obj
vendored
BIN
build/Debug/vendor/minhook/src/buffer.obj
vendored
Binary file not shown.
BIN
build/Debug/vendor/minhook/src/hde/hde32.obj
vendored
BIN
build/Debug/vendor/minhook/src/hde/hde32.obj
vendored
Binary file not shown.
BIN
build/Debug/vendor/minhook/src/hde/hde64.obj
vendored
BIN
build/Debug/vendor/minhook/src/hde/hde64.obj
vendored
Binary file not shown.
BIN
build/Debug/vendor/minhook/src/hook.obj
vendored
BIN
build/Debug/vendor/minhook/src/hook.obj
vendored
Binary file not shown.
BIN
build/Debug/vendor/minhook/src/trampoline.obj
vendored
BIN
build/Debug/vendor/minhook/src/trampoline.obj
vendored
Binary file not shown.
@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
// If MFC is linked, we will use CStringArray for great convenience
|
// If MFC is linked, we will use CStringArray for great convenience
|
||||||
#ifdef __AFXWIN_H__
|
#ifdef __AFXWIN_H__
|
||||||
#include <afxtempl.h>
|
#include <afxtempl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Number bases
|
// Number bases
|
||||||
@ -59,7 +59,7 @@
|
|||||||
// string, the 2nd parameter is a 32-bit user defined data, this parameter can
|
// string, the 2nd parameter is a 32-bit user defined data, this parameter can
|
||||||
// be NULL. The parsing will terminate if this function returns zero. To use
|
// be NULL. The parsing will terminate if this function returns zero. To use
|
||||||
// the callback, function pointer needs to be passed to "CIni::ParseDNTString".
|
// the callback, function pointer needs to be passed to "CIni::ParseDNTString".
|
||||||
typedef BOOL (CALLBACK *SUBSTRPROC)(LPCTSTR, LPVOID);
|
typedef BOOL(CALLBACK* SUBSTRPROC)(LPCTSTR, LPVOID);
|
||||||
|
|
||||||
class CIni
|
class CIni
|
||||||
{
|
{
|
||||||
|
@ -13,25 +13,16 @@
|
|||||||
struct StatEntry {
|
struct StatEntry {
|
||||||
std::wstring stat_display_string;
|
std::wstring stat_display_string;
|
||||||
diablo2::ui_color_t colorStat, colorStatValue;
|
diablo2::ui_color_t colorStat, colorStatValue;
|
||||||
int x1, y1, x2, y2, is_item_stat, item_type_id, stat = 0; // x1,y1 stat_display_string | x2,y2 statValue
|
int x1, y1, x2, y2, is_item_stat, item_type_id, stat, op, param = 0; // x1,y1 stat_display_string | x2,y2 statValue
|
||||||
};
|
};
|
||||||
|
|
||||||
extern std::vector<StatEntry> globalStatsVector; // Declaration of the global variable
|
extern std::vector<StatEntry> globalStatsVector; // Declaration of the global variable
|
||||||
|
|
||||||
extern diablo2::structures::gfxdata g_gfxdata; // global gfxdata
|
extern diablo2::structures::gfxdata g_gfxdata; // global gfxdata
|
||||||
|
|
||||||
extern int randStat;
|
|
||||||
extern int randStatRangeLow;
|
|
||||||
extern int randStatRangeHigh;
|
|
||||||
extern int randStatBool;
|
|
||||||
|
|
||||||
|
|
||||||
extern bool m_stats_enabled;
|
extern bool m_stats_enabled;
|
||||||
|
|
||||||
extern bool m_help_enabled;
|
extern bool m_help_enabled;
|
||||||
|
|
||||||
extern bool m_cube_enabled;
|
extern bool m_cube_enabled;
|
||||||
|
|
||||||
extern bool m_stash_enabled;
|
extern bool m_stash_enabled;
|
||||||
|
|
||||||
namespace diablo2 {
|
namespace diablo2 {
|
||||||
|
@ -61,7 +61,6 @@ namespace d2_tweaks {
|
|||||||
//handle hovering over item and actual click
|
//handle hovering over item and actual click
|
||||||
static void __fastcall handle_dropped_items(diablo2::structures::unit* unit, void* edx);
|
static void __fastcall handle_dropped_items(diablo2::structures::unit* unit, void* edx);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@ namespace d2_tweaks {
|
|||||||
ui::controls::button* m_btn_toggle_help;
|
ui::controls::button* m_btn_toggle_help;
|
||||||
ui::controls::button* m_btn_toggle_cube;
|
ui::controls::button* m_btn_toggle_cube;
|
||||||
ui::controls::button* m_btn_toggle_stash;
|
ui::controls::button* m_btn_toggle_stash;
|
||||||
|
|
||||||
menu* m_filter_settings_menu;
|
menu* m_filter_settings_menu;
|
||||||
bool m_show;
|
bool m_show;
|
||||||
public:
|
public:
|
||||||
|
@ -226,7 +226,6 @@ namespace d2_tweaks {
|
|||||||
packet_header() : d2_packet_type(0xBB), message_type(0) {}
|
packet_header() : d2_packet_type(0xBB), message_type(0) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
struct d2_entity_action_cs : packet_header {
|
struct d2_entity_action_cs : packet_header {
|
||||||
uint32_t action;
|
uint32_t action;
|
||||||
uint32_t entity_id;
|
uint32_t entity_id;
|
||||||
@ -274,7 +273,6 @@ namespace d2_tweaks {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
struct inventory_sort_sc : packet_header {
|
struct inventory_sort_sc : packet_header {
|
||||||
uint8_t page;
|
uint8_t page;
|
||||||
uint8_t tx;
|
uint8_t tx;
|
||||||
@ -300,7 +298,6 @@ namespace d2_tweaks {
|
|||||||
damage_type_t damage_type;
|
damage_type_t damage_type;
|
||||||
uint32_t damage;
|
uint32_t damage;
|
||||||
|
|
||||||
|
|
||||||
uint32_t currentHp; // New field for current hit points
|
uint32_t currentHp; // New field for current hit points
|
||||||
uint32_t maxHp; // New field for maximum hit points
|
uint32_t maxHp; // New field for maximum hit points
|
||||||
|
|
||||||
|
@ -115,7 +115,6 @@ namespace d2_tweaks {
|
|||||||
virtual void middle_mouse(int32_t offsetX, int32_t offsetY, bool up, bool& block) {}
|
virtual void middle_mouse(int32_t offsetX, int32_t offsetY, bool up, bool& block) {}
|
||||||
virtual void mouse_wheel(int32_t offsetX, int32_t offsetY, bool up, bool& block) {}
|
virtual void mouse_wheel(int32_t offsetX, int32_t offsetY, bool up, bool& block) {}
|
||||||
|
|
||||||
|
|
||||||
virtual void key_event(int32_t offsetX, int32_t offsetY, uint32_t key, bool up, bool& block) = 0;
|
virtual void key_event(int32_t offsetX, int32_t offsetY, uint32_t key, bool up, bool& block) = 0;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
namespace d2_tweaks {
|
namespace d2_tweaks {
|
||||||
namespace ui {
|
namespace ui {
|
||||||
namespace controls {
|
namespace controls {
|
||||||
|
|
||||||
class label : public control {
|
class label : public control {
|
||||||
std::wstring m_text;
|
std::wstring m_text;
|
||||||
bool m_text_owned;
|
bool m_text_owned;
|
||||||
@ -31,7 +30,6 @@ namespace d2_tweaks {
|
|||||||
return m_text;
|
return m_text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
diablo2::ui_color_t get_color() const {
|
diablo2::ui_color_t get_color() const {
|
||||||
return m_color;
|
return m_color;
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,6 @@ namespace d2_tweaks {
|
|||||||
bool process_middle_mouse(bool up);
|
bool process_middle_mouse(bool up);
|
||||||
bool process_mouse_wheel(bool up);
|
bool process_mouse_wheel(bool up);
|
||||||
|
|
||||||
|
|
||||||
bool process_key_event(uint32_t key, bool up);
|
bool process_key_event(uint32_t key, bool up);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,6 @@ namespace diablo2 {
|
|||||||
static bool get_ui_window_state(ui_window_t window);
|
static bool get_ui_window_state(ui_window_t window);
|
||||||
static void* get_buysellbtn();
|
static void* get_buysellbtn();
|
||||||
|
|
||||||
|
|
||||||
static void play_sound(uint32_t soundId, structures::unit* u, uint32_t ticks, BOOL prePick, uint32_t cache);
|
static void play_sound(uint32_t soundId, structures::unit* u, uint32_t ticks, BOOL prePick, uint32_t cache);
|
||||||
|
|
||||||
static structures::unit* get_unit_by_guid(int32_t type, int32_t guid);
|
static structures::unit* get_unit_by_guid(int32_t type, int32_t guid);
|
||||||
@ -90,6 +89,5 @@ namespace diablo2 {
|
|||||||
static int32_t send_to_server_9(BYTE type, DWORD num, DWORD unk1);
|
static int32_t send_to_server_9(BYTE type, DWORD num, DWORD unk1);
|
||||||
|
|
||||||
static void set_ui_toggle(int nToggle, int nUIState, BOOL bToggle);
|
static void set_ui_toggle(int nToggle, int nUIState, BOOL bToggle);
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
@ -92,6 +92,67 @@ namespace diablo2 {
|
|||||||
|
|
||||||
struct items_line;
|
struct items_line;
|
||||||
struct item_types_line;
|
struct item_types_line;
|
||||||
|
|
||||||
|
struct D2OpStatDataStrc
|
||||||
|
{
|
||||||
|
uint16_t nOpBase; //0x00
|
||||||
|
uint16_t nStat; //0x02
|
||||||
|
uint8_t nOp; //0x04
|
||||||
|
uint8_t nOpParam; //0x05
|
||||||
|
};
|
||||||
|
|
||||||
|
struct D2ItemStatCostTxt
|
||||||
|
{
|
||||||
|
uint16_t wStatId; //0x00
|
||||||
|
uint16_t pad0x02; //0x02
|
||||||
|
uint32_t dwItemStatFlags; //0x04
|
||||||
|
uint8_t nSendBits; //0x08
|
||||||
|
uint8_t nSendParamBits; //0x09
|
||||||
|
uint8_t nCsvBits; //0x0A
|
||||||
|
uint8_t nCsvParam; //0x0B
|
||||||
|
uint32_t dwDivide; //0x0C
|
||||||
|
uint32_t dwMultiply; //0x10
|
||||||
|
uint32_t dwAdd; //0x14
|
||||||
|
uint8_t nValShift; //0x18
|
||||||
|
uint8_t nSaveBits; //0x19
|
||||||
|
uint8_t n09SaveBits; //0x1A
|
||||||
|
uint8_t pad0x1B; //0x1B
|
||||||
|
uint32_t dwSaveAdd; //0x1C
|
||||||
|
uint32_t dw09SaveAdd; //0x20
|
||||||
|
uint32_t dwSaveParamBits; //0x24
|
||||||
|
uint32_t dw09SaveParamBits; //0x28
|
||||||
|
int32_t dwMinAccr; //0x2C
|
||||||
|
uint8_t nEncode; //0x30
|
||||||
|
uint8_t pad0x31; //0x31
|
||||||
|
uint16_t wMaxStat; //0x32
|
||||||
|
int16_t nDescPriority; //0x34
|
||||||
|
uint8_t nDescFunc; //0x36
|
||||||
|
uint8_t nDescVal; //0x37
|
||||||
|
uint16_t wDescStrPos; //0x38
|
||||||
|
uint16_t wDescStrNeg; //0x3A
|
||||||
|
uint16_t wDescStr2; //0x3C
|
||||||
|
uint16_t wDescGrp; //0x3E
|
||||||
|
uint8_t nDescGrpFunc; //0x40
|
||||||
|
uint8_t nDescGrpVal; //0x41
|
||||||
|
uint16_t wDescGrpStrPos; //0x42
|
||||||
|
uint16_t wDescGrpStrNeg; //0x44
|
||||||
|
uint16_t wDescGrpStr2; //0x46
|
||||||
|
int16_t wItemEvent[2]; //0x48
|
||||||
|
uint16_t wItemEventFunc[2]; //0x4C
|
||||||
|
uint8_t nKeepZero; //0x50
|
||||||
|
uint8_t bIsBaseOfOtherStatOp; //0x51
|
||||||
|
uint8_t bHasOpStatData; //0x52
|
||||||
|
uint8_t bHasOpApplyingToItem; //0x53
|
||||||
|
uint8_t nOp; //0x54
|
||||||
|
uint8_t nOpParam; //0x55
|
||||||
|
uint16_t wOpBase; //0x56
|
||||||
|
uint16_t wOpStat[3]; //0x58
|
||||||
|
uint16_t unk0x5E[64]; //0x5E - also related to op stats (see DATATBLS_LoadItemStatCostTxt)
|
||||||
|
D2OpStatDataStrc pOpStatData[16]; //0xDE
|
||||||
|
uint16_t pad0x13E; //0x13E
|
||||||
|
uint32_t dwStuff; //0x140
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enum unit_stats_t {
|
enum unit_stats_t {
|
||||||
@ -397,7 +458,6 @@ namespace diablo2 {
|
|||||||
UNIT_STAT_ITEM_TOHIT_UNDEAD_BYTIME = 0x12B,
|
UNIT_STAT_ITEM_TOHIT_UNDEAD_BYTIME = 0x12B,
|
||||||
UNIT_STAT_ITEM_CRUSHINGBLOW_BYTIME = 0x12C,
|
UNIT_STAT_ITEM_CRUSHINGBLOW_BYTIME = 0x12C,
|
||||||
|
|
||||||
|
|
||||||
// unit_stats_t from Ironman mod
|
// unit_stats_t from Ironman mod
|
||||||
|
|
||||||
UNIT_STAT_strength = 0,
|
UNIT_STAT_strength = 0,
|
||||||
@ -911,12 +971,8 @@ namespace diablo2 {
|
|||||||
UNIT_STAT_runebag_RunesC = 508,
|
UNIT_STAT_runebag_RunesC = 508,
|
||||||
UNIT_STAT_UNUSED_83 = 509,
|
UNIT_STAT_UNUSED_83 = 509,
|
||||||
UNIT_STAT_item_aura_display = 510,
|
UNIT_STAT_item_aura_display = 510,
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class d2_common {
|
class d2_common {
|
||||||
public:
|
public:
|
||||||
static char* get_base();
|
static char* get_base();
|
||||||
@ -983,5 +1039,10 @@ namespace diablo2 {
|
|||||||
static void diablo2::d2_common::add_property(structures::unit* item, D2PropertyStrc* pProperty, int nUnused);
|
static void diablo2::d2_common::add_property(structures::unit* item, D2PropertyStrc* pProperty, int nUnused);
|
||||||
static void diablo2::d2_common::ITEMS_SetItemFlag(structures::unit* item, uint32_t dwFlag, BOOL bSet);
|
static void diablo2::d2_common::ITEMS_SetItemFlag(structures::unit* item, uint32_t dwFlag, BOOL bSet);
|
||||||
|
|
||||||
|
//D2Common.0x6FDA42B0
|
||||||
|
// D2ItemStatCostTxt* __fastcall ITEMS_GetItemStatCostTxtRecord(int nStatId)
|
||||||
|
// Write a function signature for this function
|
||||||
|
static structures::D2ItemStatCostTxt* get_item_stat_cost_record(int nStatId);
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -47,6 +47,5 @@ namespace diablo2 {
|
|||||||
|
|
||||||
static void update_inventory_items(structures::game* game, structures::unit* player);
|
static void update_inventory_items(structures::game* game, structures::unit* player);
|
||||||
static uint32_t __fastcall diablo2::d2_game::transmogrify(diablo2::structures::game* game, diablo2::structures::unit* player);
|
static uint32_t __fastcall diablo2::d2_game::transmogrify(diablo2::structures::game* game, diablo2::structures::unit* player);
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,5 @@ namespace diablo2 {
|
|||||||
static int32_t get_resolution_mode();
|
static int32_t get_resolution_mode();
|
||||||
static void draw_image(structures::gfxdata* data, uint32_t x, uint32_t y, int32_t gamma, int32_t drawType, void* palette);
|
static void draw_image(structures::gfxdata* data, uint32_t x, uint32_t y, int32_t gamma, int32_t drawType, void* palette);
|
||||||
static void draw_filled_rect(int left, int top, int right, int bottom, DWORD color, int transTbl);
|
static void draw_filled_rect(int left, int top, int right, int bottom, DWORD color, int transTbl);
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
@ -23,8 +23,6 @@ namespace diablo2 {
|
|||||||
struct quest_record;
|
struct quest_record;
|
||||||
struct npc_record;
|
struct npc_record;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
enum class unit_type_t : int32_t {
|
enum class unit_type_t : int32_t {
|
||||||
UNIT_TYPE_PLAYER = 0,
|
UNIT_TYPE_PLAYER = 0,
|
||||||
UNIT_TYPE_MONSTER = 1,
|
UNIT_TYPE_MONSTER = 1,
|
||||||
@ -76,8 +74,6 @@ namespace diablo2 {
|
|||||||
ITEMFLAG_ITEM = 0x08000000
|
ITEMFLAG_ITEM = 0x08000000
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct unit {
|
struct unit {
|
||||||
unit_type_t type;
|
unit_type_t type;
|
||||||
|
|
||||||
|
@ -23,8 +23,6 @@ namespace diablo2 {
|
|||||||
mpq_streambuf m_streambuf;
|
mpq_streambuf m_streambuf;
|
||||||
public:
|
public:
|
||||||
explicit mpq_ifstream(const std::string& path);
|
explicit mpq_ifstream(const std::string& path);
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ CIni::CIni(LPCTSTR lpPathName)
|
|||||||
CIni::~CIni()
|
CIni::~CIni()
|
||||||
{
|
{
|
||||||
if (m_pszPathName != NULL)
|
if (m_pszPathName != NULL)
|
||||||
delete [] m_pszPathName;
|
delete[] m_pszPathName;
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
@ -92,7 +92,7 @@ void CIni::SetPathName(LPCTSTR lpPathName)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (m_pszPathName != NULL)
|
if (m_pszPathName != NULL)
|
||||||
delete [] m_pszPathName;
|
delete[] m_pszPathName;
|
||||||
|
|
||||||
m_pszPathName = _tcsdup(lpPathName);
|
m_pszPathName = _tcsdup(lpPathName);
|
||||||
}
|
}
|
||||||
@ -143,7 +143,7 @@ DWORD CIni::GetString(LPCTSTR lpSection, LPCTSTR lpKey, LPTSTR lpBuffer, DWORD d
|
|||||||
dwLen = min(dwLen, dwBufSize);
|
dwLen = min(dwLen, dwBufSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
delete [] psz;
|
delete[] psz;
|
||||||
return dwLen;
|
return dwLen;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -152,7 +152,7 @@ CString CIni::GetString(LPCTSTR lpSection, LPCTSTR lpKey, LPCTSTR lpDefault) con
|
|||||||
{
|
{
|
||||||
LPTSTR psz = __GetStringDynamic(lpSection, lpKey, lpDefault);
|
LPTSTR psz = __GetStringDynamic(lpSection, lpKey, lpDefault);
|
||||||
CString str(psz);
|
CString str(psz);
|
||||||
delete [] psz;
|
delete[] psz;
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -177,8 +177,8 @@ BOOL CIni::AppendString(LPCTSTR lpSection, LPCTSTR lpKey, LPCTSTR lpString) cons
|
|||||||
TCHAR* pNewString = new TCHAR[_tcslen(psz) + _tcslen(lpString) + 1];
|
TCHAR* pNewString = new TCHAR[_tcslen(psz) + _tcslen(lpString) + 1];
|
||||||
_stprintf(pNewString, _T("%s%s"), psz, lpString);
|
_stprintf(pNewString, _T("%s%s"), psz, lpString);
|
||||||
const BOOL RES = WriteString(lpSection, lpKey, pNewString);
|
const BOOL RES = WriteString(lpSection, lpKey, pNewString);
|
||||||
delete [] pNewString;
|
delete[] pNewString;
|
||||||
delete [] psz;
|
delete[] psz;
|
||||||
return RES;
|
return RES;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -207,7 +207,7 @@ DWORD CIni::GetArray(LPCTSTR lpSection, LPCTSTR lpKey, LPTSTR lpBuffer, DWORD dw
|
|||||||
const DWORD MAX_LEN = _tcslen(psz) + 2;
|
const DWORD MAX_LEN = _tcslen(psz) + 2;
|
||||||
LPTSTR p = new TCHAR[MAX_LEN + 1];
|
LPTSTR p = new TCHAR[MAX_LEN + 1];
|
||||||
dwCopied = __StringSplit(psz, p, MAX_LEN, lpDelimiter, bTrimString);
|
dwCopied = __StringSplit(psz, p, MAX_LEN, lpDelimiter, bTrimString);
|
||||||
delete [] p;
|
delete[] p;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -215,12 +215,12 @@ DWORD CIni::GetArray(LPCTSTR lpSection, LPCTSTR lpKey, LPTSTR lpBuffer, DWORD dw
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
delete [] psz;
|
delete[] psz;
|
||||||
return dwCopied;
|
return dwCopied;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __AFXWIN_H__
|
#ifdef __AFXWIN_H__
|
||||||
void CIni::GetArray(LPCTSTR lpSection, LPCTSTR lpKey, CStringArray *pArray, LPCTSTR lpDelimiter, BOOL bTrimString) const
|
void CIni::GetArray(LPCTSTR lpSection, LPCTSTR lpKey, CStringArray* pArray, LPCTSTR lpDelimiter, BOOL bTrimString) const
|
||||||
{
|
{
|
||||||
if (pArray != NULL)
|
if (pArray != NULL)
|
||||||
pArray->RemoveAll();
|
pArray->RemoveAll();
|
||||||
@ -232,12 +232,12 @@ void CIni::GetArray(LPCTSTR lpSection, LPCTSTR lpKey, CStringArray *pArray, LPCT
|
|||||||
LPTSTR psz = new TCHAR[LEN + 3];
|
LPTSTR psz = new TCHAR[LEN + 3];
|
||||||
GetArray(lpSection, lpKey, psz, LEN + 2, lpDelimiter);
|
GetArray(lpSection, lpKey, psz, LEN + 2, lpDelimiter);
|
||||||
ParseDNTString(psz, __SubStrAdd, (LPVOID)pArray);
|
ParseDNTString(psz, __SubStrAdd, (LPVOID)pArray);
|
||||||
delete [] psz;
|
delete[] psz;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __AFXWIN_H__
|
#ifdef __AFXWIN_H__
|
||||||
BOOL CIni::WriteArray(LPCTSTR lpSection, LPCTSTR lpKey, const CStringArray *pArray, int nWriteCount, LPCTSTR lpDelimiter) const
|
BOOL CIni::WriteArray(LPCTSTR lpSection, LPCTSTR lpKey, const CStringArray* pArray, int nWriteCount, LPCTSTR lpDelimiter) const
|
||||||
{
|
{
|
||||||
if (pArray == NULL)
|
if (pArray == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -385,7 +385,7 @@ DWORD CIni::GetDataBlock(LPCTSTR lpSection, LPCTSTR lpKey, LPVOID lpBuffer, DWOR
|
|||||||
DWORD dwLen = _tcslen(psz) / 2;
|
DWORD dwLen = _tcslen(psz) / 2;
|
||||||
if (dwLen <= dwOffset)
|
if (dwLen <= dwOffset)
|
||||||
{
|
{
|
||||||
delete [] psz;
|
delete[] psz;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -401,7 +401,7 @@ DWORD CIni::GetDataBlock(LPCTSTR lpSection, LPCTSTR lpKey, LPVOID lpBuffer, DWOR
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
delete [] psz;
|
delete[] psz;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -425,7 +425,7 @@ DWORD CIni::GetDataBlock(LPCTSTR lpSection, LPCTSTR lpKey, LPVOID lpBuffer, DWOR
|
|||||||
{
|
{
|
||||||
dwProcLen = dwLen - dwOffset;
|
dwProcLen = dwLen - dwOffset;
|
||||||
}
|
}
|
||||||
delete [] psz;
|
delete[] psz;
|
||||||
return dwProcLen;
|
return dwProcLen;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -441,7 +441,7 @@ BOOL CIni::WriteDataBlock(LPCTSTR lpSection, LPCTSTR lpKey, LPCVOID lpData, DWOR
|
|||||||
for (DWORD i = 0, j = 0; i < dwDataSize; i++, j += 2)
|
for (DWORD i = 0, j = 0; i < dwDataSize; i++, j += 2)
|
||||||
_stprintf(&psz[j], _T("%02X"), lpb[i]);
|
_stprintf(&psz[j], _T("%02X"), lpb[i]);
|
||||||
const BOOL RES = WriteString(lpSection, lpKey, psz);
|
const BOOL RES = WriteString(lpSection, lpKey, psz);
|
||||||
delete [] psz;
|
delete[] psz;
|
||||||
return RES;
|
return RES;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -457,7 +457,7 @@ BOOL CIni::AppendDataBlock(LPCTSTR lpSection, LPCTSTR lpKey, LPCVOID lpData, DWO
|
|||||||
for (DWORD i = 0, j = 0; i < dwDataSize; i++, j += 2)
|
for (DWORD i = 0, j = 0; i < dwDataSize; i++, j += 2)
|
||||||
_stprintf(&psz[j], _T("%02X"), lpb[i]);
|
_stprintf(&psz[j], _T("%02X"), lpb[i]);
|
||||||
const BOOL RES = AppendString(lpSection, lpKey, psz);
|
const BOOL RES = AppendString(lpSection, lpKey, psz);
|
||||||
delete [] psz;
|
delete[] psz;
|
||||||
return RES;
|
return RES;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -514,12 +514,12 @@ DWORD CIni::GetKeyLines(LPCTSTR lpSection, LPTSTR lpBuffer, DWORD dwBufSize) con
|
|||||||
while (dwCopied + 2 >= dwLen)
|
while (dwCopied + 2 >= dwLen)
|
||||||
{
|
{
|
||||||
dwLen += DEF_PROFILE_THRESHOLD;
|
dwLen += DEF_PROFILE_THRESHOLD;
|
||||||
delete [] psz;
|
delete[] psz;
|
||||||
psz = new TCHAR[dwLen + 1];
|
psz = new TCHAR[dwLen + 1];
|
||||||
dwCopied = ::GetPrivateProfileSection(lpSection, psz, dwLen, m_pszPathName);
|
dwCopied = ::GetPrivateProfileSection(lpSection, psz, dwLen, m_pszPathName);
|
||||||
}
|
}
|
||||||
|
|
||||||
delete [] psz;
|
delete[] psz;
|
||||||
return dwCopied + 2;
|
return dwCopied + 2;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -549,7 +549,7 @@ DWORD CIni::GetKeyNames(LPCTSTR lpSection, LPTSTR lpBuffer, DWORD dwBufSize) con
|
|||||||
LPTSTR psz = new TCHAR[LEN + 1];
|
LPTSTR psz = new TCHAR[LEN + 1];
|
||||||
GetKeyLines(lpSection, psz, LEN);
|
GetKeyLines(lpSection, psz, LEN);
|
||||||
ParseDNTString(psz, __KeyPairProc, (LPVOID)(&sl));
|
ParseDNTString(psz, __KeyPairProc, (LPVOID)(&sl));
|
||||||
delete [] psz;
|
delete[] psz;
|
||||||
if (lpBuffer != NULL)
|
if (lpBuffer != NULL)
|
||||||
lpBuffer[sl.dwTotalCopied] = _T('\0');
|
lpBuffer[sl.dwTotalCopied] = _T('\0');
|
||||||
return sl.dwTotalCopied;
|
return sl.dwTotalCopied;
|
||||||
@ -567,12 +567,12 @@ DWORD CIni::GetSectionNames(LPTSTR lpBuffer, DWORD dwBufSize) const
|
|||||||
while (dwCopied + 2 >= dwLen)
|
while (dwCopied + 2 >= dwLen)
|
||||||
{
|
{
|
||||||
dwLen += DEF_PROFILE_THRESHOLD;
|
dwLen += DEF_PROFILE_THRESHOLD;
|
||||||
delete [] psz;
|
delete[] psz;
|
||||||
psz = new TCHAR[dwLen + 1];
|
psz = new TCHAR[dwLen + 1];
|
||||||
dwCopied = ::GetPrivateProfileSectionNames(psz, dwLen, m_pszPathName);
|
dwCopied = ::GetPrivateProfileSectionNames(psz, dwLen, m_pszPathName);
|
||||||
}
|
}
|
||||||
|
|
||||||
delete [] psz;
|
delete[] psz;
|
||||||
return dwCopied + 2;
|
return dwCopied + 2;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -582,7 +582,7 @@ DWORD CIni::GetSectionNames(LPTSTR lpBuffer, DWORD dwBufSize) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __AFXWIN_H__
|
#ifdef __AFXWIN_H__
|
||||||
void CIni::GetSectionNames(CStringArray *pArray) const
|
void CIni::GetSectionNames(CStringArray* pArray) const
|
||||||
{
|
{
|
||||||
if (pArray != NULL)
|
if (pArray != NULL)
|
||||||
pArray->RemoveAll();
|
pArray->RemoveAll();
|
||||||
@ -594,13 +594,13 @@ void CIni::GetSectionNames(CStringArray *pArray) const
|
|||||||
LPTSTR psz = new TCHAR[LEN + 1];
|
LPTSTR psz = new TCHAR[LEN + 1];
|
||||||
GetSectionNames(psz, LEN);
|
GetSectionNames(psz, LEN);
|
||||||
ParseDNTString(psz, __SubStrAdd, pArray);
|
ParseDNTString(psz, __SubStrAdd, pArray);
|
||||||
delete [] psz;
|
delete[] psz;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __AFXWIN_H__
|
#ifdef __AFXWIN_H__
|
||||||
// Retrieve a list of key-lines(key-pairs) of the specified section
|
// Retrieve a list of key-lines(key-pairs) of the specified section
|
||||||
void CIni::GetKeyLines(LPCTSTR lpSection, CStringArray *pArray) const
|
void CIni::GetKeyLines(LPCTSTR lpSection, CStringArray* pArray) const
|
||||||
{
|
{
|
||||||
if (pArray != NULL)
|
if (pArray != NULL)
|
||||||
pArray->RemoveAll();
|
pArray->RemoveAll();
|
||||||
@ -612,13 +612,13 @@ void CIni::GetKeyLines(LPCTSTR lpSection, CStringArray *pArray) const
|
|||||||
LPTSTR psz = new TCHAR[LEN + 1];
|
LPTSTR psz = new TCHAR[LEN + 1];
|
||||||
GetKeyLines(lpSection, psz, LEN);
|
GetKeyLines(lpSection, psz, LEN);
|
||||||
ParseDNTString(psz, __SubStrAdd, pArray);
|
ParseDNTString(psz, __SubStrAdd, pArray);
|
||||||
delete [] psz;
|
delete[] psz;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __AFXWIN_H__
|
#ifdef __AFXWIN_H__
|
||||||
// Retrieve a list of key names of the specified section
|
// Retrieve a list of key names of the specified section
|
||||||
void CIni::GetKeyNames(LPCTSTR lpSection, CStringArray *pArray) const
|
void CIni::GetKeyNames(LPCTSTR lpSection, CStringArray* pArray) const
|
||||||
{
|
{
|
||||||
if (pArray == NULL)
|
if (pArray == NULL)
|
||||||
return;
|
return;
|
||||||
@ -628,7 +628,7 @@ void CIni::GetKeyNames(LPCTSTR lpSection, CStringArray *pArray) const
|
|||||||
LPTSTR psz = new TCHAR[LEN + 1];
|
LPTSTR psz = new TCHAR[LEN + 1];
|
||||||
GetKeyNames(lpSection, psz, LEN);
|
GetKeyNames(lpSection, psz, LEN);
|
||||||
ParseDNTString(psz, __SubStrAdd, (LPVOID)pArray);
|
ParseDNTString(psz, __SubStrAdd, (LPVOID)pArray);
|
||||||
delete [] psz;
|
delete[] psz;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -658,7 +658,7 @@ BOOL CIni::IsSectionExist(LPCTSTR lpSection) const
|
|||||||
LPTSTR psz = new TCHAR[LEN + 1];
|
LPTSTR psz = new TCHAR[LEN + 1];
|
||||||
GetSectionNames(psz, LEN);
|
GetSectionNames(psz, LEN);
|
||||||
BOOL RES = !ParseDNTString(psz, __SubStrCompare, (LPVOID)lpSection);
|
BOOL RES = !ParseDNTString(psz, __SubStrCompare, (LPVOID)lpSection);
|
||||||
delete [] psz;
|
delete[] psz;
|
||||||
return RES;
|
return RES;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -670,7 +670,7 @@ BOOL CIni::IsKeyExist(LPCTSTR lpSection, LPCTSTR lpKey) const
|
|||||||
// Test it with the default unique string
|
// Test it with the default unique string
|
||||||
LPTSTR psz = __GetStringDynamic(lpSection, lpKey, DEF_PROFILE_TESTSTRING);
|
LPTSTR psz = __GetStringDynamic(lpSection, lpKey, DEF_PROFILE_TESTSTRING);
|
||||||
const BOOL RES = (_tcscmp(psz, DEF_PROFILE_TESTSTRING) != 0);
|
const BOOL RES = (_tcscmp(psz, DEF_PROFILE_TESTSTRING) != 0);
|
||||||
delete [] psz;
|
delete[] psz;
|
||||||
return RES;
|
return RES;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -695,7 +695,7 @@ BOOL CIni::CopySection(LPCTSTR lpSrcSection, LPCTSTR lpDestSection, BOOL bFailIf
|
|||||||
//memset(psz, 0, sizeof(TCHAR) * (SRC_LEN + 2));
|
//memset(psz, 0, sizeof(TCHAR) * (SRC_LEN + 2));
|
||||||
GetKeyLines(lpSrcSection, psz, SRC_LEN);
|
GetKeyLines(lpSrcSection, psz, SRC_LEN);
|
||||||
const BOOL RES = ::WritePrivateProfileSection(lpDestSection, psz, m_pszPathName);
|
const BOOL RES = ::WritePrivateProfileSection(lpDestSection, psz, m_pszPathName);
|
||||||
delete [] psz;
|
delete[] psz;
|
||||||
|
|
||||||
return RES;
|
return RES;
|
||||||
}
|
}
|
||||||
@ -717,7 +717,7 @@ BOOL CIni::CopyKey(LPCTSTR lpSrcSection, LPCTSTR lpSrcKey, LPCTSTR lpDestSection
|
|||||||
|
|
||||||
LPTSTR psz = __GetStringDynamic(lpSrcSection, lpSrcKey);
|
LPTSTR psz = __GetStringDynamic(lpSrcSection, lpSrcKey);
|
||||||
const BOOL RES = WriteString(lpDestSection, lpDestKey, psz);
|
const BOOL RES = WriteString(lpDestSection, lpDestKey, psz);
|
||||||
delete [] psz;
|
delete[] psz;
|
||||||
return RES;
|
return RES;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -770,7 +770,7 @@ LPTSTR CIni::__GetStringDynamic(LPCTSTR lpSection, LPCTSTR lpKey, LPCTSTR lpDefa
|
|||||||
while (dwCopied + 1 >= dwLen)
|
while (dwCopied + 1 >= dwLen)
|
||||||
{
|
{
|
||||||
dwLen += DEF_PROFILE_THRESHOLD;
|
dwLen += DEF_PROFILE_THRESHOLD;
|
||||||
delete [] psz;
|
delete[] psz;
|
||||||
psz = new TCHAR[dwLen + 1];
|
psz = new TCHAR[dwLen + 1];
|
||||||
dwCopied = ::GetPrivateProfileString(lpSection, lpKey, lpDefault == NULL ? _T("") : lpDefault, psz, dwLen, m_pszPathName);
|
dwCopied = ::GetPrivateProfileString(lpSection, lpKey, lpDefault == NULL ? _T("") : lpDefault, psz, dwLen, m_pszPathName);
|
||||||
}
|
}
|
||||||
@ -828,7 +828,7 @@ DWORD CIni::__StringSplit(LPCTSTR lpString, LPTSTR lpBuffer, DWORD dwBufSize, LP
|
|||||||
lpTarget[COPY_LEN] = _T('\0');
|
lpTarget[COPY_LEN] = _T('\0');
|
||||||
lpTarget = &lpTarget[SEG_LEN + 1];
|
lpTarget = &lpTarget[SEG_LEN + 1];
|
||||||
}
|
}
|
||||||
delete [] pszSeg;
|
delete[] pszSeg;
|
||||||
lpPos = &lpEnd[DEL_LEN]; // Advance the pointer for next search
|
lpPos = &lpEnd[DEL_LEN]; // Advance the pointer for next search
|
||||||
lpEnd = _tcsstr(lpPos, pszDel);
|
lpEnd = _tcsstr(lpPos, pszDel);
|
||||||
}
|
}
|
||||||
@ -849,9 +849,9 @@ DWORD CIni::__StringSplit(LPCTSTR lpString, LPTSTR lpBuffer, DWORD dwBufSize, LP
|
|||||||
lpTarget[COPY_LEN] = _T('\0');
|
lpTarget[COPY_LEN] = _T('\0');
|
||||||
}
|
}
|
||||||
|
|
||||||
delete [] pszSeg;
|
delete[] pszSeg;
|
||||||
lpBuffer[dwCopied] = _T('\0');
|
lpBuffer[dwCopied] = _T('\0');
|
||||||
delete [] pszDel;
|
delete[] pszDel;
|
||||||
return dwCopied;
|
return dwCopied;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -890,10 +890,10 @@ BOOL CALLBACK CIni::__SubStrCompare(LPCTSTR lpString1, LPVOID lpParam)
|
|||||||
|
|
||||||
// Callback function used to process a key-pair, it extracts the
|
// Callback function used to process a key-pair, it extracts the
|
||||||
// key name from the key-pair string
|
// key name from the key-pair string
|
||||||
BOOL CALLBACK CIni:: __KeyPairProc(LPCTSTR lpString, LPVOID lpParam)
|
BOOL CALLBACK CIni::__KeyPairProc(LPCTSTR lpString, LPVOID lpParam)
|
||||||
{
|
{
|
||||||
STR_LIMIT* psl = (STR_LIMIT*)lpParam;
|
STR_LIMIT* psl = (STR_LIMIT*)lpParam;
|
||||||
if (lpString == NULL || psl== NULL)
|
if (lpString == NULL || psl == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
LPCTSTR p = _tcschr(lpString, _T('='));
|
LPCTSTR p = _tcschr(lpString, _T('='));
|
||||||
@ -926,7 +926,7 @@ BOOL CALLBACK CIni:: __KeyPairProc(LPCTSTR lpString, LPVOID lpParam)
|
|||||||
dwCopyLen = dwNameLen;
|
dwCopyLen = dwNameLen;
|
||||||
}
|
}
|
||||||
|
|
||||||
delete [] psz;
|
delete[] psz;
|
||||||
psl->dwTotalCopied += dwCopyLen + 1;
|
psl->dwTotalCopied += dwCopyLen + 1;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -1068,7 +1068,7 @@ BOOL CIni::__TrimString(LPTSTR lpString)
|
|||||||
{
|
{
|
||||||
LPTSTR psz = _tcsdup(p);
|
LPTSTR psz = _tcsdup(p);
|
||||||
_tcscpy(lpString, psz);
|
_tcscpy(lpString, psz);
|
||||||
delete [] psz;
|
delete[] psz;
|
||||||
}
|
}
|
||||||
|
|
||||||
return bTrimmed;
|
return bTrimmed;
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
#include <d2tweaks/client/modules/client_module.h>
|
#include <d2tweaks/client/modules/client_module.h>
|
||||||
#include <d2tweaks/ui/ui_manager.h>
|
#include <d2tweaks/ui/ui_manager.h>
|
||||||
|
|
||||||
|
|
||||||
#include <diablo2/structures/unit.h>
|
#include <diablo2/structures/unit.h>
|
||||||
#include <diablo2/structures/client_unit_list.h>
|
#include <diablo2/structures/client_unit_list.h>
|
||||||
#include <WinBase.h>
|
#include <WinBase.h>
|
||||||
@ -45,12 +44,6 @@
|
|||||||
std::vector<StatEntry> globalStatsVector;
|
std::vector<StatEntry> globalStatsVector;
|
||||||
diablo2::structures::gfxdata g_gfxdata; // global gfxdata
|
diablo2::structures::gfxdata g_gfxdata; // global gfxdata
|
||||||
|
|
||||||
int randStat;
|
|
||||||
int randStatRangeLow;
|
|
||||||
int randStatRangeHigh;
|
|
||||||
int randStatBool;
|
|
||||||
|
|
||||||
|
|
||||||
std::wstring ConvertCharToWString(const std::string& charString) {
|
std::wstring ConvertCharToWString(const std::string& charString) {
|
||||||
std::wstring_convert<std::codecvt_utf8<wchar_t>> converter;
|
std::wstring_convert<std::codecvt_utf8<wchar_t>> converter;
|
||||||
return converter.from_bytes(charString);
|
return converter.from_bytes(charString);
|
||||||
@ -99,8 +92,6 @@ diablo2::ui_color_t mapColorToEnum(const std::string& colorName) {
|
|||||||
return diablo2::ui_color_t::UI_COLOR_WHITE;
|
return diablo2::ui_color_t::UI_COLOR_WHITE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Define a struct to hold key-value pairs within a section
|
// Define a struct to hold key-value pairs within a section
|
||||||
struct Section {
|
struct Section {
|
||||||
std::map<std::string, std::string> assignments;
|
std::map<std::string, std::string> assignments;
|
||||||
@ -166,6 +157,14 @@ void ParseIniFile(const std::string& iniFilePath) {
|
|||||||
else if (key == "item_type_id") {
|
else if (key == "item_type_id") {
|
||||||
entry.item_type_id = std::stoi(value);
|
entry.item_type_id = std::stoi(value);
|
||||||
}
|
}
|
||||||
|
// add op and param
|
||||||
|
else if (key == "op") {
|
||||||
|
entry.op = std::stoi(value);
|
||||||
|
}
|
||||||
|
// add op and param
|
||||||
|
else if (key == "param") {
|
||||||
|
entry.param = std::stoi(value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -214,7 +213,7 @@ __declspec (naked) void handle_cs_packet_wrapper() {
|
|||||||
__asm {
|
__asm {
|
||||||
pushad;
|
pushad;
|
||||||
pushfd;
|
pushfd;
|
||||||
call [d2_tweaks::client::client::handle_cs_packet]
|
call[d2_tweaks::client::client::handle_cs_packet]
|
||||||
popfd;
|
popfd;
|
||||||
popad;
|
popad;
|
||||||
// îðèãèíàëüíûå èíñòðóêöèè
|
// îðèãèíàëüíûå èíñòðóêöèè
|
||||||
@ -223,7 +222,6 @@ __declspec (naked) void handle_cs_packet_wrapper() {
|
|||||||
RET_TO_RVA(DLLBASE_D2CLIENT, 0xD856);
|
RET_TO_RVA(DLLBASE_D2CLIENT, 0xD856);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
__declspec (naked) void handle_sc_standart_packet_wrapper() {
|
__declspec (naked) void handle_sc_standart_packet_wrapper() {
|
||||||
__asm {
|
__asm {
|
||||||
pushad;
|
pushad;
|
||||||
@ -239,7 +237,6 @@ __declspec (naked) void handle_sc_standart_packet_wrapper() {
|
|||||||
RET_TO_RVA(DLLBASE_D2CLIENT, 0x150B5);
|
RET_TO_RVA(DLLBASE_D2CLIENT, 0x150B5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static const DLLPatchStrc gpt_handle_cs_packet[] =
|
static const DLLPatchStrc gpt_handle_cs_packet[] =
|
||||||
{
|
{
|
||||||
{D2DLL_D2CLIENT, 0xD850 + 0, PATCH_JMP, FALSE, 0x1},
|
{D2DLL_D2CLIENT, 0xD850 + 0, PATCH_JMP, FALSE, 0x1},
|
||||||
@ -248,7 +245,6 @@ static const DLLPatchStrc gpt_handle_cs_packet[] =
|
|||||||
{D2DLL_INVALID}
|
{D2DLL_INVALID}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
static const DLLPatchStrc gpt_handle_sc_standart_packet[] =
|
static const DLLPatchStrc gpt_handle_sc_standart_packet[] =
|
||||||
{
|
{
|
||||||
{D2DLL_D2CLIENT, 0x150B0 + 0, PATCH_JMP, FALSE, 0x1},
|
{D2DLL_D2CLIENT, 0x150B0 + 0, PATCH_JMP, FALSE, 0x1},
|
||||||
@ -256,7 +252,6 @@ static const DLLPatchStrc gpt_handle_sc_standart_packet[] =
|
|||||||
{D2DLL_INVALID}
|
{D2DLL_INVALID}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
void d2_tweaks::client::client::init() {
|
void d2_tweaks::client::client::init() {
|
||||||
// handle packet îáðàáàòûâàåò ïàêåò ïåðåä GamePacketReceivedIntercept
|
// handle packet îáðàáàòûâàåò ïàêåò ïåðåä GamePacketReceivedIntercept
|
||||||
hooking::hook(diablo2::d2_client::get_base() + 0x11CB0, handle_packet, reinterpret_cast<void**>(&g_handle_packet));
|
hooking::hook(diablo2::d2_client::get_base() + 0x11CB0, handle_packet, reinterpret_cast<void**>(&g_handle_packet));
|
||||||
@ -272,23 +267,10 @@ void d2_tweaks::client::client::init() {
|
|||||||
if (m_module == nullptr)
|
if (m_module == nullptr)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
//randStat = GetPrivateProfileIntA("RandStat", "stat", 0, lpIniFilePath);
|
|
||||||
//randStatRangeLow = GetPrivateProfileIntA("RandStat", "statRangeLow", 0, lpIniFilePath);
|
|
||||||
//randStatRangeHigh = GetPrivateProfileIntA("RandStat", "statRangeHigh", 0, lpIniFilePath);
|
|
||||||
//randStatBool = GetPrivateProfileIntA("RandStat", "statBool", 0, lpIniFilePath);
|
|
||||||
|
|
||||||
//spdlog::info("randStat = {0}", randStat);
|
|
||||||
//spdlog::info("randStatRangeLow = {0}", randStatRangeLow);
|
|
||||||
//spdlog::info("randStatRangeHigh = {0}", randStatRangeHigh);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Load and parse the INI file
|
// Load and parse the INI file
|
||||||
ParseIniFile(iniFilePath);
|
ParseIniFile(iniFilePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
D2TEMPLATE_ApplyPatch(gpt_handle_cs_packet);
|
D2TEMPLATE_ApplyPatch(gpt_handle_cs_packet);
|
||||||
//D2TEMPLATE_ApplyPatch(gpt_handle_sc_standart_packet);
|
//D2TEMPLATE_ApplyPatch(gpt_handle_sc_standart_packet);
|
||||||
|
|
||||||
@ -300,13 +282,12 @@ void d2_tweaks::client::client::init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int32_t g_ebp_send_to_client;
|
static int32_t g_ebp_send_to_client;
|
||||||
void d2_tweaks::client::client::handle_cs_packet(common::packet_header* packet, size_t size) {
|
void d2_tweaks::client::client::handle_cs_packet(common::packet_header* packet, size_t size) {
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
__asm {
|
__asm {
|
||||||
push [ebp + 0x2C];
|
push[ebp + 0x2C];
|
||||||
pop [g_ebp_send_to_client];
|
pop[g_ebp_send_to_client];
|
||||||
}
|
}
|
||||||
spdlog::warn("[d2client SEND] Packet {} Message {} Size {} CallFrom {}", (void*)packet->d2_packet_type, (void*)packet->message_type, size, (void*)g_ebp_send_to_client);
|
spdlog::warn("[d2client SEND] Packet {} Message {} Size {} CallFrom {}", (void*)packet->d2_packet_type, (void*)packet->message_type, size, (void*)g_ebp_send_to_client);
|
||||||
#endif
|
#endif
|
||||||
@ -325,7 +306,6 @@ void d2_tweaks::client::client::handle_cs_packet(common::packet_header* packet,
|
|||||||
handler->handle_cs_packet(packet);
|
handler->handle_cs_packet(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void d2_tweaks::client::client::handle_standart_packet(common::packet_header* packet, size_t size) {
|
void d2_tweaks::client::client::handle_standart_packet(common::packet_header* packet, size_t size) {
|
||||||
if (size == -1)
|
if (size == -1)
|
||||||
return;
|
return;
|
||||||
@ -337,7 +317,6 @@ void d2_tweaks::client::client::handle_standart_packet(common::packet_header* pa
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void d2_tweaks::client::client::handle_packet(common::packet_header* packet, size_t size) {
|
void d2_tweaks::client::client::handle_packet(common::packet_header* packet, size_t size) {
|
||||||
static common::packet_header dummy;
|
static common::packet_header dummy;
|
||||||
static auto& instance = singleton<client>::instance();
|
static auto& instance = singleton<client>::instance();
|
||||||
@ -362,10 +341,8 @@ void d2_tweaks::client::client::handle_packet(common::packet_header* packet, siz
|
|||||||
handler->handle_packet(packet);
|
handler->handle_packet(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static bool g_is_init = false;
|
static bool g_is_init = false;
|
||||||
void d2_tweaks::client::client::game_tick() {
|
void d2_tweaks::client::client::game_tick() {
|
||||||
|
|
||||||
static auto& instance = singleton<client>::instance(); /// êîíôëèêò ñ òåêñòîì íà d2 gl
|
static auto& instance = singleton<client>::instance(); /// êîíôëèêò ñ òåêñòîì íà d2 gl
|
||||||
|
|
||||||
if (g_is_init == false) {
|
if (g_is_init == false) {
|
||||||
@ -380,7 +357,7 @@ void d2_tweaks::client::client::game_tick() {
|
|||||||
g_is_init = true;
|
g_is_init = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto & tick_handler : instance.m_tick_handlers) {
|
for (auto& tick_handler : instance.m_tick_handlers) {
|
||||||
if (tick_handler == nullptr)
|
if (tick_handler == nullptr)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -390,7 +367,6 @@ void d2_tweaks::client::client::game_tick() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int32_t d2_tweaks::client::client::draw_game_ui() {
|
int32_t d2_tweaks::client::client::draw_game_ui() {
|
||||||
static auto& ui = singleton<ui::ui_manager>::instance();
|
static auto& ui = singleton<ui::ui_manager>::instance();
|
||||||
|
|
||||||
@ -401,8 +377,6 @@ int32_t d2_tweaks::client::client::draw_game_ui() {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void d2_tweaks::client::client::register_module(modules::client_module* module) {
|
void d2_tweaks::client::client::register_module(modules::client_module* module) {
|
||||||
m_modules[m_module_id_counter++] = module;
|
m_modules[m_module_id_counter++] = module;
|
||||||
}
|
}
|
||||||
|
@ -67,12 +67,9 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
void d2_tweaks::client::modules::auto_gold_pickup::init_early() {
|
void d2_tweaks::client::modules::auto_gold_pickup::init_early() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void d2_tweaks::client::modules::auto_gold_pickup::init() {
|
void d2_tweaks::client::modules::auto_gold_pickup::init() {
|
||||||
char acPathToIni[MAX_PATH] = { 0 };
|
char acPathToIni[MAX_PATH] = { 0 };
|
||||||
const char* pcIniFile = "\\d2tweaks.ini";
|
const char* pcIniFile = "\\d2tweaks.ini";
|
||||||
@ -89,7 +86,6 @@ void d2_tweaks::client::modules::auto_gold_pickup::init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void d2_tweaks::client::modules::auto_gold_pickup::tick() {
|
void d2_tweaks::client::modules::auto_gold_pickup::tick() {
|
||||||
const auto unit = diablo2::d2_client::get_local_player();
|
const auto unit = diablo2::d2_client::get_local_player();
|
||||||
|
|
||||||
@ -133,7 +129,6 @@ void d2_tweaks::client::modules::auto_gold_pickup::tick() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void d2_tweaks::client::modules::auto_gold_pickup::handle_packet(common::packet_header* packet) {
|
void d2_tweaks::client::modules::auto_gold_pickup::handle_packet(common::packet_header* packet) {
|
||||||
const auto info = static_cast<common::gold_pickup_info_sc*>(packet);
|
const auto info = static_cast<common::gold_pickup_info_sc*>(packet);
|
||||||
m_nLastUpdate = GetTickCount();
|
m_nLastUpdate = GetTickCount();
|
||||||
|
@ -67,7 +67,6 @@ static char m_acPathToIni[MAX_PATH] = { 0 };
|
|||||||
static const char* m_pcIniFile = "\\d2tweaks.ini";
|
static const char* m_pcIniFile = "\\d2tweaks.ini";
|
||||||
|
|
||||||
void d2_tweaks::client::modules::auto_item_pickup::init_early() {
|
void d2_tweaks::client::modules::auto_item_pickup::init_early() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReloadFilters(char* szPathToIni) {
|
void ReloadFilters(char* szPathToIni) {
|
||||||
@ -120,7 +119,6 @@ void ReloadFilters(char* szPathToIni) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Parse ItemCode
|
/// Parse ItemCode
|
||||||
dwLenght = lstrlen(m_pcItemListAll);
|
dwLenght = lstrlen(m_pcItemListAll);
|
||||||
memcpy(m_pcItemListAllTemp, m_pcItemListAll, dwLenght + 1);
|
memcpy(m_pcItemListAllTemp, m_pcItemListAll, dwLenght + 1);
|
||||||
@ -196,7 +194,6 @@ void ReloadFilters(char* szPathToIni) {
|
|||||||
token_string_itemcode = strtok(NULL, " ,|");
|
token_string_itemcode = strtok(NULL, " ,|");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Parse ItemType Code
|
/// Parse ItemType Code
|
||||||
dwLenght = lstrlen(m_pcItemTypesAll);
|
dwLenght = lstrlen(m_pcItemTypesAll);
|
||||||
memcpy(m_pcItemTypesAllTemp, m_pcItemTypesAll, dwLenght + 1);
|
memcpy(m_pcItemTypesAllTemp, m_pcItemTypesAll, dwLenght + 1);
|
||||||
@ -272,7 +269,6 @@ void ReloadFilters(char* szPathToIni) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class auto_item_pickup_menu : public d2_tweaks::ui::menu {
|
class auto_item_pickup_menu : public d2_tweaks::ui::menu {
|
||||||
d2_tweaks::common::asset* m_buttons_img;
|
d2_tweaks::common::asset* m_buttons_img;
|
||||||
d2_tweaks::ui::controls::button* m_auto_pickup_btn;
|
d2_tweaks::ui::controls::button* m_auto_pickup_btn;
|
||||||
@ -359,7 +355,6 @@ private:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
void d2_tweaks::client::modules::auto_item_pickup::init() {
|
void d2_tweaks::client::modules::auto_item_pickup::init() {
|
||||||
GetCurrentDirectory(MAX_PATH, m_acPathToIni);
|
GetCurrentDirectory(MAX_PATH, m_acPathToIni);
|
||||||
lstrcat(m_acPathToIni, m_pcIniFile);
|
lstrcat(m_acPathToIni, m_pcIniFile);
|
||||||
@ -375,7 +370,6 @@ void d2_tweaks::client::modules::auto_item_pickup::init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool find_free_space(diablo2::structures::inventory* inv, diablo2::structures::unit* item, int32_t inventoryIndex, char page, uint32_t& x, uint32_t& y) {
|
bool find_free_space(diablo2::structures::inventory* inv, diablo2::structures::unit* item, int32_t inventoryIndex, char page, uint32_t& x, uint32_t& y) {
|
||||||
char data[0x18];
|
char data[0x18];
|
||||||
|
|
||||||
@ -396,7 +390,6 @@ bool find_free_space(diablo2::structures::inventory* inv, diablo2::structures::u
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void d2_tweaks::client::modules::auto_item_pickup::tick() {
|
void d2_tweaks::client::modules::auto_item_pickup::tick() {
|
||||||
static common::item_pickup_info_sc packet;
|
static common::item_pickup_info_sc packet;
|
||||||
const auto unit = diablo2::d2_client::get_local_player();
|
const auto unit = diablo2::d2_client::get_local_player();
|
||||||
@ -476,7 +469,6 @@ void d2_tweaks::client::modules::auto_item_pickup::tick() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (itemtype_record_equiv2) {
|
if (itemtype_record_equiv2) {
|
||||||
if (*(DWORD*)itemtype_record_equiv2->code != 0x20202020) {
|
if (*(DWORD*)itemtype_record_equiv2->code != 0x20202020) {
|
||||||
// ñîõðàíèòü ïåðâûé ðàíåå ïîëó÷åíûé equiv1
|
// ñîõðàíèòü ïåðâûé ðàíåå ïîëó÷åíûé equiv1
|
||||||
@ -527,7 +519,6 @@ void d2_tweaks::client::modules::auto_item_pickup::tick() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
for (uint32_t i = 0; i < m_nCountItemListAll; i++)
|
for (uint32_t i = 0; i < m_nCountItemListAll; i++)
|
||||||
{
|
{
|
||||||
if (record->string_code[0] == m_stItemList[i].code0 &&
|
if (record->string_code[0] == m_stItemList[i].code0 &&
|
||||||
@ -560,7 +551,6 @@ void d2_tweaks::client::modules::auto_item_pickup::tick() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void d2_tweaks::client::modules::auto_item_pickup::handle_packet(common::packet_header* packet) {
|
void d2_tweaks::client::modules::auto_item_pickup::handle_packet(common::packet_header* packet) {
|
||||||
const auto info = static_cast<common::item_pickup_info_sc*>(packet);
|
const auto info = static_cast<common::item_pickup_info_sc*>(packet);
|
||||||
|
|
||||||
|
@ -140,7 +140,6 @@ public:
|
|||||||
|
|
||||||
ULONGLONG lastSendTime = GetTickCount64();
|
ULONGLONG lastSendTime = GetTickCount64();
|
||||||
|
|
||||||
|
|
||||||
// Function to split a string into words
|
// Function to split a string into words
|
||||||
std::vector<std::string> split(const std::string& s, char delim) {
|
std::vector<std::string> split(const std::string& s, char delim) {
|
||||||
std::stringstream ss(s);
|
std::stringstream ss(s);
|
||||||
@ -210,9 +209,6 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void draw() override {
|
void draw() override {
|
||||||
auto stats = globalStatsVector;
|
auto stats = globalStatsVector;
|
||||||
int textOffset = 40; // Initial offset for the first line
|
int textOffset = 40; // Initial offset for the first line
|
||||||
@ -232,119 +228,72 @@ public:
|
|||||||
// Initialize statValue
|
// Initialize statValue
|
||||||
int32_t statValue = 0;
|
int32_t statValue = 0;
|
||||||
|
|
||||||
if (diablo2::d2_client::get_ui_window_state(diablo2::UI_WINDOW_STASH)) {
|
//if (diablo2::d2_client::get_ui_window_state(diablo2::UI_WINDOW_STASH)) {
|
||||||
diablo2::d2_gfx::draw_filled_rect(130, 48, 640, 155, 5, 50);
|
// diablo2::d2_gfx::draw_filled_rect(130, 48, 640, 155, 5, 50);
|
||||||
}
|
//}
|
||||||
|
|
||||||
if (m_stats_enabled) {
|
if (m_stats_enabled) {
|
||||||
for (const auto& stat : stats) {
|
for (const auto& stat : stats) {
|
||||||
double param = 6;
|
int param = stat.param;
|
||||||
|
int op = stat.op;
|
||||||
|
|
||||||
int32_t spirits = diablo2::d2_common::get_stat(player, static_cast<diablo2::unit_stats_t>(185), NULL);
|
int32_t spirits = diablo2::d2_common::get_stat(player, static_cast<diablo2::unit_stats_t>(185), NULL);
|
||||||
int32_t soulscaptured = statValue = diablo2::d2_common::get_stat(player, static_cast<diablo2::unit_stats_t>(184), NULL);
|
int32_t soulscaptured = statValue = diablo2::d2_common::get_stat(player, static_cast<diablo2::unit_stats_t>(184), NULL);
|
||||||
|
|
||||||
switch (stat.stat) {
|
auto statline = diablo2::d2_common::get_item_stat_cost_record(stat.stat);
|
||||||
// 2. (statValue <- this is probably op stat1 ? * baseValue <- this is probably op base ) / 2 ^ param
|
|
||||||
|
|
||||||
// (op stat1 value * base stat value) / (2 ^ param)
|
auto opBase = statline->wOpBase;
|
||||||
// let's try this fucking thing
|
auto opStat = statline->wOpStat[0];
|
||||||
|
|
||||||
case 190: {
|
auto opBaseValue = diablo2::d2_common::get_stat(player, static_cast<diablo2::unit_stats_t>(opBase), NULL);
|
||||||
// str/spirits
|
auto opStatValue = diablo2::d2_common::get_stat(player, static_cast<diablo2::unit_stats_t>(opStat), NULL);
|
||||||
statValue = static_cast<int32_t>((1 * spirits) / pow(2, param)); // what is the value of opStat_str
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 191: {
|
|
||||||
// dex/spirits
|
|
||||||
statValue = static_cast<int32_t>((1 * spirits) / pow(2, param)); // what is the value of opStat_str
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 192: {
|
|
||||||
// vit/spirits
|
|
||||||
statValue = static_cast<int32_t>((1 * spirits) / pow(2, param)); // what is the value of opStat_str
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 193: {
|
|
||||||
// enr/spirits
|
|
||||||
statValue = static_cast<int32_t>((1 * spirits) / pow(2, param)); // what is the value of opStat_str
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 200: {
|
|
||||||
// skills/souls
|
|
||||||
param = 8;
|
|
||||||
statValue = static_cast<int32_t>((1 * soulscaptured) / pow(2, param)); // what is the value of opStat_str
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case 301: {
|
if (stat.is_item_stat == 0) {
|
||||||
for (auto item : items) {
|
int32_t statvalue = diablo2::d2_common::get_stat(player, static_cast<diablo2::unit_stats_t>(stat.stat), NULL);
|
||||||
const auto record = diablo2::d2_common::get_item_record(item->data_record_index);
|
int basevalue = 1;
|
||||||
if (record->type == 104) {
|
switch (op) {
|
||||||
statValue = diablo2::d2_common::get_stat(item, static_cast<diablo2::unit_stats_t>(stat.stat), NULL);
|
case 0:
|
||||||
}
|
statValue = diablo2::d2_common::get_stat(player, static_cast<diablo2::unit_stats_t>(stat.stat), NULL);
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
case 1: // Formula: opstatbasevalue * statvalue / 100
|
||||||
|
statValue = static_cast<int32_t>(opBaseValue) / 100;
|
||||||
case 304: {
|
|
||||||
for (auto item : items) {
|
|
||||||
const auto record = diablo2::d2_common::get_item_record(item->data_record_index);
|
|
||||||
if (record->type == 104) {
|
|
||||||
statValue = diablo2::d2_common::get_stat(item, static_cast<diablo2::unit_stats_t>(stat.stat), NULL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
case 2: // Formula: (statvalue * basevalue) / (2 ^ param)
|
||||||
|
statValue = static_cast<int32_t>((opBaseValue) / pow(op, param));
|
||||||
default: {
|
break;
|
||||||
// By default, get player stats
|
case 3: // Percentage-based version of op #2
|
||||||
|
statValue = static_cast<int32_t>((opBaseValue) / pow(op, param)) / 100;
|
||||||
|
break;
|
||||||
|
case 4: // Item-based stat increase
|
||||||
|
statValue = static_cast<int32_t>((opBaseValue) / pow(op, param));
|
||||||
|
break;
|
||||||
|
case 5: // Percentage-based item increase
|
||||||
|
statValue = static_cast<int32_t>((opBaseValue) / pow(op, param)) / 100;
|
||||||
|
break;
|
||||||
|
case 11: // Similar to op #1 and #13
|
||||||
|
statValue = static_cast<int32_t>((opBaseValue) / pow(op, param)) / 100;
|
||||||
|
break;
|
||||||
|
case 13:
|
||||||
|
statValue = static_cast<int32_t>((opBaseValue) / pow(op, param)) / 100;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
statValue = diablo2::d2_common::get_stat(player, static_cast<diablo2::unit_stats_t>(stat.stat), NULL);
|
statValue = diablo2::d2_common::get_stat(player, static_cast<diablo2::unit_stats_t>(stat.stat), NULL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
/*
|
|
||||||
int32_t diablo2::d2_common::set_stat(structures::unit* unit, unit_stats_t stat, uint32_t value, int16_t param) {
|
|
||||||
static wrap_func_std_import<int32_t(structures::unit*, int32_t, int32_t, int32_t)> set_stat(10517, get_base());
|
|
||||||
return set_stat(unit, stat, value, param);
|
|
||||||
}
|
|
||||||
|
|
||||||
std::random_device rd;
|
|
||||||
std::mt19937 gen(rd());
|
|
||||||
std::uniform_int_distribution<> dis(randStatRangeLow, randStatRangeHigh);
|
|
||||||
unsigned int randomNumber = dis(gen);
|
|
||||||
|
|
||||||
std::random_device rdb;
|
|
||||||
std::mt19937 genb(rdb());
|
|
||||||
std::uniform_int_distribution<> randBool(1, 2);
|
|
||||||
unsigned int randomBool = randBool(genb) - 1;
|
|
||||||
|
|
||||||
if (stat.is_item_stat == 1) {
|
|
||||||
for (auto item : items) {
|
for (auto item : items) {
|
||||||
const auto record = diablo2::d2_common::get_item_record(item->data_record_index);
|
const auto record = diablo2::d2_common::get_item_record(item->data_record_index);
|
||||||
int RandStatValue = diablo2::d2_common::get_stat(item, static_cast<diablo2::unit_stats_t>(randStat), NULL);
|
if (record->type == stat.item_type_id) {
|
||||||
|
statValue = diablo2::d2_common::get_stat(item, static_cast<diablo2::unit_stats_t>(stat.stat), NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (record->type == stat.item_type_id && RandStatValue != 0) {
|
// write code to get player name and display it using MessageBox
|
||||||
// set randStat value to random number 1 and 2^(32) = 4294967296
|
const auto player = diablo2::d2_client::get_local_player();
|
||||||
diablo2::d2_common::set_stat(item, static_cast<diablo2::unit_stats_t>(randStat), randomNumber, 0);
|
auto name = player->player_data->name;
|
||||||
diablo2::d2_common::set_stat(item, static_cast<diablo2::unit_stats_t>(randStatBool), randomBool, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// set randStat value to random number 1 and 2^(32) = 4294967296
|
|
||||||
//diablo2::d2_common::set_stat(player, static_cast<diablo2::unit_stats_t>(randStat), randomNumber, 0);
|
|
||||||
//diablo2::d2_common::set_stat(player, static_cast<diablo2::unit_stats_t>(randStatBool), randomBool, 0);
|
|
||||||
|
|
||||||
int statValue1 = diablo2::d2_common::get_stat(player, static_cast<diablo2::unit_stats_t>(randStat), NULL);
|
|
||||||
int statValue2 = diablo2::d2_common::get_stat(player, static_cast<diablo2::unit_stats_t>(randStatBool), NULL);
|
|
||||||
|
|
||||||
if (statValue1 > 0 ) {
|
|
||||||
diablo2::d2_common::set_stat(player, static_cast<diablo2::unit_stats_t>(randStat), 0, 0);
|
|
||||||
diablo2::d2_common::set_stat(player, static_cast<diablo2::unit_stats_t>(randStatBool), 0, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
auto statValueStr = std::to_wstring(statValue);
|
auto statValueStr = std::to_wstring(statValue);
|
||||||
std::wstring statText = std::wstring(stat.stat_display_string);// .append(L" " + statValueStr);
|
std::wstring statText = std::wstring(stat.stat_display_string);// .append(L" " + statValueStr);
|
||||||
|
|
||||||
@ -389,13 +338,9 @@ public:
|
|||||||
|
|
||||||
// instead try to load direct jpg with gdi and insetad ofloading jpg file, specify it bb64 encoded and decode it.
|
// instead try to load direct jpg with gdi and insetad ofloading jpg file, specify it bb64 encoded and decode it.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_help_enabled) {
|
if (m_help_enabled) {
|
||||||
|
|
||||||
const int windowWidth = 1280;
|
const int windowWidth = 1280;
|
||||||
const int windowHeight = 768;
|
const int windowHeight = 768;
|
||||||
|
|
||||||
@ -410,14 +355,10 @@ public:
|
|||||||
// Draw filled background box
|
// Draw filled background box
|
||||||
diablo2::d2_gfx::draw_filled_rect(boxX, boxY, boxX + boxWidth, boxY + boxHeight, 0, 255);
|
diablo2::d2_gfx::draw_filled_rect(boxX, boxY, boxX + boxWidth, boxY + boxHeight, 0, 255);
|
||||||
|
|
||||||
|
|
||||||
// Draw justified text inside the box with padding
|
// Draw justified text inside the box with padding
|
||||||
drawJustifiedTextInBox(helpText, boxX, boxY, boxWidth, boxHeight, 0);
|
drawJustifiedTextInBox(helpText, boxX, boxY, boxWidth, boxHeight, 0);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
diablo2::ui_color_t::UI_COLOR_WHITE;
|
diablo2::ui_color_t::UI_COLOR_WHITE;
|
||||||
|
|
||||||
// print player health, mana, and stamina bars, lastexp, nextexp, and level
|
// print player health, mana, and stamina bars, lastexp, nextexp, and level
|
||||||
@ -540,15 +481,6 @@ public:
|
|||||||
|
|
||||||
diablo2::d2_win::set_current_font(diablo2::UI_FONT_16); // Set font to FONT16
|
diablo2::d2_win::set_current_font(diablo2::UI_FONT_16); // Set font to FONT16
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (!should_draw()) {
|
if (!should_draw()) {
|
||||||
m_sort_inventory_btn->set_enabled(false);
|
m_sort_inventory_btn->set_enabled(false);
|
||||||
m_sort_inventory_btn->set_visible(false);
|
m_sort_inventory_btn->set_visible(false);
|
||||||
|
@ -48,7 +48,6 @@ struct damage_label {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
static growing_object_pool<damage_label> g_label_pool([]() {
|
static growing_object_pool<damage_label> g_label_pool([]() {
|
||||||
return new damage_label();
|
return new damage_label();
|
||||||
});
|
});
|
||||||
@ -99,12 +98,10 @@ static unsigned int g_font_player = 1;
|
|||||||
static unsigned int g_player_label_posx = 70;
|
static unsigned int g_player_label_posx = 70;
|
||||||
static unsigned int g_player_label_posy = 500;
|
static unsigned int g_player_label_posy = 500;
|
||||||
|
|
||||||
|
|
||||||
HWND findDiabloIIWindow() {
|
HWND findDiabloIIWindow() {
|
||||||
return FindWindow(nullptr, TEXT("Diablo II")); // Change "Diablo II" to the exact title of the game window
|
return FindWindow(nullptr, TEXT("Diablo II")); // Change "Diablo II" to the exact title of the game window
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Function to draw the health bar using Windows GDI
|
// Function to draw the health bar using Windows GDI
|
||||||
void drawHealthBar(HWND hWnd, int x, int y, int maxWidth, int height, float healthPercentage, COLORREF fillColor, COLORREF outlineColor) {
|
void drawHealthBar(HWND hWnd, int x, int y, int maxWidth, int height, float healthPercentage, COLORREF fillColor, COLORREF outlineColor) {
|
||||||
HDC hdc = GetDC(hWnd);
|
HDC hdc = GetDC(hWnd);
|
||||||
@ -139,15 +136,12 @@ void OnLoad() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void onDraw(HWND hWnd, int x, int y, int maxWidth, int height, float healthPercentage, COLORREF fillColor, COLORREF outlineColor) {
|
static void onDraw(HWND hWnd, int x, int y, int maxWidth, int height, float healthPercentage, COLORREF fillColor, COLORREF outlineColor) {
|
||||||
|
|
||||||
if (GetTickCount64() >= nEndTime) {
|
if (GetTickCount64() >= nEndTime) {
|
||||||
nEndTime = GetTickCount64() + DURATION;
|
nEndTime = GetTickCount64() + DURATION;
|
||||||
}
|
}
|
||||||
drawHealthBar(hWnd, x, y, maxWidth, height, healthPercentage, fillColor, outlineColor);
|
drawHealthBar(hWnd, x, y, maxWidth, height, healthPercentage, fillColor, outlineColor);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void draw_damage_labels() {
|
static void draw_damage_labels() {
|
||||||
const auto player = diablo2::d2_client::get_local_player();
|
const auto player = diablo2::d2_client::get_local_player();
|
||||||
|
|
||||||
@ -272,18 +266,12 @@ static void draw_damage_labels() {
|
|||||||
const auto offset = static_cast<int32_t>(lerp(static_cast<float>(label->unit_height) + 5.f, static_cast<float>(label->unit_height) + 30.f, static_cast<float>(delta) / static_cast<float>(DISPLAY_TIME)));
|
const auto offset = static_cast<int32_t>(lerp(static_cast<float>(label->unit_height) + 5.f, static_cast<float>(label->unit_height) + 30.f, static_cast<float>(delta) / static_cast<float>(DISPLAY_TIME)));
|
||||||
my -= offset;
|
my -= offset;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Draw damage label
|
// Draw damage label
|
||||||
std::wstring dmgText = L" " + std::to_wstring(label->damage) + L" ";
|
std::wstring dmgText = L" " + std::to_wstring(label->damage) + L" ";
|
||||||
const wchar_t* dmgTextPtr = dmgText.c_str();
|
const wchar_t* dmgTextPtr = dmgText.c_str();
|
||||||
diablo2::d2_win::set_current_font(diablo2::UI_FONT_6);
|
diablo2::d2_win::set_current_font(diablo2::UI_FONT_6);
|
||||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>(dmgTextPtr), textX + diablo2::d2_win::get_text_pixel_width(const_cast<wchar_t*>(combinedTextPtr)) / 2, my + label->unit_height / 2, textColor, 0);
|
diablo2::d2_win::draw_text(const_cast<wchar_t*>(dmgTextPtr), textX + diablo2::d2_win::get_text_pixel_width(const_cast<wchar_t*>(combinedTextPtr)) / 2, my + label->unit_height / 2, textColor, 0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -309,7 +297,6 @@ static diablo2::ui_color_t damage_type_to_color(d2_tweaks::common::damage_type_t
|
|||||||
}
|
}
|
||||||
|
|
||||||
void d2_tweaks::client::modules::damage_display::init_early() {
|
void d2_tweaks::client::modules::damage_display::init_early() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void d2_tweaks::client::modules::damage_display::init() {
|
void d2_tweaks::client::modules::damage_display::init() {
|
||||||
@ -410,5 +397,4 @@ void d2_tweaks::client::modules::damage_display::handle_packet(common::packet_he
|
|||||||
}
|
}
|
||||||
|
|
||||||
void d2_tweaks::client::modules::damage_display::tick() {
|
void d2_tweaks::client::modules::damage_display::tick() {
|
||||||
|
|
||||||
}
|
}
|
@ -47,9 +47,9 @@ struct message {
|
|||||||
static uint32_t m_nMsgCount = 0;
|
static uint32_t m_nMsgCount = 0;
|
||||||
static message m_stMsg[32];
|
static message m_stMsg[32];
|
||||||
|
|
||||||
static wchar_t* m_apwcColorStr[17] = {L"ÿc0", L"ÿc1", L"ÿc2", L"ÿc3", L"ÿc4", L"ÿc5", L"ÿc6", L"ÿc7", L"ÿc8", L"ÿc9", L"ÿc:", L"ÿc;", L"ÿc0", L"ÿc0", L"ÿc0", L"ÿc0", L"ÿc0" };
|
static wchar_t* m_apwcColorStr[17] = { L"ÿc0", L"ÿc1", L"ÿc2", L"ÿc3", L"ÿc4", L"ÿc5", L"ÿc6", L"ÿc7", L"ÿc8", L"ÿc9", L"ÿc:", L"ÿc;", L"ÿc0", L"ÿc0", L"ÿc0", L"ÿc0", L"ÿc0" };
|
||||||
static wchar_t* m_apwcQualityStr[10] = {L"", L"(Cracked)", L"(Normal)", L"(Superior)", L"(Magic)", L"(Set)", L"(Rare)", L"(Unique)", L"(Crafted)", L"(Tempered)"};
|
static wchar_t* m_apwcQualityStr[10] = { L"", L"(Cracked)", L"(Normal)", L"(Superior)", L"(Magic)", L"(Set)", L"(Rare)", L"(Unique)", L"(Crafted)", L"(Tempered)" };
|
||||||
static char* m_apcQualityStr[10] = {"", "(Cracked)", "(Normal)", "(Superior)", "(Magic)", "(Set)", "(Rare)", "(Unique)", "(Crafted)", "(Tempered)"};
|
static char* m_apcQualityStr[10] = { "", "(Cracked)", "(Normal)", "(Superior)", "(Magic)", "(Set)", "(Rare)", "(Unique)", "(Crafted)", "(Tempered)" };
|
||||||
|
|
||||||
static uint32_t m_nHookMethod = 1;
|
static uint32_t m_nHookMethod = 1;
|
||||||
static uint32_t m_anQualityColor[10] = { 0 };
|
static uint32_t m_anQualityColor[10] = { 0 };
|
||||||
@ -77,7 +77,6 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
void d2_tweaks::client::modules::item_drop_message::GamePacketReceivedIntercept(uint8_t* packet, size_t size) {
|
void d2_tweaks::client::modules::item_drop_message::GamePacketReceivedIntercept(uint8_t* packet, size_t size) {
|
||||||
if (packet == 0 || size == 0)
|
if (packet == 0 || size == 0)
|
||||||
return;
|
return;
|
||||||
@ -94,7 +93,6 @@ void d2_tweaks::client::modules::item_drop_message::GamePacketReceivedIntercept(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
__declspec (naked) void d2_tweaks::client::modules::item_drop_message::GamePacketReceivedInterceptASM() {
|
__declspec (naked) void d2_tweaks::client::modules::item_drop_message::GamePacketReceivedInterceptASM() {
|
||||||
__asm
|
__asm
|
||||||
{
|
{
|
||||||
@ -107,16 +105,13 @@ __declspec (naked) void d2_tweaks::client::modules::item_drop_message::GamePacke
|
|||||||
popfd;
|
popfd;
|
||||||
popad;
|
popad;
|
||||||
|
|
||||||
jmp [fn_GamePacketReceivedIntercept]
|
jmp[fn_GamePacketReceivedIntercept]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void d2_tweaks::client::modules::item_drop_message::init_early() {
|
void d2_tweaks::client::modules::item_drop_message::init_early() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void d2_tweaks::client::modules::item_drop_message::init() {
|
void d2_tweaks::client::modules::item_drop_message::init() {
|
||||||
char acPathToIni[MAX_PATH] = { 0 };
|
char acPathToIni[MAX_PATH] = { 0 };
|
||||||
const char* pcIniFile = "\\d2tweaks.ini";
|
const char* pcIniFile = "\\d2tweaks.ini";
|
||||||
@ -156,7 +151,6 @@ void d2_tweaks::client::modules::item_drop_message::init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void d2_tweaks::client::modules::item_drop_message::handle_packet(common::packet_header* packet) {
|
void d2_tweaks::client::modules::item_drop_message::handle_packet(common::packet_header* packet) {
|
||||||
const auto info = static_cast<common::item_pickup_info_sc*>(packet);
|
const auto info = static_cast<common::item_pickup_info_sc*>(packet);
|
||||||
const auto item_dropped_packet = static_cast<common::item_dropped_info_sc*>(packet);
|
const auto item_dropped_packet = static_cast<common::item_dropped_info_sc*>(packet);
|
||||||
|
@ -121,10 +121,8 @@ int32_t __fastcall item_click(diablo2::structures::unit* owner, diablo2::structu
|
|||||||
}
|
}
|
||||||
|
|
||||||
void d2_tweaks::client::modules::item_move::init_early() {
|
void d2_tweaks::client::modules::item_move::init_early() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void d2_tweaks::client::modules::item_move::init() {
|
void d2_tweaks::client::modules::item_move::init() {
|
||||||
char acPathToIni[MAX_PATH] = { 0 };
|
char acPathToIni[MAX_PATH] = { 0 };
|
||||||
const char* pcIniFile = "\\d2tweaks.ini";
|
const char* pcIniFile = "\\d2tweaks.ini";
|
||||||
@ -138,7 +136,6 @@ void d2_tweaks::client::modules::item_move::init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// handle packet coming from the server
|
// handle packet coming from the server
|
||||||
void d2_tweaks::client::modules::item_move::handle_packet(common::packet_header* packet) {
|
void d2_tweaks::client::modules::item_move::handle_packet(common::packet_header* packet) {
|
||||||
static auto& instance = singleton<client>::instance();
|
static auto& instance = singleton<client>::instance();
|
||||||
|
@ -28,7 +28,6 @@ static HANDLE __fastcall delete_save_file(char* name, char* a2) {
|
|||||||
return g_delete_save_file_original(name, a2);
|
return g_delete_save_file_original(name, a2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void d2_tweaks::client::modules::loot_filter::init_early() {
|
void d2_tweaks::client::modules::loot_filter::init_early() {
|
||||||
char acPathToIni[MAX_PATH] = { 0 };
|
char acPathToIni[MAX_PATH] = { 0 };
|
||||||
const char* pcIniFile = "\\d2tweaks.ini";
|
const char* pcIniFile = "\\d2tweaks.ini";
|
||||||
@ -42,7 +41,6 @@ void d2_tweaks::client::modules::loot_filter::init_early() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void d2_tweaks::client::modules::loot_filter::init() {
|
void d2_tweaks::client::modules::loot_filter::init() {
|
||||||
char acPathToIni[MAX_PATH] = { 0 };
|
char acPathToIni[MAX_PATH] = { 0 };
|
||||||
const char* pcIniFile = "\\d2tweaks.ini";
|
const char* pcIniFile = "\\d2tweaks.ini";
|
||||||
|
@ -83,4 +83,3 @@ void loot_filter_settings::remove(const char* name) {
|
|||||||
std::filesystem::remove(buffer);
|
std::filesystem::remove(buffer);
|
||||||
memset(g_buffer, 0x00, sizeof g_buffer);
|
memset(g_buffer, 0x00, sizeof g_buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
#include <DllNotify.h>
|
#include <DllNotify.h>
|
||||||
#include <D2Template.h>
|
#include <D2Template.h>
|
||||||
|
|
||||||
|
|
||||||
#include <diablo2/d2gfx.h>
|
#include <diablo2/d2gfx.h>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -98,10 +97,10 @@
|
|||||||
#pragma pack(push, 1)
|
#pragma pack(push, 1)
|
||||||
|
|
||||||
using namespace d2_tweaks::client::modules;
|
using namespace d2_tweaks::client::modules;
|
||||||
bool m_stats_enabled = false;
|
bool m_stats_enabled = true;
|
||||||
bool m_help_enabled = false;
|
bool m_help_enabled = false;
|
||||||
bool m_cube_enabled = false;
|
bool m_cube_enabled = false;
|
||||||
bool m_stash_enabled = false;
|
bool m_stash_enabled = true;
|
||||||
|
|
||||||
d2_tweaks::client::modules::loot_filter_settings_toggle_menu::loot_filter_settings_toggle_menu(token) {
|
d2_tweaks::client::modules::loot_filter_settings_toggle_menu::loot_filter_settings_toggle_menu(token) {
|
||||||
m_show = false;
|
m_show = false;
|
||||||
@ -124,13 +123,11 @@ d2_tweaks::client::modules::loot_filter_settings_toggle_menu::loot_filter_settin
|
|||||||
|
|
||||||
m_filter_settings_menu = singleton<ui::ui_manager>::instance().get_menu("loot_filter_settings_menu");
|
m_filter_settings_menu = singleton<ui::ui_manager>::instance().get_menu("loot_filter_settings_menu");
|
||||||
|
|
||||||
|
|
||||||
m_btn_toggle_stats = static_cast<ui::controls::button*>(get_control("m_toggle_stats"));
|
m_btn_toggle_stats = static_cast<ui::controls::button*>(get_control("m_toggle_stats"));
|
||||||
m_btn_toggle_stats->set_enabled(true);
|
m_btn_toggle_stats->set_enabled(true);
|
||||||
m_btn_toggle_stats->set_visible(true);
|
m_btn_toggle_stats->set_visible(true);
|
||||||
m_btn_toggle_stats->set_on_click(std::bind(&loot_filter_settings_toggle_menu::toggle_stats_settings_click, this));
|
m_btn_toggle_stats->set_on_click(std::bind(&loot_filter_settings_toggle_menu::toggle_stats_settings_click, this));
|
||||||
|
|
||||||
|
|
||||||
m_btn_toggle_help = static_cast<ui::controls::button*>(get_control("m_toggle_help"));
|
m_btn_toggle_help = static_cast<ui::controls::button*>(get_control("m_toggle_help"));
|
||||||
m_btn_toggle_help->set_enabled(true);
|
m_btn_toggle_help->set_enabled(true);
|
||||||
m_btn_toggle_help->set_visible(true);
|
m_btn_toggle_help->set_visible(true);
|
||||||
@ -142,21 +139,25 @@ d2_tweaks::client::modules::loot_filter_settings_toggle_menu::loot_filter_settin
|
|||||||
m_btn_toggle_cube->set_on_click(std::bind(&loot_filter_settings_toggle_menu::toggle_cube_click, this));
|
m_btn_toggle_cube->set_on_click(std::bind(&loot_filter_settings_toggle_menu::toggle_cube_click, this));
|
||||||
|
|
||||||
m_btn_toggle_stash = static_cast<ui::controls::button*>(get_control("m_toggle_stash"));
|
m_btn_toggle_stash = static_cast<ui::controls::button*>(get_control("m_toggle_stash"));
|
||||||
m_btn_toggle_stash->set_enabled(false);
|
|
||||||
m_btn_toggle_stash->set_visible(false);
|
|
||||||
auto player = diablo2::d2_client::get_local_player();
|
|
||||||
//iterate over all items in player inventory
|
|
||||||
for (auto item = player->inventory->first_item; item != nullptr; item = item->item_data->pt_next_item) {
|
|
||||||
const auto record = diablo2::d2_common::get_item_record(item->data_record_index);
|
|
||||||
char* normCode1 = record->string_code;
|
|
||||||
if (strncmp(normCode1, "st0", 3) == 0) {
|
|
||||||
m_btn_toggle_stash->set_enabled(true);
|
m_btn_toggle_stash->set_enabled(true);
|
||||||
m_btn_toggle_stash->set_visible(true);
|
m_btn_toggle_stash->set_visible(true);
|
||||||
break;
|
//auto player = diablo2::d2_client::get_local_player();
|
||||||
}
|
////iterate over all items in player inventory
|
||||||
}
|
//for (auto item = player->inventory->first_item; item != nullptr; item = item->item_data->pt_next_item) {
|
||||||
|
// const auto record = diablo2::d2_common::get_item_record(item->data_record_index);
|
||||||
|
// char* normCode1 = record->string_code;
|
||||||
|
// if (strncmp(normCode1, "st0", 3) == 0) {
|
||||||
|
// m_btn_toggle_stash->set_enabled(true);
|
||||||
|
// m_btn_toggle_stash->set_visible(true);
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// else {
|
||||||
|
// m_btn_toggle_stash->set_enabled(false);
|
||||||
|
// m_btn_toggle_stash->set_visible(false);
|
||||||
|
// }
|
||||||
|
//}
|
||||||
m_btn_toggle_stash->set_on_click(std::bind(&loot_filter_settings_toggle_menu::toggle_stash_click, this));
|
m_btn_toggle_stash->set_on_click(std::bind(&loot_filter_settings_toggle_menu::toggle_stash_click, this));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void d2_tweaks::client::modules::loot_filter_settings_toggle_menu::toggle_filter_settings_click() {
|
void d2_tweaks::client::modules::loot_filter_settings_toggle_menu::toggle_filter_settings_click() {
|
||||||
@ -173,7 +174,6 @@ void d2_tweaks::client::modules::loot_filter_settings_toggle_menu::toggle_stats_
|
|||||||
m_stats_enabled = !m_stats_enabled;
|
m_stats_enabled = !m_stats_enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void d2_tweaks::client::modules::loot_filter_settings_toggle_menu::toggle_cube_click() {
|
void d2_tweaks::client::modules::loot_filter_settings_toggle_menu::toggle_cube_click() {
|
||||||
m_cube_enabled = !m_cube_enabled;
|
m_cube_enabled = !m_cube_enabled;
|
||||||
if (m_cube_enabled) {
|
if (m_cube_enabled) {
|
||||||
@ -211,11 +211,8 @@ void d2_tweaks::client::modules::loot_filter_settings_toggle_menu::toggle_cube_c
|
|||||||
// send to server7 to close cube packet 0x4F
|
// send to server7 to close cube packet 0x4F
|
||||||
diablo2::d2_client::send_to_server_7(0x4F, 0x17, 0, 0);
|
diablo2::d2_client::send_to_server_7(0x4F, 0x17, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
void d2_tweaks::client::modules::loot_filter_settings_toggle_menu::toggle_stash_click() {
|
void d2_tweaks::client::modules::loot_filter_settings_toggle_menu::toggle_stash_click() {
|
||||||
|
|
||||||
m_stash_enabled = !m_stash_enabled;
|
m_stash_enabled = !m_stash_enabled;
|
||||||
if (m_stash_enabled) {
|
if (m_stash_enabled) {
|
||||||
const auto player = diablo2::d2_client::get_local_player();
|
const auto player = diablo2::d2_client::get_local_player();
|
||||||
@ -247,7 +244,6 @@ void d2_tweaks::client::modules::loot_filter_settings_toggle_menu::toggle_stash_
|
|||||||
diablo2::d2_client::send_to_server(&packet, sizeof packet);
|
diablo2::d2_client::send_to_server(&packet, sizeof packet);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
//run a for loop and send th set_ui_toggle packet 255 times from 1 to 255
|
//run a for loop and send th set_ui_toggle packet 255 times from 1 to 255
|
||||||
diablo2::d2_client::set_ui_toggle(0x19, 1, FALSE);
|
diablo2::d2_client::set_ui_toggle(0x19, 1, FALSE);
|
||||||
|
|
||||||
@ -256,7 +252,6 @@ void d2_tweaks::client::modules::loot_filter_settings_toggle_menu::toggle_stash_
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void d2_tweaks::client::modules::loot_filter_settings_toggle_menu::toggle_help_click() {
|
void d2_tweaks::client::modules::loot_filter_settings_toggle_menu::toggle_help_click() {
|
||||||
//m_help_enabled = !m_help_enabled;
|
//m_help_enabled = !m_help_enabled;
|
||||||
// Open the default OS browser to the URL
|
// Open the default OS browser to the URL
|
||||||
@ -271,7 +266,6 @@ void d2_tweaks::client::modules::loot_filter_settings_toggle_menu::toggle_help_c
|
|||||||
// Unsupported platform
|
// Unsupported platform
|
||||||
// You can add handling for other platforms here
|
// You can add handling for other platforms here
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void d2_tweaks::client::modules::loot_filter_settings_toggle_menu::draw() {
|
void d2_tweaks::client::modules::loot_filter_settings_toggle_menu::draw() {
|
||||||
|
@ -61,7 +61,6 @@ private:
|
|||||||
static test_menu* g_test_menu;
|
static test_menu* g_test_menu;
|
||||||
|
|
||||||
void d2_tweaks::client::modules::test::init_early() {
|
void d2_tweaks::client::modules::test::init_early() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void d2_tweaks::client::modules::test::init() {
|
void d2_tweaks::client::modules::test::init() {
|
||||||
|
@ -48,7 +48,6 @@ enum trader_command {
|
|||||||
COMMAND_ABORT
|
COMMAND_ABORT
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class trader_update_menu : public d2_tweaks::ui::menu {
|
class trader_update_menu : public d2_tweaks::ui::menu {
|
||||||
d2_tweaks::common::asset* m_buttons_img;
|
d2_tweaks::common::asset* m_buttons_img;
|
||||||
d2_tweaks::ui::controls::button* m_trader_update_btn;
|
d2_tweaks::ui::controls::button* m_trader_update_btn;
|
||||||
@ -116,12 +115,9 @@ private:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
void d2_tweaks::client::modules::trader_update::init_early() {
|
void d2_tweaks::client::modules::trader_update::init_early() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void d2_tweaks::client::modules::trader_update::init() {
|
void d2_tweaks::client::modules::trader_update::init() {
|
||||||
char szDir[MAX_PATH];
|
char szDir[MAX_PATH];
|
||||||
char szPath[MAX_PATH];
|
char szPath[MAX_PATH];
|
||||||
@ -139,24 +135,21 @@ void d2_tweaks::client::modules::trader_update::init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void d2_tweaks::client::modules::trader_update::tick() {
|
void d2_tweaks::client::modules::trader_update::tick() {
|
||||||
// const auto unit = diablo2::d2_client::get_local_player();
|
// const auto unit = diablo2::d2_client::get_local_player();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void d2_tweaks::client::modules::trader_update::handle_cs_packet(common::packet_header* packet) {
|
void d2_tweaks::client::modules::trader_update::handle_cs_packet(common::packet_header* packet) {
|
||||||
static auto& instance = singleton<client>::instance();
|
static auto& instance = singleton<client>::instance();
|
||||||
const auto income_packet_cs = static_cast<common::d2_entity_action_cs*>(packet);
|
const auto income_packet_cs = static_cast<common::d2_entity_action_cs*>(packet);
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
spdlog::debug("[D2CLIENT C > S] ENTITY ACTION! message {} action {} entity_id {} complement {}", (uint8_t) income_packet_cs->message_type, (void*)(income_packet_cs->action >> 24), (void*)(income_packet_cs->entity_id >> 24), (void*)income_packet_cs->complement);
|
spdlog::debug("[D2CLIENT C > S] ENTITY ACTION! message {} action {} entity_id {} complement {}", (uint8_t)income_packet_cs->message_type, (void*)(income_packet_cs->action >> 24), (void*)(income_packet_cs->entity_id >> 24), (void*)income_packet_cs->complement);
|
||||||
#endif
|
#endif
|
||||||
m_nMenuOpen = (uint8_t)income_packet_cs->message_type; // 1 = trade, 2 = gamble
|
m_nMenuOpen = (uint8_t)income_packet_cs->message_type; // 1 = trade, 2 = gamble
|
||||||
m_nNpcId = (income_packet_cs->action >> 24);
|
m_nNpcId = (income_packet_cs->action >> 24);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void d2_tweaks::client::modules::trader_update::handle_packet(common::packet_header* packet) {
|
void d2_tweaks::client::modules::trader_update::handle_packet(common::packet_header* packet) {
|
||||||
static auto& instance = singleton<client>::instance();
|
static auto& instance = singleton<client>::instance();
|
||||||
const auto income_packet_sc = static_cast<common::trader_update_sc*>(packet);
|
const auto income_packet_sc = static_cast<common::trader_update_sc*>(packet);
|
||||||
@ -201,4 +194,3 @@ void d2_tweaks::client::modules::trader_update::handle_packet(common::packet_hea
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -170,7 +170,7 @@ void __fastcall hook_play_sound(uint32_t soundId, uint32_t* unit, const uint32_t
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __stdcall hook_game_end () {
|
void __stdcall hook_game_end() {
|
||||||
m_game_init_done = false;
|
m_game_init_done = false;
|
||||||
m_bToggleTransmute = false;
|
m_bToggleTransmute = false;
|
||||||
return;
|
return;
|
||||||
@ -184,12 +184,11 @@ __declspec (naked) void hook_game_end_asm() {
|
|||||||
popfd;
|
popfd;
|
||||||
popad;
|
popad;
|
||||||
|
|
||||||
jmp [fn_hook_game_end];
|
jmp[fn_hook_game_end];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void d2_tweaks::client::modules::transmute::init_early() {
|
void d2_tweaks::client::modules::transmute::init_early() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void d2_tweaks::client::modules::transmute::init() {
|
void d2_tweaks::client::modules::transmute::init() {
|
||||||
@ -243,7 +242,7 @@ void d2_tweaks::client::modules::transmute::init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/////// Parse ItemCode
|
/////// Parse ItemCode
|
||||||
dwLenght = lstrlen(m_acItemListAll);
|
dwLenght = lstrlen(m_acItemListAll);
|
||||||
memcpy(m_acItemListAllTemp, m_acItemListAll, dwLenght + 1);
|
memcpy(m_acItemListAllTemp, m_acItemListAll, dwLenght + 1);
|
||||||
// ñ÷èòàåì êîëè÷åñòâî âñåõ ïðåäìåòîâ
|
// ñ÷èòàåì êîëè÷åñòâî âñåõ ïðåäìåòîâ
|
||||||
@ -316,8 +315,7 @@ void d2_tweaks::client::modules::transmute::init() {
|
|||||||
token_string_itemcode = strtok(NULL, " ,|");
|
token_string_itemcode = strtok(NULL, " ,|");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/////// Parse ItemType
|
||||||
/////// Parse ItemType
|
|
||||||
dwLenght = lstrlen(m_acItemTypesAll);
|
dwLenght = lstrlen(m_acItemTypesAll);
|
||||||
memcpy(m_acItemTypesAllTemp, m_acItemTypesAll, dwLenght + 1);
|
memcpy(m_acItemTypesAllTemp, m_acItemTypesAll, dwLenght + 1);
|
||||||
char* token_string_itemtype_code = strtok(m_acItemTypesAllTemp, ",|");
|
char* token_string_itemtype_code = strtok(m_acItemTypesAllTemp, ",|");
|
||||||
@ -403,7 +401,6 @@ void d2_tweaks::client::modules::transmute::init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void d2_tweaks::client::modules::transmute::tick() {
|
void d2_tweaks::client::modules::transmute::tick() {
|
||||||
const auto unit = diablo2::d2_client::get_local_player();
|
const auto unit = diablo2::d2_client::get_local_player();
|
||||||
|
|
||||||
@ -529,7 +526,6 @@ L1:;
|
|||||||
m_nCountFrames++;
|
m_nCountFrames++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void d2_tweaks::client::modules::transmute::handle_packet(common::packet_header* packet) {
|
void d2_tweaks::client::modules::transmute::handle_packet(common::packet_header* packet) {
|
||||||
static auto& instance = singleton<client>::instance();
|
static auto& instance = singleton<client>::instance();
|
||||||
const auto income_packet_sc = static_cast<common::transmute_info_sc*>(packet);
|
const auto income_packet_sc = static_cast<common::transmute_info_sc*>(packet);
|
||||||
|
@ -18,8 +18,8 @@ static int32_t g_ebp_send_to_server;
|
|||||||
static int32_t g_ebp_send_to_client;
|
static int32_t g_ebp_send_to_client;
|
||||||
static int32_t __stdcall net_send_to_server(int32_t queue, d2_tweaks::common::packet_header* packet, size_t size) {
|
static int32_t __stdcall net_send_to_server(int32_t queue, d2_tweaks::common::packet_header* packet, size_t size) {
|
||||||
__asm {
|
__asm {
|
||||||
push [ebp + 4]
|
push[ebp + 4]
|
||||||
pop [g_ebp_send_to_server]
|
pop[g_ebp_send_to_server]
|
||||||
}
|
}
|
||||||
|
|
||||||
spdlog::debug("[d2net SEND C >>> S] Queue {} Packet {} Size {} CallFrom {}", queue, (void*)packet->d2_packet_type, size, (void*)g_ebp_send_to_server);
|
spdlog::debug("[d2net SEND C >>> S] Queue {} Packet {} Size {} CallFrom {}", queue, (void*)packet->d2_packet_type, size, (void*)g_ebp_send_to_server);
|
||||||
@ -29,8 +29,8 @@ static int32_t __stdcall net_send_to_server(int32_t queue, d2_tweaks::common::pa
|
|||||||
|
|
||||||
static int32_t __stdcall net_send_to_client(int32_t queue, int32_t clientId, d2_tweaks::common::packet_header* packet, size_t size) {
|
static int32_t __stdcall net_send_to_client(int32_t queue, int32_t clientId, d2_tweaks::common::packet_header* packet, size_t size) {
|
||||||
__asm {
|
__asm {
|
||||||
push [ebp+4]
|
push[ebp + 4]
|
||||||
pop [g_ebp_send_to_client]
|
pop[g_ebp_send_to_client]
|
||||||
}
|
}
|
||||||
|
|
||||||
spdlog::error("[d2net SEND S >>> C] Queue {} Packet {} Size {} ClientID {} CallFrom {}", queue, (void*)packet->d2_packet_type, size, clientId, (void*)g_ebp_send_to_client);
|
spdlog::error("[d2net SEND S >>> C] Queue {} Packet {} Size {} ClientID {} CallFrom {}", queue, (void*)packet->d2_packet_type, size, clientId, (void*)g_ebp_send_to_client);
|
||||||
|
@ -25,7 +25,6 @@ void d2_tweaks::server::modules::auto_gold_pickup::init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool d2_tweaks::server::modules::auto_gold_pickup::handle_packet(diablo2::structures::game* game, diablo2::structures::unit* player, common::packet_header* packet) {
|
bool d2_tweaks::server::modules::auto_gold_pickup::handle_packet(diablo2::structures::game* game, diablo2::structures::unit* player, common::packet_header* packet) {
|
||||||
const auto income_packet_cs = static_cast<common::gold_pickup_info_cs*>(packet);
|
const auto income_packet_cs = static_cast<common::gold_pickup_info_cs*>(packet);
|
||||||
static auto& instance = singleton<server>::instance();
|
static auto& instance = singleton<server>::instance();
|
||||||
@ -39,7 +38,6 @@ bool d2_tweaks::server::modules::auto_gold_pickup::handle_packet(diablo2::struct
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool d2_tweaks::server::modules::auto_gold_pickup::au_pickup_gold(diablo2::structures::game* game, diablo2::structures::unit* unit, diablo2::structures::unit* item)
|
bool d2_tweaks::server::modules::auto_gold_pickup::au_pickup_gold(diablo2::structures::game* game, diablo2::structures::unit* unit, diablo2::structures::unit* item)
|
||||||
{
|
{
|
||||||
static common::gold_pickup_info_sc packet;
|
static common::gold_pickup_info_sc packet;
|
||||||
@ -58,7 +56,6 @@ bool d2_tweaks::server::modules::auto_gold_pickup::au_pickup_gold(diablo2::struc
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void d2_tweaks::server::modules::auto_gold_pickup::tick(diablo2::structures::game* game,
|
void d2_tweaks::server::modules::auto_gold_pickup::tick(diablo2::structures::game* game,
|
||||||
diablo2::structures::unit* unit) {
|
diablo2::structures::unit* unit) {
|
||||||
//static common::gold_pickup_info_sc packet;
|
//static common::gold_pickup_info_sc packet;
|
||||||
@ -102,4 +99,3 @@ void d2_tweaks::server::modules::auto_gold_pickup::tick(diablo2::structures::gam
|
|||||||
// continue;
|
// continue;
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +44,6 @@ void d2_tweaks::server::modules::auto_item_pickup::tick(diablo2::structures::gam
|
|||||||
//if (!room)
|
//if (!room)
|
||||||
// return;
|
// return;
|
||||||
|
|
||||||
|
|
||||||
//for (auto item = room->unit; item; item = item->prev_unit_in_room) {
|
//for (auto item = room->unit; item; item = item->prev_unit_in_room) {
|
||||||
// if (!item)
|
// if (!item)
|
||||||
// continue;
|
// continue;
|
||||||
@ -92,7 +91,6 @@ void d2_tweaks::server::modules::auto_item_pickup::tick(diablo2::structures::gam
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
// if (itemtype_record_equiv2) {
|
// if (itemtype_record_equiv2) {
|
||||||
// if (*(DWORD*)itemtype_record_equiv2->code != 0x20202020) {
|
// if (*(DWORD*)itemtype_record_equiv2->code != 0x20202020) {
|
||||||
// // ñîõðàíèòü ïåðâûé ðàíåå ïîëó÷åíûé equiv1
|
// // ñîõðàíèòü ïåðâûé ðàíåå ïîëó÷åíûé equiv1
|
||||||
@ -110,7 +108,6 @@ void d2_tweaks::server::modules::auto_item_pickup::tick(diablo2::structures::gam
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
// for (uint32_t i = 0; i < g_pickup_count_itemtype_code; i++)
|
// for (uint32_t i = 0; i < g_pickup_count_itemtype_code; i++)
|
||||||
// {
|
// {
|
||||||
// for (uint32_t count = 0; count < index_arr_itemtype; count++)
|
// for (uint32_t count = 0; count < index_arr_itemtype; count++)
|
||||||
@ -126,7 +123,6 @@ void d2_tweaks::server::modules::auto_item_pickup::tick(diablo2::structures::gam
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
// for (uint32_t i = 0; i < g_pickup_count_all_items; i++)
|
// for (uint32_t i = 0; i < g_pickup_count_all_items; i++)
|
||||||
// {
|
// {
|
||||||
// if (record->string_code[0] == g_pickup_itemcode_st[i].code0 &&
|
// if (record->string_code[0] == g_pickup_itemcode_st[i].code0 &&
|
||||||
@ -148,7 +144,6 @@ void d2_tweaks::server::modules::auto_item_pickup::tick(diablo2::structures::gam
|
|||||||
////spdlog::info("current {0}", g_tick_between_item_pickup);
|
////spdlog::info("current {0}", g_tick_between_item_pickup);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool d2_tweaks::server::modules::auto_item_pickup::au_pickup_item(diablo2::structures::game* game, diablo2::structures::unit* unit, uint32_t guid)
|
bool d2_tweaks::server::modules::auto_item_pickup::au_pickup_item(diablo2::structures::game* game, diablo2::structures::unit* unit, uint32_t guid)
|
||||||
{
|
{
|
||||||
static common::item_pickup_info_sc packet;
|
static common::item_pickup_info_sc packet;
|
||||||
@ -166,7 +161,6 @@ bool d2_tweaks::server::modules::auto_item_pickup::au_pickup_item(diablo2::struc
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool d2_tweaks::server::modules::auto_item_pickup::handle_packet(diablo2::structures::game* game, diablo2::structures::unit* player, common::packet_header* packet) {
|
bool d2_tweaks::server::modules::auto_item_pickup::handle_packet(diablo2::structures::game* game, diablo2::structures::unit* player, common::packet_header* packet) {
|
||||||
const auto income_packet_cs = static_cast<common::item_pickup_info_cs*>(packet);
|
const auto income_packet_cs = static_cast<common::item_pickup_info_cs*>(packet);
|
||||||
static auto& instance = singleton<server>::instance();
|
static auto& instance = singleton<server>::instance();
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user