mirror of
https://gitlab.com/hashborgir/d2tweaks-rnd2k.git
synced 2025-09-18 17:42:08 +00:00
Compare commits
6 Commits
extractor-
...
extractor
Author | SHA1 | Date | |
---|---|---|---|
|
82baa7c0b1 | ||
|
c0f1e91e4a | ||
|
cce65db976 | ||
|
b4b85425aa | ||
|
6cc15930ca | ||
|
106bef4f85 |
77
build/Debug/D2tweaks.Build.CppClean.log
Normal file
77
build/Debug/D2tweaks.Build.CppClean.log
Normal file
@@ -0,0 +1,77 @@
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\common\asm_code.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\common\hooking.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\diablo2\d2win.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\diablo2\d2gfx.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\diablo2\d2client.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\diablo2\d2common.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\diablo2\d2lang.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\diablo2\d2game.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\diablo2\d2net.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\d2tweaks\ui\controls\checkbox.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\d2tweaks\ui\controls\image.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\d2tweaks\ui\controls\label.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\d2tweaks\ui\controls\button.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\d2tweaks\client\modules\loot_filter\loot_filter.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\d2tweaks\client\modules\loot_filter\loot_filter_settings_toggle_menu.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\d2tweaks\client\modules\loot_filter\loot_filter_settings_menu.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\common\string_utils.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\common\config.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\common\ini.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\vc143.pdb
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\d2tweaks\client\modules\client_module.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\d2tweaks\client\modules\small_patches\small_patches.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\d2tweaks\common\common.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\d2tweaks\common\asset_manager.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\d2tweaks\server\modules\server_module.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\d2tweaks\server\server.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\d2tweaks\ui\controls\group.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\d2tweaks\ui\menu.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\d2tweaks\ui\ui_manager.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\diablo2\d2launch.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\diablo2\fog.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\diablo2\storm.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\diablo2\d2cmp.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\diablo2\utils\mpq_ifstream.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\diablo2\utils\screen.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\main.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\vendor\d2template\d2template.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\vendor\dllnotify\dllnotify.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\vendor\minhook\src\buffer.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\vendor\minhook\src\hook.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\vendor\minhook\src\trampoline.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\vendor\minhook\src\hde\hde32.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\vendor\minhook\src\hde\hde64.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\d2tweaks\client\client.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\d2tweaks\client\modules\autosort\autosort_client.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\d2tweaks\client\modules\auto_gold_pickup\auto_gold_pickup_client.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\d2tweaks\client\modules\auto_item_pickup\auto_item_pickup_client.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\d2tweaks\client\modules\damage_display\damage_display_client.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\d2tweaks\client\modules\item_drop_message\item_drop_message_client.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\d2tweaks\client\modules\item_move\item_move_client.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\d2tweaks\client\modules\loot_filter\loot_filter_settings.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\d2tweaks\client\modules\test\test.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\d2tweaks\client\modules\trader_update\trader_update_client.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\d2tweaks\client\modules\transmute\transmute_client.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\d2tweaks\server\modules\autosort\autosort_server.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\d2tweaks\server\modules\auto_gold_pickup\auto_gold_pickup_server.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\d2tweaks\server\modules\auto_item_pickup\auto_item_pickup_server.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\d2tweaks\server\modules\damage_display\damage_display_server.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\d2tweaks\server\modules\identify_on_pickup\identify_on_pickup_server.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\d2tweaks\server\modules\item_drop_message\item_drop_message_server.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\d2tweaks\server\modules\item_move\item_move_server.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\d2tweaks\server\modules\test\test.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\d2tweaks\server\modules\trader_update\trader_update_server.obj
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\src\d2tweaks\server\modules\transmute\transmute_server.obj
|
||||
d:\diablo ii\mods\ironman-dev\d2tweaks.dll
|
||||
d:\diablo ii\mods\ironman-dev\d2tweaks.pdb
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\d2tweaks.ilk
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\d2tweaks.pdb
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\d2tweaks.vcxproj.filelistabsolute.txt
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\d2tweaks.tlog\cl.command.1.tlog
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\d2tweaks.tlog\cl.items.tlog
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\d2tweaks.tlog\cl.read.1.tlog
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\d2tweaks.tlog\cl.write.1.tlog
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\d2tweaks.tlog\link.command.1.tlog
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\d2tweaks.tlog\link.read.1.tlog
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\d2tweaks.tlog\link.secondary.1.tlog
|
||||
d:\vscode\d2tweaks-rnd2k\build\debug\d2tweaks.tlog\link.write.1.tlog
|
Binary file not shown.
Binary file not shown.
@@ -1,39 +1,4 @@
|
||||
client.cpp
|
||||
autosort_client.cpp
|
||||
autosort_client.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
|
||||
auto_gold_pickup_client.cpp
|
||||
auto_item_pickup_client.cpp
|
||||
damage_display_client.cpp
|
||||
D:\VSCode\d2tweaks-rnd2k\src\d2tweaks\client\modules\damage_display\damage_display_client.cpp(135,12): warning C4244: 'argument': conversion from 'time_t' to 'unsigned int', possible loss of data
|
||||
D:\VSCode\d2tweaks-rnd2k\src\d2tweaks\client\modules\damage_display\damage_display_client.cpp(140,31): warning C4244: '=': conversion from 'ULONGLONG' to 'long', possible loss of data
|
||||
D:\VSCode\d2tweaks-rnd2k\src\d2tweaks\client\modules\damage_display\damage_display_client.cpp(264,59): warning C4244: 'argument': conversion from 'float' to 'int', possible loss of data
|
||||
item_drop_message_client.cpp
|
||||
item_move_client.cpp
|
||||
D:\VSCode\d2tweaks-rnd2k\src\d2tweaks\client\modules\item_move\item_move_client.cpp(99,33): warning C4018: '<': signed/unsigned mismatch
|
||||
loot_filter.cpp
|
||||
loot_filter_settings.cpp
|
||||
loot_filter_settings_menu.cpp
|
||||
loot_filter_settings_toggle_menu.cpp
|
||||
test.cpp
|
||||
trader_update_client.cpp
|
||||
transmute_client.cpp
|
||||
autosort_server.cpp
|
||||
D:\VSCode\d2tweaks-rnd2k\src\d2tweaks\server\modules\autosort\autosort_server.cpp(363,25): warning C4018: '<=': signed/unsigned mismatch
|
||||
D:\VSCode\d2tweaks-rnd2k\src\d2tweaks\server\modules\autosort\autosort_server.cpp(364,26): warning C4018: '<=': signed/unsigned mismatch
|
||||
auto_gold_pickup_server.cpp
|
||||
D:\VSCode\d2tweaks-rnd2k\src\d2tweaks\server\modules\auto_gold_pickup\auto_gold_pickup_server.cpp(49,33): warning C4018: '>': signed/unsigned mismatch
|
||||
auto_item_pickup_server.cpp
|
||||
damage_display_server.cpp
|
||||
identify_on_pickup_server.cpp
|
||||
item_drop_message_server.cpp
|
||||
item_move_server.cpp
|
||||
D:\VSCode\d2tweaks-rnd2k\src\d2tweaks\server\modules\item_move\item_move_server.cpp(144,1): warning C4715: 'd2_tweaks::server::modules::item_move::handle_packet': not all control paths return a value
|
||||
test.cpp
|
||||
trader_update_server.cpp
|
||||
transmute_server.cpp
|
||||
ui_manager.cpp
|
||||
d2common.cpp
|
||||
screen.cpp
|
||||
LINK : ..\..\Diablo II\MODS\ironman-dev\D2tweaks.dll not found or not built by the last incremental link; performing full link
|
||||
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.
0
build/Debug/D2tweaks.tlog/unsuccessfulbuild
Normal file
0
build/Debug/D2tweaks.tlog/unsuccessfulbuild
Normal file
@@ -1,2 +1 @@
|
||||
D:\VSCode\D2tweaks_src_17.04.2024\Build\Debug\D2tweaks.dll
|
||||
D:\VSCode\d2tweaks-rnd2k\Build\Debug\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.
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.
@@ -106,9 +106,20 @@ namespace d2_tweaks {
|
||||
bool m_show_mp4;
|
||||
bool m_show_mp5;
|
||||
|
||||
bool m_show_frp;
|
||||
bool m_show_mrp;
|
||||
bool m_show_prp;
|
||||
bool m_show_crp;
|
||||
bool m_show_lrp;
|
||||
bool m_show_vps;
|
||||
bool m_show_yps;
|
||||
bool m_show_wms;
|
||||
|
||||
bool m_show_close;
|
||||
|
||||
bool quality_settings[static_cast<size_t>(diablo2::structures::item_quality_t::ITEM_QUALITY_COUNT)];
|
||||
|
||||
char reserved[1004];
|
||||
char reserved[888];
|
||||
|
||||
static loot_filter_settings& get();
|
||||
|
||||
|
@@ -119,6 +119,17 @@ namespace d2_tweaks {
|
||||
ui::controls::checkbox* m_show_mp4;
|
||||
ui::controls::checkbox* m_show_mp5;
|
||||
|
||||
ui::controls::checkbox* m_show_frp;
|
||||
ui::controls::checkbox* m_show_mrp;
|
||||
ui::controls::checkbox* m_show_prp;
|
||||
ui::controls::checkbox* m_show_crp;
|
||||
ui::controls::checkbox* m_show_lrp;
|
||||
|
||||
ui::controls::checkbox* m_show_vps;
|
||||
ui::controls::checkbox* m_show_yps;
|
||||
ui::controls::checkbox* m_show_wms;
|
||||
|
||||
ui::controls::checkbox* m_close;
|
||||
|
||||
void(__fastcall* m_draw_dropped_items_names_original)(void*, void*);
|
||||
void(__fastcall* m_handle_dropped_items_original)(void*, void*);
|
||||
@@ -221,6 +232,16 @@ namespace d2_tweaks {
|
||||
void extract_mp5(bool value);
|
||||
|
||||
|
||||
void extract_frp(bool value);
|
||||
void extract_mrp(bool value);
|
||||
void extract_prp(bool value);
|
||||
void extract_crp(bool value);
|
||||
void extract_lrp(bool value);
|
||||
void extract_vps(bool value);
|
||||
void extract_yps(bool value);
|
||||
void extract_wms(bool value);
|
||||
|
||||
void close_window(bool value);
|
||||
|
||||
//void extract_flourite(bool value);
|
||||
//void extract_jade(bool value);
|
||||
|
@@ -22,11 +22,15 @@ namespace d2_tweaks {
|
||||
ui::controls::button* m_btn_toggle_stash;
|
||||
ui::controls::button* m_btn_toggle_bag;
|
||||
|
||||
|
||||
|
||||
public:
|
||||
menu* m_filter_settings_menu;
|
||||
menu* m_menu;
|
||||
bool m_show;
|
||||
bool m_show_bag;
|
||||
public:
|
||||
|
||||
|
||||
explicit loot_filter_settings_toggle_menu(token);
|
||||
|
||||
void toggle_show() {
|
||||
|
@@ -241,6 +241,7 @@ namespace d2_tweaks {
|
||||
uint32_t bag_guid = 0;
|
||||
bool updateBag;
|
||||
bool removeFromBag;
|
||||
bool summon;
|
||||
int prop;
|
||||
int val;
|
||||
int tmog;
|
||||
@@ -306,7 +307,16 @@ namespace d2_tweaks {
|
||||
uint32_t currentHp; // New field for current hit points
|
||||
uint32_t maxHp; // New field for maximum hit points
|
||||
|
||||
damage_info_sc() : unit_type(0), guid(0), damage_type(DAMAGE_TYPE_UNKNOWN), damage(0), currentHp(0), maxHp(0) {
|
||||
// You can add these details to the packet if needed
|
||||
// packet.isChampion = isChampion;
|
||||
// packet.isUnique = isUnique;
|
||||
// packet.isSuperUnique = isSuperUnique
|
||||
|
||||
bool isChampion;
|
||||
bool isUnique;
|
||||
bool isSuperUnique;
|
||||
|
||||
damage_info_sc() : unit_type(0), guid(0), damage_type(DAMAGE_TYPE_UNKNOWN), damage(0), currentHp(0), maxHp(0), isChampion(0), isUnique(0), isSuperUnique(0) {
|
||||
message_type = MESSAGE_TYPE_DAMAGE_INFO;
|
||||
}
|
||||
};
|
||||
|
@@ -75,13 +75,9 @@
|
||||
//
|
||||
//extern DataTables* sgptDataTables;
|
||||
|
||||
struct D2PropertyStrc
|
||||
{
|
||||
int32_t nProperty; //0x00
|
||||
int32_t nLayer; //0x04
|
||||
int32_t nMin; //0x08
|
||||
int32_t nMax; //0x0C
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
namespace diablo2 {
|
||||
namespace structures {
|
||||
@@ -92,6 +88,28 @@ namespace diablo2 {
|
||||
|
||||
struct items_line;
|
||||
struct item_types_line;
|
||||
|
||||
struct D2PropertyStrc
|
||||
{
|
||||
int32_t nProperty; //0x00
|
||||
int32_t nLayer; //0x04
|
||||
int32_t nMin; //0x08
|
||||
int32_t nMax; //0x0C
|
||||
};
|
||||
|
||||
struct D2RunesTxt
|
||||
{
|
||||
char szName[64]; //0x00
|
||||
char szRuneName[64]; //0x40
|
||||
uint8_t nComplete; //0x80
|
||||
uint8_t nServer; //0x81
|
||||
uint16_t wStringId; //0x82
|
||||
uint16_t pad0x84; //0x84
|
||||
uint16_t wIType[6]; //0x86
|
||||
uint16_t wEType[3]; //0x92
|
||||
int32_t nRune[6]; //0x98
|
||||
D2PropertyStrc pProperties[7]; //0xB0
|
||||
};
|
||||
|
||||
struct D2OpStatDataStrc
|
||||
{
|
||||
@@ -357,10 +375,10 @@ namespace diablo2 {
|
||||
UNIT_STAT_ITEM_SKILLONLEVELUP = 0xC7,
|
||||
UNIT_STAT_UNUSED200 = 0xC8,
|
||||
UNIT_STAT_ITEM_SKILLONGETHIT = 0xC9,
|
||||
UNIT_STAT_UNUSED202 = 0xCA,
|
||||
UNIT_STAT_UNUSED203 = 0xCB,
|
||||
UNIT_STAT_ITEM_CHARGED_SKILL = 0xCC,
|
||||
UNIT_STAT_UNUSED204 = 0xCD,
|
||||
UNIT_STAT_is_champion = 0xCA, // 202
|
||||
UNIT_STAT_is_unique = 0xCB, // 203
|
||||
UNIT_STAT_ITEM_CHARGED_SKILL = 0xCC, // 204
|
||||
UNIT_STAT_is_super_unique = 0xCD, // 205
|
||||
UNIT_STAT_UNUSED205 = 0xCE,
|
||||
UNIT_STAT_UNUSED206 = 0xCF,
|
||||
UNIT_STAT_UNUSED207 = 0xD0,
|
||||
@@ -953,7 +971,7 @@ namespace diablo2 {
|
||||
UNIT_STAT_gembag_Stones_Sulpher = 491,
|
||||
UNIT_STAT_gembag_Stones_Quartz = 492,
|
||||
UNIT_STAT_gembag_Stones_TigerEye = 493,
|
||||
UNIT_STAT_BoH_Desc = 494,
|
||||
UNIT_STAT_UNUSED_68 = 494,
|
||||
UNIT_STAT_runebag_RunesE = 495,
|
||||
UNIT_STAT_runebag_RunesF = 496,
|
||||
UNIT_STAT_passive_sum_mastery = 497,
|
||||
@@ -1035,7 +1053,7 @@ namespace diablo2 {
|
||||
static void diablo2::d2_common::update_trade(structures::inventory* inventory, structures::unit* item);
|
||||
//static void diablo2::d2_common::set_item_flags(structures::unit* item, structures::itemflags_t dwFlag, bool bSet);
|
||||
|
||||
static void diablo2::d2_common::add_property(structures::unit* item, D2PropertyStrc* pProperty, int nUnused);
|
||||
static void diablo2::d2_common::add_property(structures::unit* item, diablo2::structures::D2PropertyStrc* pProperty, int nUnused);
|
||||
static void diablo2::d2_common::ITEMS_SetItemFlag(structures::unit* item, uint32_t dwFlag, BOOL bSet);
|
||||
|
||||
//D2Common.0x6FDA42B0
|
||||
@@ -1050,5 +1068,14 @@ namespace diablo2 {
|
||||
//D2Common.0x6FD576D0 (#10601)
|
||||
// D2ItemsTxt* __stdcall DATATBLS_GetItemRecordFromItemCode(uint32_t dwCode, int* pItemId)
|
||||
static structures::items_line* get_item_record_from_item_code(uint32_t dwCode, int* pItemId);
|
||||
|
||||
// //D2Common.0x6FD5EAA0 (#10620)
|
||||
// D2COMMON_DLL_DECL D2RunesTxt* __stdcall DATATBLS_GetRunesTxtRecord(int nRunewordId);
|
||||
static structures::D2RunesTxt* get_runes_txt_record(int nRunewordId);
|
||||
|
||||
//D2Common.0x6FD57680 (#10600)
|
||||
//D2ItemsTxt* __stdcall DATATBLS_GetItemsTxtRecord(int nItemId)
|
||||
static structures::items_line* get_items_txt_record(int nItemId);
|
||||
|
||||
};
|
||||
}
|
||||
|
@@ -3,6 +3,7 @@
|
||||
#include <cstdint>
|
||||
#include <functional>
|
||||
#include <diablo2/structures/unit.h>
|
||||
#include "d2common.h"
|
||||
|
||||
namespace diablo2 {
|
||||
namespace structures {
|
||||
@@ -10,6 +11,205 @@ namespace diablo2 {
|
||||
struct net_client;
|
||||
struct game;
|
||||
struct unit;
|
||||
|
||||
struct D2MonPropTxt
|
||||
{
|
||||
uint32_t dwId; //0x00
|
||||
diablo2::structures::D2PropertyStrc props[3][6]; //0x04
|
||||
uint8_t nChance[3][6]; //0x124
|
||||
uint16_t pad0x136; //0x136
|
||||
};
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
|
||||
enum D2C_AiSpecialState : uint32_t
|
||||
{
|
||||
AISPECIALSTATE_NONE = 0,
|
||||
AISPECIALSTATE_NO_MON_STATS = 1, // Set when classid > nMonStatsRecord
|
||||
AISPECIALSTATE_2 = 2, // Unused
|
||||
AISPECIALSTATE_3 = 3, // Unused
|
||||
AISPECIALSTATE_4 = 4, // Unused
|
||||
AISPECIALSTATE_ROGUE_HIREABLE_NON_PLAYER_OWNER = 5,
|
||||
AISPECIALSTATE_HIREABLE_NON_PLAYER_OWNER = 6,
|
||||
AISPECIALSTATE_REVIVED = 7, // as necromancer pet
|
||||
AISPECIALSTATE_8 = 8, // Unused
|
||||
AISPECIALSTATE_9 = 9, // Unused
|
||||
// Curses
|
||||
AISPECIALSTATE_DIMVISION = 10,
|
||||
AISPECIALSTATE_TERROR = 11,
|
||||
AISPECIALSTATE_TAUNT = 12,
|
||||
|
||||
AISPECIALSTATE_COUNTESS = 13,
|
||||
AISPECIALSTATE_14 = 14, // Unused
|
||||
AISPECIALSTATE_WHIPPED = 15, // When whipped by overseer, for suicide minions
|
||||
AISPECIALSTATE_MOUNTING_UNIT = 16, // When a unit is mounting another (tower / siege beast)
|
||||
AISPECIALSTATE_17 = 17, // Unused
|
||||
|
||||
AISPECIALSTATE_TABLE_COUNT = 18,
|
||||
AISPECIALSTATE_INVALID = 19, // Could be for objects ?
|
||||
};
|
||||
|
||||
|
||||
struct D2SkillsTxt
|
||||
{
|
||||
int16_t nSkillId; //0x00
|
||||
uint16_t unk0x02; //0x02
|
||||
uint32_t dwFlags[2]; //0x04 D2C_SkillsTxtFlags
|
||||
int8_t nCharClass; //0x0C
|
||||
uint8_t unk0x0D[3]; //0x0D
|
||||
uint8_t nAnim; //0x10
|
||||
uint8_t nMonAnim; //0x11
|
||||
uint8_t nSeqTrans; //0x12
|
||||
uint8_t nSeqNum; //0x13
|
||||
uint8_t nRange; //0x14
|
||||
uint8_t nSelectProc; //0x15
|
||||
uint8_t nSeqInput; //0x16
|
||||
uint8_t pad0x17; //0x17
|
||||
int16_t nITypeA[3]; //0x18
|
||||
int16_t nITypeB[3]; //0x1E
|
||||
int16_t nETypeA[2]; //0x24
|
||||
int16_t nETypeB[2]; //0x28
|
||||
int16_t wSrvStartFunc; //0x2C
|
||||
uint16_t wSrvDoFunc; //0x2E
|
||||
uint16_t wSrvPrgFunc[3]; //0x30
|
||||
uint16_t pad0x36; //0x36
|
||||
uint32_t dwPrgCalc[3]; //0x38
|
||||
uint8_t nPrgDamage; //0x44
|
||||
uint8_t pad0x45; //0x45
|
||||
int16_t wSrvMissile; //0x46
|
||||
int16_t wSrvMissileA; //0x48
|
||||
int16_t wSrvMissileB; //0x4A
|
||||
int16_t wSrvMissileC; //0x4C
|
||||
int16_t wSrvOverlay; //0x4E
|
||||
uint32_t dwAuraFilter; //0x50
|
||||
int16_t wAuraStat[6]; //0x54
|
||||
uint32_t dwAuraLenCalc; //0x60
|
||||
uint32_t dwAuraRangeCalc; //0x64
|
||||
int32_t dwAuraStatCalc[6]; //0x68
|
||||
int16_t nAuraState; //0x80
|
||||
int16_t wAuraTargetState; //0x82
|
||||
int16_t wAuraEvent[3]; //0x84
|
||||
int16_t wAuraEventFunc[3]; //0x8A
|
||||
uint16_t wAuraTgtEvent; //0x90
|
||||
uint16_t wAuraTgtEventFunc; //0x92
|
||||
int16_t nPassiveState; //0x94
|
||||
int16_t nPassiveIType; //0x96
|
||||
int16_t nPassiveStat[5]; //0x98
|
||||
uint16_t pad0xA2; //0xA2
|
||||
uint32_t dwPassiveCalc[5]; //0xA4
|
||||
uint16_t wPassiveEvent; //0xB8
|
||||
uint16_t wPassiveEventFunc; //0xBA
|
||||
uint16_t wSummon; //0xBC
|
||||
int8_t nPetType; //0xBE
|
||||
int8_t nSumMode; //0xBF
|
||||
uint32_t dwPetMax; //0xC0
|
||||
uint16_t wSumSkill[5]; //0xC4
|
||||
uint16_t pad0xCE; //0xCE
|
||||
uint32_t dwSumSkCalc[5]; //0xD0
|
||||
int16_t wSumUMod; //0xE4
|
||||
int16_t wSumOverlay; //0xE6
|
||||
uint16_t wCltMissile; //0xE8
|
||||
uint16_t wCltMissileA; //0xEA
|
||||
uint16_t wCltMissileB; //0xEC
|
||||
uint16_t wCltMissileC; //0xEE
|
||||
uint16_t wCltMissileD; //0xF0
|
||||
uint16_t wCltStFunc; //0xF2
|
||||
uint16_t wCltDoFunc; //0xF4
|
||||
uint16_t wCltPrgFunc[3]; //0xF6
|
||||
uint16_t wStSound; //0xFC
|
||||
uint16_t nStSoundClass; //0x0FE
|
||||
uint16_t wDoSound; //0x100
|
||||
uint16_t wDoSoundA; //0x102
|
||||
uint16_t wDoSoundB; //0x104
|
||||
uint16_t wCastOverlay; //0x106
|
||||
uint16_t wTgtOverlay; //0x108
|
||||
uint16_t wTgtSound; //0x10A
|
||||
uint16_t wPrgOverlay; //0x10C
|
||||
uint16_t wPrgSound; //0x10E
|
||||
uint16_t wCltOverlayA; //0x110
|
||||
uint16_t wCltOverlayB; //0x112
|
||||
int32_t dwCltCalc[3]; //0x114
|
||||
uint8_t nItemTarget; //0x120 D2C_SkillsTxtItemTarget
|
||||
uint8_t pad0x121; //0x121
|
||||
uint16_t wItemCastSound; //0x122
|
||||
uint16_t wItemCastOverlay; //0x124
|
||||
uint16_t pad0x126; //0x126
|
||||
uint32_t dwPerDelay; //0x128
|
||||
uint16_t wMaxLvl; //0x12C
|
||||
uint16_t wResultFlags; //0x12E
|
||||
uint32_t dwHitFlags; //0x130
|
||||
uint32_t dwHitClass; //0x134
|
||||
uint32_t dwCalc[4]; //0x138
|
||||
int32_t dwParam[8]; //0x148
|
||||
uint8_t nWeapSel; //0x168
|
||||
uint8_t pad0x169; //0x169
|
||||
uint16_t wItemEffect; //0x16A
|
||||
uint16_t wItemCltEffect; //0x16C
|
||||
uint16_t pad0x16E; //0x16E
|
||||
uint32_t dwSkPoints; //0x170
|
||||
uint16_t wReqLevel; //0x174
|
||||
uint16_t wReqStr; //0x176
|
||||
uint16_t wReqDex; //0x178
|
||||
uint16_t wReqInt; //0x17A
|
||||
uint16_t wReqVit; //0x17C
|
||||
int16_t nReqSkill[3]; //0x17E
|
||||
int16_t wStartMana; //0x184
|
||||
uint16_t wMinMana; //0x186
|
||||
uint8_t nManaShift; //0x188
|
||||
uint8_t pad0x189; //0x189
|
||||
int16_t wMana; //0x18A
|
||||
int16_t wLevelMana; //0x18C
|
||||
uint8_t nAttackRank; //0x18E
|
||||
uint8_t nLineOfSight; //0x18F D2C_SkillsTxtLineOfSight
|
||||
uint32_t dwDelay; //0x190
|
||||
uint16_t wSkillDesc; //0x194
|
||||
uint16_t pad0x196; //0x196
|
||||
uint32_t dwToHit; //0x198
|
||||
uint32_t dwLevToHit; //0x19C
|
||||
uint32_t dwToHitCalc; //0x1A0
|
||||
uint8_t nToHitShift; //0x1A4
|
||||
uint8_t nSrcDam; //0x1A5
|
||||
uint16_t pad0x1A6; //0x1A6
|
||||
uint32_t dwMinDam; //0x1A8
|
||||
uint32_t dwMaxDam; //0x1AC
|
||||
uint32_t dwMinLvlDam[5]; //0x1B0
|
||||
uint32_t dwMaxLvlDam[5]; //0x1C4
|
||||
uint32_t dwDmgSymPerCalc; //0x1D8
|
||||
uint8_t nEType; //0x1DC
|
||||
uint8_t pad0x1DD[3]; //0x1DD
|
||||
uint32_t dwEMin; //0x1E0
|
||||
uint32_t dwEMax; //0x1E4
|
||||
uint32_t dwEMinLev[5]; //0x1E8
|
||||
uint32_t dwEMaxLev[5]; //0x1FC
|
||||
uint32_t dwEDmgSymPerCalc; //0x210
|
||||
uint32_t dwELen; //0x214
|
||||
uint32_t dwELevLen[3]; //0x218
|
||||
uint32_t dwELenSymPerCalc; //0x224
|
||||
uint8_t nRestrict; //0x228
|
||||
uint8_t pad0x229; //0x229
|
||||
int16_t nState[3]; //0x22A
|
||||
uint8_t nAiType; //0x230
|
||||
uint8_t pad0x231; //0x231
|
||||
int16_t wAiBonus; //0x232
|
||||
int32_t nCostMult; //0x234
|
||||
int32_t nCostAdd; //0x238
|
||||
};
|
||||
|
||||
#pragma pack()
|
||||
|
||||
struct D2SummonArgStrc
|
||||
{
|
||||
uint32_t dwFlags; //0x00
|
||||
diablo2::structures::unit* pOwner; //0x04
|
||||
int32_t nHcIdx; //0x08
|
||||
D2C_AiSpecialState nAiSpecialState; //0x0C
|
||||
int32_t nMonMode; //0x10
|
||||
D2CoordStrc pPosition; //0x14
|
||||
int32_t nPetType; //0x1C
|
||||
int32_t nPetMax; //0x20
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
class d2_game {
|
||||
@@ -52,8 +252,52 @@ namespace diablo2 {
|
||||
static structures::unit* __fastcall D2GAME_CreateItemEx_6FC4ED80(structures::game* pGame, structures::D2ItemDropStrc* pItemDrop, int32_t a3);
|
||||
|
||||
//D2Game.0x6FC4A660
|
||||
static int32_t __fastcall D2GAME_Transmogrify_6FC4A660(structures::game* pGame, structures::unit* pPlayer, structures::unit* pItem);
|
||||
static int32_t __fastcall diablo2::d2_game::D2GAME_Transmogrify_6FC4A660(structures::game* pGame, structures::unit* pPlayer, structures::unit* pItem);
|
||||
|
||||
static diablo2::structures::unit* __fastcall diablo2::d2_game::QUESTS_CreateItem(diablo2::structures::game* pGame, diablo2::structures::unit* pPlayer, uint32_t dwCode, int32_t nLevel, uint8_t nQuality, int32_t bDroppable);
|
||||
|
||||
// Add wrapper for D2Game.0x6FC603D0
|
||||
// D2MonPropTxt* __fastcall MONSTER_GetMonPropTxtRecord(int32_t nId)
|
||||
static diablo2::structures::D2MonPropTxt* __fastcall diablo2::d2_game::MONSTER_GetMonPropTxtRecord(int32_t nId);
|
||||
|
||||
|
||||
// add wrapper for //D2Game.0x6FCBC900
|
||||
// D2UnitStrc* __stdcall SUNIT_GetTargetUnit(D2GameStrc* pGame, D2UnitStrc* pUnit)
|
||||
static diablo2::structures::unit* __stdcall diablo2::d2_game::SUNIT_GetTargetUnit(structures::game* pGame, structures::unit* pUnit);
|
||||
|
||||
//D2Game.0x6FCF5B90
|
||||
//D2SkillsTxt* __fastcall SKILLS_GetSkillsTxtRecord(int32_t nSkillId)
|
||||
static diablo2::structures::D2SkillsTxt* __fastcall diablo2::d2_game::SKILLS_GetSkillsTxtRecord(int32_t nSkillId);
|
||||
|
||||
//D2Game.0x6FD15580
|
||||
//int32_t __fastcall D2GAME_GetSummonIdFromSkill_6FD15580(D2UnitStrc* pUnit, int32_t bFromMonster, int32_t nSkillId, int32_t nSkillLevel, int32_t* pSpawnMode, int32_t* pX, int32_t* pY)
|
||||
static int32_t __fastcall diablo2::d2_game::D2GAME_GetSummonIdFromSkill_6FD15580(structures::unit* pUnit, int32_t bFromMonster, int32_t nSkillId, int32_t nSkillLevel, int32_t* pSpawnMode, int32_t* pX, int32_t* pY);
|
||||
|
||||
//D2Game.0x6FD14430
|
||||
//D2UnitStrc* __fastcall D2GAME_SummonPet_6FD14430(D2GameStrc* pGame, D2SummonArgStrc* pSummonArg)
|
||||
static diablo2::structures::unit* __fastcall diablo2::d2_game::D2GAME_SummonPet_6FD14430(structures::game* pGame, structures::D2SummonArgStrc* pSummonArg);
|
||||
|
||||
//D2Game.0x6FD0CB10
|
||||
//int32_t __fastcall D2GAME_SKILLS_SetSummonBaseStats_6FD0CB10(D2GameStrc* pGame, D2UnitStrc* pUnit, D2UnitStrc* pPet, int32_t nPetLevelArg, int32_t nSkillLevel)
|
||||
static int32_t __fastcall diablo2::d2_game::D2GAME_SKILLS_SetSummonBaseStats_6FD0CB10(structures::game* pGame, structures::unit* pUnit, structures::unit* pPet, int32_t nPetLevelArg, int32_t nSkillLevel);
|
||||
|
||||
//D2Game.0x6FD0C530
|
||||
//int32_t __fastcall D2GAME_SetSummonPassiveStats_6FD0C530(D2GameStrc* pGame, D2UnitStrc* pUnit, D2UnitStrc* pPet, int32_t nSkillId, int32_t nSkillLevel, int32_t nItemLevel)
|
||||
static int32_t __fastcall diablo2::d2_game::D2GAME_SetSummonPassiveStats_6FD0C530(structures::game* pGame, structures::unit* pUnit, structures::unit* pPet, int32_t nSkillId, int32_t nSkillLevel, int32_t nItemLevel);
|
||||
|
||||
//D2Game.0x6FD0C2E0
|
||||
//void __fastcall D2GAME_SetSummonResistance_6FD0C2E0(D2UnitStrc* pUnit, D2UnitStrc* pPet)
|
||||
static void __fastcall diablo2::d2_game::D2GAME_SetSummonResistance_6FD0C2E0(structures::unit* pUnit, structures::unit* pPet);
|
||||
|
||||
//D2Game.0x6FC3E200
|
||||
//void __fastcall sub_6FC3E200(D2ClientStrc* pClient, D2UnitStrc* pUnit)
|
||||
static void __fastcall diablo2::d2_game::sub_6FC3E200(structures::net_client* pClient, structures::unit* pUnit);
|
||||
|
||||
|
||||
//D2Game.0x6FC69F10
|
||||
//D2UnitStrc* __fastcall D2GAME_SpawnMonster_6FC69F10(D2GameStrc* pGame, D2ActiveRoomStrc* pRoom, int32_t nX, int32_t nY, int32_t nMonsterId, int32_t nAnimMode, int32_t a7, int16_t nFlags)
|
||||
static diablo2::structures::unit* __fastcall diablo2::d2_game::D2GAME_SpawnMonster_6FC69F10(structures::game* pGame, structures::room* pRoom, int32_t nX, int32_t nY, int32_t nMonsterId, int32_t nAnimMode, int32_t a7, int16_t nFlags);
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
|
@@ -310,13 +310,104 @@ public:
|
||||
&& !diablo2::d2_client::get_ui_window_state(diablo2::UI_WINDOW_BELT)
|
||||
&& !diablo2::d2_client::get_ui_window_state(diablo2::UI_WINDOW_HELP)
|
||||
&& !diablo2::d2_client::get_ui_window_state(diablo2::UI_WINDOW_MERC)
|
||||
&& !diablo2::d2_client::get_ui_window_state(diablo2::UI_WINDOW_SCROLL)) {
|
||||
&& !diablo2::d2_client::get_ui_window_state(diablo2::UI_WINDOW_SCROLL)) {
|
||||
|
||||
// Draw stats
|
||||
diablo2::d2_win::set_current_font(fontMap[statsFont]); // Set font to FONT16
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>(statText.c_str()), stat.x1, stat.y1 + textOffset, stat.colorStat, 0);
|
||||
|
||||
diablo2::d2_win::set_current_font(fontMap[statsFont]); // Set font to FONT16
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>(statValueStr.c_str()), stat.x2, stat.y2 + textOffset, stat.colorStatValue, 0);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
auto runeword = diablo2::d2_common::get_runes_txt_record(169);
|
||||
|
||||
|
||||
// Assuming szName is a null-terminated C-string.
|
||||
wchar_t wText[1024]; // Ensure this buffer is large enough to hold the converted string.
|
||||
wchar_t wLine[128]; // Buffer for each line
|
||||
size_t convertedChars = 0;
|
||||
|
||||
// Initialize vertical offset
|
||||
int yOffset = 200;
|
||||
|
||||
// Convert and draw each field
|
||||
mbstowcs_s(&convertedChars, wText, "szName: ", _TRUNCATE);
|
||||
mbstowcs_s(&convertedChars, wLine, runeword->szName, _TRUNCATE);
|
||||
swprintf(wText, L"%s%s", wText, wLine);
|
||||
diablo2::d2_win::draw_text(wText, 200, yOffset, diablo2::UI_COLOR_GOLD, 0);
|
||||
yOffset += 14;
|
||||
|
||||
mbstowcs_s(&convertedChars, wText, "szRuneName: ", _TRUNCATE);
|
||||
mbstowcs_s(&convertedChars, wLine, runeword->szRuneName, _TRUNCATE);
|
||||
swprintf(wText, L"%s%s", wText, wLine);
|
||||
diablo2::d2_win::draw_text(wText, 200, yOffset, diablo2::UI_COLOR_GOLD, 0);
|
||||
yOffset += 14;
|
||||
|
||||
mbstowcs_s(&convertedChars, wText, "nComplete: ", _TRUNCATE);
|
||||
swprintf(wText, L"%s%d", wText, runeword->nComplete);
|
||||
diablo2::d2_win::draw_text(wText, 200, yOffset, diablo2::UI_COLOR_GOLD, 0);
|
||||
yOffset += 14;
|
||||
|
||||
mbstowcs_s(&convertedChars, wText, "nServer: ", _TRUNCATE);
|
||||
swprintf(wText, L"%s%d", wText, runeword->nServer);
|
||||
diablo2::d2_win::draw_text(wText, 200, yOffset, diablo2::UI_COLOR_GOLD, 0);
|
||||
yOffset += 14;
|
||||
|
||||
mbstowcs_s(&convertedChars, wText, "wStringId: ", _TRUNCATE);
|
||||
swprintf(wText, L"%s%d", wText, runeword->wStringId);
|
||||
diablo2::d2_win::draw_text(wText, 200, yOffset, diablo2::UI_COLOR_GOLD, 0);
|
||||
yOffset += 14;
|
||||
|
||||
mbstowcs_s(&convertedChars, wText, "pad0x84: ", _TRUNCATE);
|
||||
swprintf(wText, L"%s%d", wText, runeword->pad0x84);
|
||||
diablo2::d2_win::draw_text(wText, 200, yOffset, diablo2::UI_COLOR_GOLD, 0);
|
||||
yOffset += 14;
|
||||
|
||||
mbstowcs_s(&convertedChars, wText, "wIType: ", _TRUNCATE);
|
||||
for (int i = 0; i < 6; ++i) {
|
||||
swprintf(wLine, L"%d ", runeword->wIType[i]);
|
||||
wcscat_s(wText, wLine);
|
||||
}
|
||||
diablo2::d2_win::draw_text(wText, 200, yOffset, diablo2::UI_COLOR_GOLD, 0);
|
||||
yOffset += 14;
|
||||
|
||||
mbstowcs_s(&convertedChars, wText, "wEType: ", _TRUNCATE);
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
swprintf(wLine, L"%d ", runeword->wEType[i]);
|
||||
wcscat_s(wText, wLine);
|
||||
}
|
||||
diablo2::d2_win::draw_text(wText, 200, yOffset, diablo2::UI_COLOR_GOLD, 0);
|
||||
yOffset += 14;
|
||||
|
||||
mbstowcs_s(&convertedChars, wText, "nRune: ", _TRUNCATE);
|
||||
for (int i = 0; i < 6; ++i) {
|
||||
diablo2::structures::items_line* rItem = diablo2::d2_common::get_items_txt_record(runeword->nRune[i]);
|
||||
auto code = rItem->string_code;
|
||||
|
||||
// Ensure code is not null before attempting to use it
|
||||
if (code) {
|
||||
// Format code and add to wLine
|
||||
//swprintf(wLine, L"%ls ", code);
|
||||
|
||||
// Concatenate wLine to wText
|
||||
wcscat_s(wText, wLine);
|
||||
}
|
||||
}
|
||||
diablo2::d2_win::draw_text(wText, 200, yOffset, diablo2::UI_COLOR_GOLD, 0);
|
||||
yOffset += 14;
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
//diablo2::d2_win::draw_boxed_text(const_cast<wchar_t*>(statText.c_str()), stat.x1, stat.y1 + textOffset, 1, 0, stat.colorStat);
|
||||
|
@@ -17,6 +17,9 @@
|
||||
#include <diablo2/d2cmp.h>
|
||||
#include <common/hooking.h>
|
||||
|
||||
#include <diablo2/structures/monster_data.h>
|
||||
|
||||
|
||||
MODULE_INIT(damage_display)
|
||||
|
||||
struct damage_label {
|
||||
@@ -32,6 +35,9 @@ struct damage_label {
|
||||
int32_t maxHp; // New field for maximum hit points
|
||||
int32_t text_width;
|
||||
wchar_t text[64];
|
||||
bool isChampion;
|
||||
bool isUnique;
|
||||
bool isSuperUnique;
|
||||
|
||||
damage_label(uint32_t x, uint32_t y, uint32_t uw, uint32_t uh, int32_t damage, int32_t hp, int32_t maxHp)
|
||||
: screen_space(false), color(diablo2::ui_color_t::UI_COLOR_WHITE), x(x), y(y),
|
||||
@@ -273,6 +279,10 @@ static void draw_damage_labels() {
|
||||
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::set_current_font(font);
|
||||
@@ -390,10 +400,45 @@ void d2_tweaks::client::modules::damage_display::handle_packet(common::packet_he
|
||||
swprintf_s(label->text, L"%i", label->damage);
|
||||
label->text_width = diablo2::d2_win::get_text_pixel_width(label->text);
|
||||
|
||||
/*
|
||||
// Assuming info is already defined and contains the GUID
|
||||
auto monster = diablo2::d2_client::get_unit_by_guid(info->guid, 0x01);
|
||||
auto monsterData = monster->monster_data;
|
||||
|
||||
bool isChampion = monsterData->is_champion;
|
||||
bool isSuperUnique = monsterData->is_super_unique;
|
||||
bool isUnique = monsterData->is_unique;
|
||||
|
||||
if (info->currentHp == 0) {
|
||||
//MessageBoxA(nullptr, "Monster is dead", "Monster is dead", MB_OK);
|
||||
if (isChampion) {
|
||||
//MessageBoxA(nullptr, "Monster is a Champion", "Monster is a Champion", MB_OK);
|
||||
auto isChampionValue = diablo2::d2_common::get_stat(player, diablo2::UNIT_STAT_is_champion, 0);
|
||||
diablo2::d2_common::set_stat(player, diablo2::UNIT_STAT_is_champion, isChampionValue + 1, 0);
|
||||
|
||||
}
|
||||
else if (isUnique) {
|
||||
//MessageBoxA(nullptr, "Monster is Unique", "Monster is Unique", MB_OK);
|
||||
auto isUniqueValue = diablo2::d2_common::get_stat(player, diablo2::UNIT_STAT_is_unique, 0);
|
||||
diablo2::d2_common::set_stat(player, diablo2::UNIT_STAT_is_unique, isUniqueValue + 1, 0);
|
||||
}
|
||||
else if (isSuperUnique) {
|
||||
//MessageBoxA(nullptr, "Monster is Super Unique", "Monster is Super Unique", MB_OK);
|
||||
auto isSuperUniqueValue = diablo2::d2_common::get_stat(player, diablo2::UNIT_STAT_is_super_unique, 0);
|
||||
diablo2::d2_common::set_stat(player, diablo2::UNIT_STAT_is_super_unique, isSuperUniqueValue + 1, 0);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
if (add_label(label))
|
||||
return;
|
||||
|
||||
g_label_pool.put(label); //prevent memory leak if there's no room for another label
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
void d2_tweaks::client::modules::damage_display::tick() {
|
||||
|
@@ -101,7 +101,6 @@ d2_tweaks::client::modules::loot_filter_settings_menu::loot_filter_settings_menu
|
||||
register_quality_checkboxes();
|
||||
|
||||
setup_hooks();
|
||||
|
||||
}
|
||||
|
||||
auto D2CLIENT_StoredTickCount = GetTickCount();
|
||||
@@ -119,7 +118,6 @@ void displayStat(const std::wstring& label, uint32_t value, int x, int y, int of
|
||||
}
|
||||
|
||||
void displayStat() {
|
||||
|
||||
auto player = diablo2::d2_client::get_local_player();
|
||||
auto inventory = player->inventory;
|
||||
diablo2::structures::unit* bag;
|
||||
@@ -153,10 +151,8 @@ void displayStat() {
|
||||
uint32_t gembag_Stones_Quartz;
|
||||
uint32_t gembag_Stones_TigerEye;
|
||||
|
||||
|
||||
int textOffset = 0;
|
||||
|
||||
|
||||
// get the value of x , y, and z from the d2tweaks.ini file using getprofileint
|
||||
int x = GetPrivateProfileInt("BagStats", "x", 0, "./d2tweaks.ini");
|
||||
int y = GetPrivateProfileInt("BagStats", "y", 0, "./d2tweaks.ini");
|
||||
@@ -187,7 +183,7 @@ void displayStat() {
|
||||
runebag_RunesE = diablo2::d2_common::get_stat(item, diablo2::UNIT_STAT_runebag_RunesE, NULL);
|
||||
runebag_RunesF = diablo2::d2_common::get_stat(item, diablo2::UNIT_STAT_runebag_RunesF, NULL);
|
||||
|
||||
// rejuv
|
||||
// rejuv & misc potions
|
||||
gembag_Potions = diablo2::d2_common::get_stat(item, diablo2::UNIT_STAT_gembag_Potions, NULL);
|
||||
|
||||
// potions
|
||||
@@ -203,127 +199,133 @@ void displayStat() {
|
||||
gembag_Stones_Quartz = diablo2::d2_common::get_stat(item, diablo2::UNIT_STAT_gembag_Stones_Quartz, NULL);
|
||||
gembag_Stones_TigerEye = diablo2::d2_common::get_stat(item, diablo2::UNIT_STAT_gembag_Stones_TigerEye, NULL);
|
||||
|
||||
// Display each stat on screen
|
||||
//diablo2::d2_win::draw_text((wchar_t*)((L"Ruby: " + std::to_wstring(statRuby)).c_str()), 400, 15 + textOffset, diablo2::UI_COLOR_RED, 0);
|
||||
//diablo2::d2_win::draw_text((wchar_t*)((L"Amethyst: " + std::to_wstring(statAmethyst)).c_str()), 400, 27 + textOffset, diablo2::UI_COLOR_PURPLE, 0);
|
||||
//diablo2::d2_win::draw_text((wchar_t*)((L"Diamond: " + std::to_wstring(statDiamond)).c_str()), 400, 39 + textOffset, diablo2::UI_COLOR_WHITE, 0);
|
||||
//diablo2::d2_win::draw_text((wchar_t*)((L"Emerald: " + std::to_wstring(statEmerald)).c_str()), 400, 51 + textOffset, diablo2::UI_COLOR_LIGHT_GREEN, 0);
|
||||
//diablo2::d2_win::draw_text((wchar_t*)((L"Sapphire: " + std::to_wstring(statSapphire)).c_str()), 400, 63 + textOffset, diablo2::UI_COLOR_BLUE, 0);
|
||||
//diablo2::d2_win::draw_text((wchar_t*)((L"Topaz: " + std::to_wstring(statTopaz)).c_str()), 400, 75 + textOffset, diablo2::UI_COLOR_YELLOW, 0);
|
||||
//diablo2::d2_win::draw_text((wchar_t*)((L"Skull: " + std::to_wstring(statSkull)).c_str()), 400, 87 + textOffset, diablo2::UI_COLOR_GREY, 0);
|
||||
|
||||
//diablo2::d2_win::draw_text((wchar_t*)((L"Runes A: " + std::to_wstring(runebag_RunesA)).c_str()), 400, 109 + textOffset, diablo2::UI_COLOR_GREY, 0);
|
||||
//diablo2::d2_win::draw_text((wchar_t*)((L"Runes B: " + std::to_wstring(runebag_RunesB)).c_str()), 400, 121 + textOffset, diablo2::UI_COLOR_GREY, 0);
|
||||
//diablo2::d2_win::draw_text((wchar_t*)((L"Runes C: " + std::to_wstring(runebag_RunesC)).c_str()), 400, 133 + textOffset, diablo2::UI_COLOR_GREY, 0);
|
||||
//diablo2::d2_win::draw_text((wchar_t*)((L"Runes D: " + std::to_wstring(runebag_RunesD)).c_str()), 400, 145 + textOffset, diablo2::UI_COLOR_GREY, 0);
|
||||
//diablo2::d2_win::draw_text((wchar_t*)((L"Runes E: " + std::to_wstring(runebag_RunesE)).c_str()), 400, 157 + textOffset, diablo2::UI_COLOR_GREY, 0);
|
||||
//diablo2::d2_win::draw_text((wchar_t*)((L"Runes F: " + std::to_wstring(runebag_RunesF)).c_str()), 400, 169 + textOffset, diablo2::UI_COLOR_GREY, 0);
|
||||
|
||||
//diablo2::d2_win::draw_text((wchar_t*)((L"Rejuv: " + std::to_wstring(gembag_Potions)).c_str()), 400, 191 + textOffset, diablo2::UI_COLOR_PURPLE, 0);
|
||||
|
||||
//diablo2::d2_win::draw_text((wchar_t*)((L"Potions HP: " + std::to_wstring(gembag_PotionsHP)).c_str()), 400, 213 + textOffset, diablo2::UI_COLOR_RED, 0);
|
||||
//diablo2::d2_win::draw_text((wchar_t*)((L"Potions Mana: " + std::to_wstring(gembag_PotionsMana)).c_str()), 400, 225 + textOffset, diablo2::UI_COLOR_BLUE, 0);
|
||||
|
||||
//diablo2::d2_win::draw_text((wchar_t*)((L"Flourite: " + std::to_wstring(gembag_Stones_Flourite)).c_str()), 400, 247 + textOffset, diablo2::UI_COLOR_RED, 0);
|
||||
//diablo2::d2_win::draw_text((wchar_t*)((L"Jade: " + std::to_wstring(gembag_Stones_Jade)).c_str()), 400, 259 + textOffset, diablo2::UI_COLOR_LIGHT_GREEN, 0);
|
||||
//diablo2::d2_win::draw_text((wchar_t*)((L"Argonite: " + std::to_wstring(gembag_Stones_Argonite)).c_str()), 400, 271 + textOffset, diablo2::UI_COLOR_RED, 0);
|
||||
//diablo2::d2_win::draw_text((wchar_t*)((L"Azurite: " + std::to_wstring(gembag_Stones_Azurite)).c_str()), 400, 283 + textOffset, diablo2::UI_COLOR_BLUE, 0);
|
||||
//diablo2::d2_win::draw_text((wchar_t*)((L"Sulpher: " + std::to_wstring(gembag_Stones_Sulpher)).c_str()), 400, 295 + textOffset, diablo2::UI_COLOR_ORANGE, 0);
|
||||
//diablo2::d2_win::draw_text((wchar_t*)((L"Quartz: " + std::to_wstring(gembag_Stones_Quartz)).c_str()), 400, 307 + textOffset, diablo2::UI_COLOR_WHITE, 0);
|
||||
//diablo2::d2_win::draw_text((wchar_t*)((L"Tiger Eye: " + std::to_wstring(gembag_Stones_TigerEye)).c_str()), 400, 319 + textOffset, diablo2::UI_COLOR_YELLOW, 0);
|
||||
|
||||
diablo2::d2_win::set_current_font(diablo2::UI_FONT_8);
|
||||
diablo2::d2_win::set_current_font(diablo2::UI_FONT_16);
|
||||
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((L"Chipped Rubies: ")), x, y + 15 + textOffset, diablo2::UI_COLOR_RED, 0);
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(statRuby)).c_str()), x + z, y + 15 + textOffset, diablo2::UI_COLOR_RED, 0);
|
||||
if (statRuby > 0) {
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(statRuby)).c_str()), x + z, y + 15 + textOffset, diablo2::UI_COLOR_RED, 0);
|
||||
}
|
||||
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((L"Chipped Amethyst: ")), x, y + 27 + textOffset, diablo2::UI_COLOR_PURPLE, 0);
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(statAmethyst)).c_str()), x + z, y + 27 + textOffset, diablo2::UI_COLOR_PURPLE, 0);
|
||||
if (statAmethyst > 0) {
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(statAmethyst)).c_str()), x + z, y + 27 + textOffset, diablo2::UI_COLOR_PURPLE, 0);
|
||||
}
|
||||
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((L"Chipped Diamonds: ")), x, y + 39 + textOffset, diablo2::UI_COLOR_WHITE, 0);
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(statDiamond)).c_str()), x + z, y + 39 + textOffset, diablo2::UI_COLOR_WHITE, 0);
|
||||
if (statDiamond > 0) {
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(statDiamond)).c_str()), x + z, y + 39 + textOffset, diablo2::UI_COLOR_WHITE, 0);
|
||||
}
|
||||
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((L"Chipped Emeralds: ")), x, y + 51 + textOffset, diablo2::UI_COLOR_LIGHT_GREEN, 0);
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(statEmerald)).c_str()), x + z, y + 51 + textOffset, diablo2::UI_COLOR_LIGHT_GREEN, 0);
|
||||
|
||||
if (statEmerald > 0) {
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(statEmerald)).c_str()), x + z, y + 51 + textOffset, diablo2::UI_COLOR_LIGHT_GREEN, 0);
|
||||
}
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((L"Chipped Sapphires: ")), x, y + 63 + textOffset, diablo2::UI_COLOR_BLUE, 0);
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(statSapphire)).c_str()), x + z, y + 63 + textOffset, diablo2::UI_COLOR_BLUE, 0);
|
||||
if (statSapphire > 0) {
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(statSapphire)).c_str()), x + z, y + 63 + textOffset, diablo2::UI_COLOR_BLUE, 0);
|
||||
}
|
||||
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((L"Chipped Topaz: ")), x, y + 75 + textOffset, diablo2::UI_COLOR_YELLOW, 0);
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(statTopaz)).c_str()), x + z, y + 75 + textOffset, diablo2::UI_COLOR_YELLOW, 0);
|
||||
if (statTopaz > 0) {
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(statTopaz)).c_str()), x + z, y + 75 + textOffset, diablo2::UI_COLOR_YELLOW, 0);
|
||||
}
|
||||
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((L"Chipped Skulls: ")), x, y + 87 + textOffset, diablo2::UI_COLOR_GREY, 0);
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(statSkull)).c_str()), x + z, y + 87 + textOffset, diablo2::UI_COLOR_GREY, 0);
|
||||
if (statSkull > 0) {
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(statSkull)).c_str()), x + z, y + 87 + textOffset, diablo2::UI_COLOR_GREY, 0);
|
||||
}
|
||||
// Displaying the names for Runes 1-6: El, Eld, Tir, Nef, Eth, Ith
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((L"El Runes:")), x, y + 109 + textOffset, diablo2::UI_COLOR_GREY, 0);
|
||||
if (runebag_RunesA > 0) {
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(runebag_RunesA)).c_str()), x + z, y + 109 + textOffset, diablo2::UI_COLOR_WHITE, 0);
|
||||
}
|
||||
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((L"Runes 1 - 6: ")), x, y + 109 + textOffset, diablo2::UI_COLOR_GREY, 0);
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(runebag_RunesA)).c_str()), x + z, y + 109 + textOffset, diablo2::UI_COLOR_GREY, 0);
|
||||
// Displaying the names for Runes 7-12: Tal, Ral, Ort, Thul, Amn, Sol
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((L"Tal Runes:")), x, y + 121 + textOffset, diablo2::UI_COLOR_GREY, 0);
|
||||
if (runebag_RunesB > 0) {
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(runebag_RunesB)).c_str()), x + z, y + 121 + textOffset, diablo2::UI_COLOR_WHITE, 0);
|
||||
}
|
||||
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((L"Runes 7 - 12: ")), x, y + 121 + textOffset, diablo2::UI_COLOR_GREY, 0);
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(runebag_RunesB)).c_str()), x + z, y + 121 + textOffset, diablo2::UI_COLOR_GREY, 0);
|
||||
// Displaying the names for Runes 13-18: Shael, Dol, Hel, Io, Lum, Ko
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((L"Shael Runes:")), x, y + 133 + textOffset, diablo2::UI_COLOR_GREY, 0);
|
||||
if (runebag_RunesC > 0) {
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(runebag_RunesC)).c_str()), x + z, y + 133 + textOffset, diablo2::UI_COLOR_WHITE, 0);
|
||||
}
|
||||
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((L"Runes 13 - 18: ")), x, y + 133 + textOffset, diablo2::UI_COLOR_GREY, 0);
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(runebag_RunesC)).c_str()), x + z, y + 133 + textOffset, diablo2::UI_COLOR_GREY, 0);
|
||||
// Displaying the names for Runes 19-24: Fal, Lem, Pul, Um, Mal, Ist
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((L"Fal Runes:")), x, y + 145 + textOffset, diablo2::UI_COLOR_GREY, 0);
|
||||
if (runebag_RunesD > 0) {
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(runebag_RunesD)).c_str()), x + z, y + 145 + textOffset, diablo2::UI_COLOR_WHITE, 0);
|
||||
}
|
||||
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((L"Runes 19 - 24: ")), x, y + 145 + textOffset, diablo2::UI_COLOR_GREY, 0);
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(runebag_RunesD)).c_str()), x + z, y + 145 + textOffset, diablo2::UI_COLOR_GREY, 0);
|
||||
// Displaying the names for Runes 25-30: Gul, Vex, Ohm, Lo, Sur, Ber
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((L"Gul Runes:")), x, y + 157 + textOffset, diablo2::UI_COLOR_GREY, 0);
|
||||
if (runebag_RunesE > 0) {
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(runebag_RunesE)).c_str()), x + z, y + 157 + textOffset, diablo2::UI_COLOR_WHITE, 0);
|
||||
}
|
||||
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((L"Runes 25 - 30: ")), x, y + 157 + textOffset, diablo2::UI_COLOR_GREY, 0);
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(runebag_RunesE)).c_str()), x + z, y + 157 + textOffset, diablo2::UI_COLOR_GREY, 0);
|
||||
// Displaying the names for Runes 31-33: Jah, Cham, Zod
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((L"Jah Runes:")), x, y + 169 + textOffset, diablo2::UI_COLOR_GREY, 0);
|
||||
if (runebag_RunesF > 0) {
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(runebag_RunesF)).c_str()), x + z, y + 169 + textOffset, diablo2::UI_COLOR_WHITE, 0);
|
||||
}
|
||||
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((L"Runes 31 - 33: ")), x, y + 169 + textOffset, diablo2::UI_COLOR_GREY, 0);
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(runebag_RunesF)).c_str()), x + z, y + 169 + textOffset, diablo2::UI_COLOR_GREY, 0);
|
||||
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((L"Rejuv Potions: ")), x, y + 191 + textOffset, diablo2::UI_COLOR_PURPLE, 0);
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(gembag_Potions)).c_str()), x + z, y + 191 + textOffset, diablo2::UI_COLOR_PURPLE, 0);
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((L"Rejuv ")), x, y + 191 + textOffset, diablo2::UI_COLOR_PURPLE, 0);
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((L"& Misc Potions: ")), x + 48, y + 191 + textOffset, diablo2::UI_COLOR_WHITE, 0);
|
||||
if (gembag_Potions > 0) {
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(gembag_Potions)).c_str()), x + z, y + 191 + textOffset, diablo2::UI_COLOR_WHITE, 0);
|
||||
}
|
||||
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((L"Healing Potions: ")), x, y + 213 + textOffset, diablo2::UI_COLOR_RED, 0);
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(gembag_PotionsHP)).c_str()), x + z, y + 213 + textOffset, diablo2::UI_COLOR_RED, 0);
|
||||
if (gembag_PotionsHP > 0) {
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(gembag_PotionsHP)).c_str()), x + z, y + 213 + textOffset, diablo2::UI_COLOR_RED, 0);
|
||||
}
|
||||
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((L"Mana Potions: ")), x, y + 225 + textOffset, diablo2::UI_COLOR_BLUE, 0);
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(gembag_PotionsMana)).c_str()), x + z, y + 225 + textOffset, diablo2::UI_COLOR_BLUE, 0);
|
||||
if (gembag_PotionsMana > 0) {
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(gembag_PotionsMana)).c_str()), x + z, y + 225 + textOffset, diablo2::UI_COLOR_BLUE, 0);
|
||||
}
|
||||
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((L"Flourite Stones: ")), x, y + 247 + textOffset, diablo2::UI_COLOR_RED, 0);
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(gembag_Stones_Flourite)).c_str()), x + z, y + 247 + textOffset, diablo2::UI_COLOR_RED, 0);
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((L"Flourite Stones: ")), x, y + 247 + textOffset, diablo2::UI_COLOR_PURPLE, 0);
|
||||
if (gembag_Stones_Flourite > 0) {
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(gembag_Stones_Flourite)).c_str()), x + z, y + 247 + textOffset, diablo2::UI_COLOR_BLUE, 0);
|
||||
}
|
||||
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((L"Jade Stones: ")), x, y + 259 + textOffset, diablo2::UI_COLOR_LIGHT_GREEN, 0);
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(gembag_Stones_Jade)).c_str()), x + z, y + 259 + textOffset, diablo2::UI_COLOR_LIGHT_GREEN, 0);
|
||||
if (gembag_Stones_Jade > 0) {
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(gembag_Stones_Jade)).c_str()), x + z, y + 259 + textOffset, diablo2::UI_COLOR_LIGHT_GREEN, 0);
|
||||
}
|
||||
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((L"Argonite Stones: ")), x, y + 271 + textOffset, diablo2::UI_COLOR_RED, 0);
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(gembag_Stones_Argonite)).c_str()), x + z, y + 271 + textOffset, diablo2::UI_COLOR_RED, 0);
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((L"Argonite Stones: ")), x, y + 271 + textOffset, diablo2::UI_COLOR_WHITE, 0);
|
||||
if (gembag_Stones_Argonite > 0) {
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(gembag_Stones_Argonite)).c_str()), x + z, y + 271 + textOffset, diablo2::UI_COLOR_WHITE, 0);
|
||||
}
|
||||
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((L"Azurite Stones: ")), x, y + 283 + textOffset, diablo2::UI_COLOR_BLUE, 0);
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(gembag_Stones_Azurite)).c_str()), x + z, y + 283 + textOffset, diablo2::UI_COLOR_BLUE, 0);
|
||||
if (gembag_Stones_Azurite > 0) {
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(gembag_Stones_Azurite)).c_str()), x + z, y + 283 + textOffset, diablo2::UI_COLOR_BLUE, 0);
|
||||
}
|
||||
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((L"Sulpher Stones: ")), x, y + 295 + textOffset, diablo2::UI_COLOR_ORANGE, 0);
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(gembag_Stones_Sulpher)).c_str()), x + z, y + 295 + textOffset, diablo2::UI_COLOR_ORANGE, 0);
|
||||
if (gembag_Stones_Sulpher > 0) {
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(gembag_Stones_Sulpher)).c_str()), x + z, y + 295 + textOffset, diablo2::UI_COLOR_ORANGE, 0);
|
||||
}
|
||||
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((L"Quartz Stones: ")), x, y + 307 + textOffset, diablo2::UI_COLOR_WHITE, 0);
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(gembag_Stones_Quartz)).c_str()), x + z, y + 307 + textOffset, diablo2::UI_COLOR_WHITE, 0);
|
||||
if (gembag_Stones_Quartz > 0) {
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(gembag_Stones_Quartz)).c_str()), x + z, y + 307 + textOffset, diablo2::UI_COLOR_WHITE,
|
||||
0);
|
||||
}
|
||||
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((L"Tiger Eye Stones: ")), x, y + 319 + textOffset, diablo2::UI_COLOR_YELLOW, 0);
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(gembag_Stones_TigerEye)).c_str()), x + z, y + 319 + textOffset, diablo2::UI_COLOR_YELLOW, 0);
|
||||
|
||||
|
||||
diablo2::d2_win::set_current_font(diablo2::UI_FONT_16);
|
||||
|
||||
// print a string using draw_text
|
||||
// diablo2::d2_win::draw_text(const_cast<wchar_t*>((L"Gem/Rune/Stone/Potion Extract Menu")), 10, 25, diablo2::UI_COLOR_YELLOW, 0);
|
||||
|
||||
diablo2::d2_win::set_current_font(diablo2::UI_FONT_16);
|
||||
|
||||
|
||||
diablo2::d2_gfx::draw_filled_rect(0, 0, 100, 100, 113, 0);
|
||||
|
||||
|
||||
|
||||
if (gembag_Stones_TigerEye > 0) {
|
||||
diablo2::d2_win::draw_text(const_cast<wchar_t*>((std::to_wstring(gembag_Stones_TigerEye)).c_str()), x + z, y + 319 + textOffset, diablo2::UI_COLOR_YELLOW, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void d2_tweaks::client::modules::loot_filter_settings_menu::reload_settings() {
|
||||
register_misc_checkboxes();
|
||||
register_quality_checkboxes();
|
||||
@@ -623,6 +625,25 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::register_misc_checkb
|
||||
m_show_mp4 = get_control<ui::controls::checkbox>("m_show_mp4");
|
||||
m_show_mp5 = get_control<ui::controls::checkbox>("m_show_mp5");
|
||||
|
||||
m_show_frp = get_control<ui::controls::checkbox>("m_show_frp");
|
||||
m_show_mrp = get_control<ui::controls::checkbox>("m_show_mrp");
|
||||
m_show_prp = get_control<ui::controls::checkbox>("m_show_prp");
|
||||
m_show_crp = get_control<ui::controls::checkbox>("m_show_crp");
|
||||
m_show_lrp = get_control<ui::controls::checkbox>("m_show_lrp");
|
||||
m_show_vps = get_control<ui::controls::checkbox>("m_show_vps");
|
||||
m_show_yps = get_control<ui::controls::checkbox>("m_show_yps");
|
||||
m_show_wms = get_control<ui::controls::checkbox>("m_show_wms");
|
||||
|
||||
m_close = get_control<ui::controls::checkbox>("m_close");
|
||||
|
||||
|
||||
if (m_close) {
|
||||
m_close->set_state(loot_filter_settings::get().m_show_close);
|
||||
m_close->set_on_click(std::bind(&loot_filter_settings_menu::close_window,
|
||||
this, std::placeholders::_1));
|
||||
}
|
||||
|
||||
|
||||
|
||||
// potions
|
||||
{
|
||||
@@ -698,9 +719,55 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::register_misc_checkb
|
||||
this, std::placeholders::_1));
|
||||
}
|
||||
|
||||
// misc potions
|
||||
|
||||
if (m_show_frp) {
|
||||
m_show_frp->set_state(loot_filter_settings::get().m_show_frp);
|
||||
m_show_frp->set_on_click(std::bind(&loot_filter_settings_menu::extract_frp,
|
||||
this, std::placeholders::_1));
|
||||
}
|
||||
|
||||
if (m_show_mrp) {
|
||||
m_show_mrp->set_state(loot_filter_settings::get().m_show_mrp);
|
||||
m_show_mrp->set_on_click(std::bind(&loot_filter_settings_menu::extract_mrp,
|
||||
this, std::placeholders::_1));
|
||||
}
|
||||
|
||||
if (m_show_prp) {
|
||||
m_show_prp->set_state(loot_filter_settings::get().m_show_prp);
|
||||
m_show_prp->set_on_click(std::bind(&loot_filter_settings_menu::extract_prp,
|
||||
this, std::placeholders::_1));
|
||||
}
|
||||
|
||||
if (m_show_crp) {
|
||||
m_show_crp->set_state(loot_filter_settings::get().m_show_crp);
|
||||
m_show_crp->set_on_click(std::bind(&loot_filter_settings_menu::extract_crp,
|
||||
this, std::placeholders::_1));
|
||||
}
|
||||
|
||||
if (m_show_lrp) {
|
||||
m_show_lrp->set_state(loot_filter_settings::get().m_show_lrp);
|
||||
m_show_lrp->set_on_click(std::bind(&loot_filter_settings_menu::extract_lrp,
|
||||
this, std::placeholders::_1));
|
||||
}
|
||||
|
||||
if (m_show_vps) {
|
||||
m_show_vps->set_state(loot_filter_settings::get().m_show_vps);
|
||||
m_show_vps->set_on_click(std::bind(&loot_filter_settings_menu::extract_vps,
|
||||
this, std::placeholders::_1));
|
||||
}
|
||||
|
||||
if (m_show_yps) {
|
||||
m_show_yps->set_state(loot_filter_settings::get().m_show_yps);
|
||||
m_show_yps->set_on_click(std::bind(&loot_filter_settings_menu::extract_yps,
|
||||
this, std::placeholders::_1));
|
||||
}
|
||||
|
||||
if (m_show_wms) {
|
||||
m_show_wms->set_state(loot_filter_settings::get().m_show_wms);
|
||||
m_show_wms->set_on_click(std::bind(&loot_filter_settings_menu::extract_wms,
|
||||
this, std::placeholders::_1));
|
||||
}
|
||||
}
|
||||
|
||||
// gems
|
||||
@@ -1178,7 +1245,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_item(bool va
|
||||
packet.val = -val;
|
||||
diablo2::d2_client::send_to_server(&packet, sizeof packet);
|
||||
|
||||
D2PropertyStrc itemProperty = {};
|
||||
diablo2::structures::D2PropertyStrc itemProperty = {};
|
||||
itemProperty.nProperty = prop - 3; // Adjust the property ID
|
||||
itemProperty.nLayer = 0;
|
||||
itemProperty.nMin = -val;
|
||||
@@ -1190,14 +1257,25 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_item(bool va
|
||||
|
||||
// potions
|
||||
|
||||
#include <d2tweaks/client/modules/loot_filter/loot_filter_settings_toggle_menu.h>
|
||||
|
||||
void d2_tweaks::client::modules::loot_filter_settings_menu::close_window(bool value) {
|
||||
auto& toggle_menu = singleton<loot_filter_settings_toggle_menu>::instance();
|
||||
toggle_menu.m_show = false;
|
||||
m_stats_enabled = true;
|
||||
toggle_menu.m_filter_settings_menu->set_enabled(false);
|
||||
toggle_menu.m_filter_settings_menu->set_visible(false);
|
||||
toggle_menu.toggle_cube_click();
|
||||
}
|
||||
|
||||
void d2_tweaks::client::modules::loot_filter_settings_menu::extract_rejuv_potion(bool value) {
|
||||
loot_filter_settings::get().m_show_rejuv_potion = value;
|
||||
extract_item(value, 396, 1, 'rvs ', diablo2::UNIT_STAT_gembag_Potions);
|
||||
extract_item(value, 396, 1000, 'rvs ', diablo2::UNIT_STAT_gembag_Potions);
|
||||
}
|
||||
|
||||
void d2_tweaks::client::modules::loot_filter_settings_menu::extract_full_rejuv_potion(bool value) {
|
||||
loot_filter_settings::get().m_show_full_rejuv_potion = value;
|
||||
extract_item(value, 396, 3, 'rvl ', diablo2::UNIT_STAT_gembag_Potions);
|
||||
extract_item(value, 396, 3000, 'rvl ', diablo2::UNIT_STAT_gembag_Potions);
|
||||
}
|
||||
|
||||
// stones
|
||||
@@ -1334,7 +1412,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_blemished(bo
|
||||
}
|
||||
|
||||
loot_filter_settings::get().m_show_rough = value;
|
||||
extract_item(value, gemPropRowID, 8, gemCode, stat);
|
||||
extract_item(value, gemPropRowID, 4, gemCode, stat);
|
||||
}
|
||||
|
||||
void d2_tweaks::client::modules::loot_filter_settings_menu::extract_cleaned(bool value) {
|
||||
@@ -1379,7 +1457,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_cleaned(bool
|
||||
}
|
||||
|
||||
loot_filter_settings::get().m_show_rough = value;
|
||||
extract_item(value, gemPropRowID, 16, gemCode, stat);
|
||||
extract_item(value, gemPropRowID, 8, gemCode, stat);
|
||||
}
|
||||
|
||||
void d2_tweaks::client::modules::loot_filter_settings_menu::extract_triangle(bool value) {
|
||||
@@ -1424,7 +1502,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_triangle(boo
|
||||
}
|
||||
|
||||
loot_filter_settings::get().m_show_rough = value;
|
||||
extract_item(value, gemPropRowID, 32, gemCode, stat);
|
||||
extract_item(value, gemPropRowID, 16, gemCode, stat);
|
||||
}
|
||||
|
||||
void d2_tweaks::client::modules::loot_filter_settings_menu::extract_trangle_cut(bool value) {
|
||||
@@ -1469,7 +1547,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_trangle_cut(
|
||||
}
|
||||
|
||||
loot_filter_settings::get().m_show_rough = value;
|
||||
extract_item(value, gemPropRowID, 64, gemCode, stat);
|
||||
extract_item(value, gemPropRowID, 32, gemCode, stat);
|
||||
}
|
||||
|
||||
void d2_tweaks::client::modules::loot_filter_settings_menu::extract_square(bool value) {
|
||||
@@ -1514,7 +1592,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_square(bool
|
||||
}
|
||||
|
||||
loot_filter_settings::get().m_show_rough = value;
|
||||
extract_item(value, gemPropRowID, 128, gemCode, stat);
|
||||
extract_item(value, gemPropRowID, 64, gemCode, stat);
|
||||
}
|
||||
|
||||
void d2_tweaks::client::modules::loot_filter_settings_menu::extract_square_cut(bool value) {
|
||||
@@ -1559,7 +1637,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_square_cut(b
|
||||
}
|
||||
|
||||
loot_filter_settings::get().m_show_rough = value;
|
||||
extract_item(value, gemPropRowID, 256, gemCode, stat);
|
||||
extract_item(value, gemPropRowID, 128, gemCode, stat);
|
||||
}
|
||||
|
||||
void d2_tweaks::client::modules::loot_filter_settings_menu::extract_regular(bool value) {
|
||||
@@ -1604,7 +1682,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_regular(bool
|
||||
}
|
||||
|
||||
loot_filter_settings::get().m_show_rough = value;
|
||||
extract_item(value, gemPropRowID, 512, gemCode, stat);
|
||||
extract_item(value, gemPropRowID, 256, gemCode, stat);
|
||||
}
|
||||
|
||||
void d2_tweaks::client::modules::loot_filter_settings_menu::extract_regular_cut(bool value) {
|
||||
@@ -1649,7 +1727,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_regular_cut(
|
||||
}
|
||||
|
||||
loot_filter_settings::get().m_show_rough = value;
|
||||
extract_item(value, gemPropRowID, 1024, gemCode, stat);
|
||||
extract_item(value, gemPropRowID, 512, gemCode, stat);
|
||||
}
|
||||
|
||||
void d2_tweaks::client::modules::loot_filter_settings_menu::extract_star(bool value) {
|
||||
@@ -1694,7 +1772,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_star(bool va
|
||||
}
|
||||
|
||||
loot_filter_settings::get().m_show_rough = value;
|
||||
extract_item(value, gemPropRowID, 2048, gemCode, stat);
|
||||
extract_item(value, gemPropRowID, 1024, gemCode, stat);
|
||||
}
|
||||
|
||||
void d2_tweaks::client::modules::loot_filter_settings_menu::extract_star_cut(bool value) {
|
||||
@@ -1739,7 +1817,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_star_cut(boo
|
||||
}
|
||||
|
||||
loot_filter_settings::get().m_show_rough = value;
|
||||
extract_item(value, gemPropRowID, 4096, gemCode, stat);
|
||||
extract_item(value, gemPropRowID, 2048, gemCode, stat);
|
||||
}
|
||||
|
||||
void d2_tweaks::client::modules::loot_filter_settings_menu::extract_imperial(bool value) {
|
||||
@@ -1784,7 +1862,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_imperial(boo
|
||||
}
|
||||
|
||||
loot_filter_settings::get().m_show_rough = value;
|
||||
extract_item(value, gemPropRowID, 8192, gemCode, stat);
|
||||
extract_item(value, gemPropRowID, 4096, gemCode, stat);
|
||||
}
|
||||
|
||||
void d2_tweaks::client::modules::loot_filter_settings_menu::extract_imperial_cut(bool value) {
|
||||
@@ -1829,7 +1907,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_imperial_cut
|
||||
}
|
||||
|
||||
loot_filter_settings::get().m_show_rough = value;
|
||||
extract_item(value, gemPropRowID, 16384, gemCode, stat);
|
||||
extract_item(value, gemPropRowID, 8192, gemCode, stat);
|
||||
}
|
||||
|
||||
void d2_tweaks::client::modules::loot_filter_settings_menu::extract_royal(bool value) {
|
||||
@@ -1874,47 +1952,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_royal(bool v
|
||||
}
|
||||
|
||||
loot_filter_settings::get().m_show_rough = value;
|
||||
auto player = diablo2::d2_client::get_local_player();
|
||||
auto inventory = player->inventory;
|
||||
diablo2::structures::unit* bag;
|
||||
uint32_t bagGuid = -1;
|
||||
uint32_t statValue = 0;
|
||||
|
||||
for (auto item = 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);
|
||||
auto recordType = diablo2::d2_common::get_item_type_record(record->type);
|
||||
char* normCode1 = record->string_code;
|
||||
if (strncmp(normCode1, "ib1", 3) == 0) {
|
||||
bag = item;
|
||||
bagGuid = item->guid;
|
||||
statValue = diablo2::d2_common::get_stat(item, stat, NULL);
|
||||
}
|
||||
}
|
||||
if (statValue >= 16384) {
|
||||
auto current_time = std::chrono::steady_clock::now();
|
||||
auto elapsed_time = std::chrono::duration_cast<std::chrono::milliseconds>(current_time - m_last_packet_sent);
|
||||
|
||||
if (elapsed_time.count() >= 500) {
|
||||
static d2_tweaks::common::item_move_cs packet;
|
||||
packet.item_guid = bagGuid;
|
||||
packet.bag_guid = bagGuid;
|
||||
packet.target_page = 0;
|
||||
packet.extract = 1;
|
||||
packet.iCode = gemCode;
|
||||
packet.prop = gemPropRowID - 3;
|
||||
packet.val = -16384;
|
||||
|
||||
diablo2::d2_client::send_to_server(&packet, sizeof packet);
|
||||
m_last_packet_sent = current_time;
|
||||
}
|
||||
|
||||
D2PropertyStrc itemProperty = {};
|
||||
itemProperty.nProperty = gemPropRowID - 3; // Adjust the property ID
|
||||
itemProperty.nLayer = 0;
|
||||
itemProperty.nMin = -16384;
|
||||
itemProperty.nMax = -16384;
|
||||
diablo2::d2_common::add_property(bag, &itemProperty, 0);
|
||||
}
|
||||
extract_item(value, gemPropRowID, 16384, gemCode, stat);
|
||||
}
|
||||
|
||||
void d2_tweaks::client::modules::loot_filter_settings_menu::extract_royal_cut(bool value) {
|
||||
@@ -1959,47 +1997,7 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_royal_cut(bo
|
||||
}
|
||||
|
||||
loot_filter_settings::get().m_show_rough = value;
|
||||
auto player = diablo2::d2_client::get_local_player();
|
||||
auto inventory = player->inventory;
|
||||
diablo2::structures::unit* bag;
|
||||
uint32_t bagGuid = -1;
|
||||
uint32_t statValue = 0;
|
||||
|
||||
for (auto item = 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);
|
||||
auto recordType = diablo2::d2_common::get_item_type_record(record->type);
|
||||
char* normCode1 = record->string_code;
|
||||
if (strncmp(normCode1, "ib1", 3) == 0) {
|
||||
bag = item;
|
||||
bagGuid = item->guid;
|
||||
statValue = diablo2::d2_common::get_stat(item, stat, NULL);
|
||||
}
|
||||
}
|
||||
if (statValue >= 32768) {
|
||||
auto current_time = std::chrono::steady_clock::now();
|
||||
auto elapsed_time = std::chrono::duration_cast<std::chrono::milliseconds>(current_time - m_last_packet_sent);
|
||||
|
||||
if (elapsed_time.count() >= 500) {
|
||||
static d2_tweaks::common::item_move_cs packet;
|
||||
packet.item_guid = bagGuid;
|
||||
packet.bag_guid = bagGuid;
|
||||
packet.target_page = 0;
|
||||
packet.extract = 1;
|
||||
packet.iCode = gemCode;
|
||||
packet.prop = gemPropRowID - 3;
|
||||
packet.val = -32768;
|
||||
|
||||
diablo2::d2_client::send_to_server(&packet, sizeof packet);
|
||||
m_last_packet_sent = current_time;
|
||||
}
|
||||
|
||||
D2PropertyStrc itemProperty = {};
|
||||
itemProperty.nProperty = gemPropRowID - 3; // Adjust the property ID
|
||||
itemProperty.nLayer = 0;
|
||||
itemProperty.nMin = -32768;
|
||||
itemProperty.nMax = -32768;
|
||||
diablo2::d2_common::add_property(bag, &itemProperty, 0);
|
||||
}
|
||||
extract_item(value, gemPropRowID, 32768, gemCode, stat);
|
||||
}
|
||||
|
||||
void d2_tweaks::client::modules::loot_filter_settings_menu::extract_spectacular(bool value) {
|
||||
@@ -2499,7 +2497,6 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_r33(bool val
|
||||
extract_item(value, 393, 4, 'r33 ', diablo2::UNIT_STAT_runebag_RunesF);
|
||||
}
|
||||
|
||||
|
||||
// potions
|
||||
void d2_tweaks::client::modules::loot_filter_settings_menu::extract_hp1(bool value) {
|
||||
loot_filter_settings::get().m_show_hp1 = value;
|
||||
@@ -2551,7 +2548,47 @@ void d2_tweaks::client::modules::loot_filter_settings_menu::extract_mp5(bool val
|
||||
extract_item(value, 398, 81, 'mp5 ', diablo2::UNIT_STAT_gembag_PotionsMana);
|
||||
}
|
||||
|
||||
// misc potions
|
||||
|
||||
void d2_tweaks::client::modules::loot_filter_settings_menu::extract_frp(bool value) {
|
||||
loot_filter_settings::get().m_show_frp = value;
|
||||
extract_item(value, 396, 50, 'frp ', diablo2::UNIT_STAT_gembag_Potions);
|
||||
}
|
||||
|
||||
void d2_tweaks::client::modules::loot_filter_settings_menu::extract_mrp(bool value) {
|
||||
loot_filter_settings::get().m_show_mrp = value;
|
||||
extract_item(value, 396, 50, 'mrp ', diablo2::UNIT_STAT_gembag_Potions);
|
||||
}
|
||||
|
||||
void d2_tweaks::client::modules::loot_filter_settings_menu::extract_prp(bool value) {
|
||||
loot_filter_settings::get().m_show_prp = value;
|
||||
extract_item(value, 396, 50, 'prp ', diablo2::UNIT_STAT_gembag_Potions);
|
||||
}
|
||||
|
||||
void d2_tweaks::client::modules::loot_filter_settings_menu::extract_crp(bool value) {
|
||||
loot_filter_settings::get().m_show_crp = value;
|
||||
extract_item(value, 396, 50, 'crp ', diablo2::UNIT_STAT_gembag_Potions);
|
||||
}
|
||||
|
||||
void d2_tweaks::client::modules::loot_filter_settings_menu::extract_lrp(bool value) {
|
||||
loot_filter_settings::get().m_show_lrp = value;
|
||||
extract_item(value, 396, 50, 'lrp ', diablo2::UNIT_STAT_gembag_Potions);
|
||||
}
|
||||
|
||||
void d2_tweaks::client::modules::loot_filter_settings_menu::extract_vps(bool value) {
|
||||
loot_filter_settings::get().m_show_vps = value;
|
||||
extract_item(value, 396, 5, 'vps ', diablo2::UNIT_STAT_gembag_Potions);
|
||||
}
|
||||
|
||||
void d2_tweaks::client::modules::loot_filter_settings_menu::extract_yps(bool value) {
|
||||
loot_filter_settings::get().m_show_yps = value;
|
||||
extract_item(value, 396, 10, 'yps ', diablo2::UNIT_STAT_gembag_Potions);
|
||||
}
|
||||
|
||||
void d2_tweaks::client::modules::loot_filter_settings_menu::extract_wms(bool value) {
|
||||
loot_filter_settings::get().m_show_wms = value;
|
||||
extract_item(value, 396, 15, 'wms ', diablo2::UNIT_STAT_gembag_Potions);
|
||||
}
|
||||
|
||||
// End Rune Extraction Functions
|
||||
|
||||
|
@@ -140,6 +140,9 @@ void d2_tweaks::client::modules::loot_filter_settings_toggle_menu::toggle_filter
|
||||
|
||||
m_btn_toggle_stats->set_enabled(true);
|
||||
m_btn_toggle_stats->set_visible(true);
|
||||
|
||||
toggle_cube_click();
|
||||
|
||||
}
|
||||
|
||||
void d2_tweaks::client::modules::loot_filter_settings_toggle_menu::toggle_stats_settings_click() {
|
||||
@@ -260,7 +263,7 @@ bool d2_tweaks::client::modules::loot_filter_settings_toggle_menu::key_event(uin
|
||||
// Convert the key character to uppercase for case-insensitive comparison
|
||||
char configKey = toupper(keyBuffer[0]);
|
||||
|
||||
if (key == configKey && up) {
|
||||
if (key == configKey && up && !diablo2::d2_client::get_ui_window_state(diablo2::UI_WINDOW_MSGS) && !diablo2::d2_client::get_ui_window_state(diablo2::UI_WINDOW_CHAT)) {
|
||||
m_show = !m_show;
|
||||
m_stats_enabled = !m_stats_enabled;
|
||||
|
||||
@@ -270,6 +273,8 @@ bool d2_tweaks::client::modules::loot_filter_settings_toggle_menu::key_event(uin
|
||||
m_btn_toggle_stats->set_enabled(true);
|
||||
m_btn_toggle_stats->set_visible(true);
|
||||
|
||||
toggle_cube_click();
|
||||
|
||||
return true; // Block the key stroke
|
||||
}
|
||||
|
||||
@@ -281,6 +286,8 @@ bool d2_tweaks::client::modules::loot_filter_settings_toggle_menu::key_event(uin
|
||||
m_filter_settings_menu->set_enabled(m_show);
|
||||
m_filter_settings_menu->set_visible(m_show);
|
||||
|
||||
toggle_cube_click();
|
||||
|
||||
return true; //block escape key stroke
|
||||
}
|
||||
|
||||
|
@@ -135,13 +135,13 @@ bool d2_tweaks::server::modules::autosort::sort(diablo2::structures::game* game,
|
||||
occupied_cells += record->inv_height * record->inv_width;
|
||||
}
|
||||
|
||||
spdlog::info("--------------------------------");
|
||||
spdlog::info("Item Type: {0}", record->type);
|
||||
spdlog::info("Item Type 2: {0}", record->type2);
|
||||
spdlog::info("Occupied Cells: {0}", occupied_cells);
|
||||
spdlog::info("x: {0}", backup.x);
|
||||
spdlog::info("y: {0}", backup.y);
|
||||
spdlog::info("is_charm: {0}\n\n", is_charm);
|
||||
//spdlog::info("--------------------------------");
|
||||
//spdlog::info("Item Type: {0}", record->type);
|
||||
//spdlog::info("Item Type 2: {0}", record->type2);
|
||||
//spdlog::info("Occupied Cells: {0}", occupied_cells);
|
||||
//spdlog::info("x: {0}", backup.x);
|
||||
//spdlog::info("y: {0}", backup.y);
|
||||
//spdlog::info("is_charm: {0}\n\n", is_charm);
|
||||
}
|
||||
|
||||
if (occupied_cells > inventoryHeight * inventoryWidth) {
|
||||
|
@@ -64,6 +64,62 @@ static void send_damage_data(diablo2::structures::unit* defender,
|
||||
auto currentHp = diablo2::d2_common::get_stat(defender, diablo2::UNIT_STAT_HITPOINTS, 0);
|
||||
auto maxHp = diablo2::d2_common::get_stat(defender, diablo2::UNIT_STAT_MAXHP, 0);
|
||||
|
||||
/*
|
||||
if (defender->type == diablo2::structures::unit_type_t::UNIT_TYPE_PLAYER) {
|
||||
auto player = defender;
|
||||
|
||||
// spdlog player name
|
||||
spdlog::info("Player name: {0}", player->player_data->name);
|
||||
|
||||
diablo2::d2_common::set_stat(player, diablo2::UNIT_STAT_is_champion, 100, 0);
|
||||
|
||||
// if defender is a monster, get the monster data
|
||||
if (defender->type == diablo2::structures::unit_type_t::UNIT_TYPE_MONSTER) {
|
||||
auto monsterData = defender->monster_data;
|
||||
if (monsterData) {
|
||||
bool isChampion = monsterData->is_champion;
|
||||
bool isUnique = monsterData->is_unique;
|
||||
bool isSuperUnique = monsterData->is_super_unique;
|
||||
|
||||
spdlog::info("Monster isChampion: {0}", isChampion);
|
||||
spdlog::info("Monster isUnique: {0}", isUnique);
|
||||
spdlog::info("Monster isSuperUnique: {0}", isSuperUnique);
|
||||
|
||||
// You can add these details to the packet if needed
|
||||
packet.isChampion = isChampion;
|
||||
packet.isUnique = isUnique;
|
||||
packet.isSuperUnique = isSuperUnique;
|
||||
|
||||
// if currentHP is 0, if is_champion, then set_stat for player and increment the player stat diablo2::UNIT_STAT_is_champion by 1
|
||||
if (currentHp == 0) {
|
||||
if (isChampion) {
|
||||
// get the player is_champion stat
|
||||
auto isChampionValue = diablo2::d2_common::get_stat(player, diablo2::UNIT_STAT_is_champion, 0);
|
||||
diablo2::d2_common::set_stat(player, diablo2::UNIT_STAT_is_champion, isChampionValue + 1, 0);
|
||||
MessageBoxA(NULL, "Champion killed", "Champion killed", MB_OK);
|
||||
spdlog::info("Champion killed");
|
||||
}
|
||||
// do the if condition for isUnique and isSuperUnique here
|
||||
if (isUnique) {
|
||||
// get the player is_unique stat
|
||||
auto isUniqueValue = diablo2::d2_common::get_stat(player, diablo2::UNIT_STAT_is_unique, 0);
|
||||
diablo2::d2_common::set_stat(player, diablo2::UNIT_STAT_is_unique, isUniqueValue + 1, 0);
|
||||
MessageBoxA(NULL, "Unique killed", "Unique killed", MB_OK);
|
||||
spdlog::info("Unique killed");
|
||||
}
|
||||
if (isSuperUnique) {
|
||||
// get the player is_super_unique stat
|
||||
auto isSuperUniqueValue = diablo2::d2_common::get_stat(player, diablo2::UNIT_STAT_is_super_unique, 0);
|
||||
diablo2::d2_common::set_stat(player, diablo2::UNIT_STAT_is_super_unique, isSuperUniqueValue + 1, 0);
|
||||
MessageBoxA(NULL, "SuperUnique killed", "SuperUnique killed", MB_OK);
|
||||
spdlog::info("SuperUnique killed");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
packet.unit_type = static_cast<uint8_t>(defender->type);
|
||||
packet.guid = defender->guid;
|
||||
packet.damage_type = get_damage_type(dmg);
|
||||
@@ -71,9 +127,9 @@ static void send_damage_data(diablo2::structures::unit* defender,
|
||||
packet.currentHp = currentHp / 256;
|
||||
packet.maxHp = maxHp / 256;
|
||||
|
||||
spdlog::info("currentHp: {0}", packet.currentHp);
|
||||
spdlog::info("maxHp: {0}", packet.maxHp);
|
||||
spdlog::info("damage: {0}", packet.damage);
|
||||
//spdlog::info("currentHp: {0}", packet.currentHp);
|
||||
//spdlog::info("maxHp: {0}", packet.maxHp);
|
||||
//spdlog::info("damage: {0}", packet.damage);
|
||||
|
||||
if (packet.damage_type == d2_tweaks::common::DAMAGE_TYPE_UNKNOWN)
|
||||
return;
|
||||
|
@@ -10,6 +10,7 @@
|
||||
#include <diablo2/structures/net_client.h>
|
||||
#include <diablo2/structures/item_data.h>
|
||||
#include <diablo2/structures/player_data.h>
|
||||
#include <diablo2/structures/path.h>
|
||||
|
||||
#include <spdlog/spdlog.h>
|
||||
|
||||
@@ -57,6 +58,10 @@ bool d2_tweaks::server::modules::item_move::handle_packet(diablo2::structures::g
|
||||
//MessageBox(NULL, key, "Item code", MB_OK | MB_ICONINFORMATION);
|
||||
|
||||
const auto item = instance.get_server_unit(game, itemMove->item_guid, diablo2::structures::unit_type_t::UNIT_TYPE_ITEM); //0x4 = item
|
||||
|
||||
// Get player room
|
||||
diablo2::structures::room* room = diablo2::d2_common::get_room_from_unit(player);
|
||||
|
||||
|
||||
const auto record = diablo2::d2_common::get_item_record(item->data_record_index);
|
||||
|
||||
@@ -81,7 +86,7 @@ bool d2_tweaks::server::modules::item_move::handle_packet(diablo2::structures::g
|
||||
std::string bag_guid = std::to_string(itemMove->bag_guid);
|
||||
//MessageBox(NULL, bag_guid.c_str(), "Bag GUID", MB_OK | MB_ICONINFORMATION);
|
||||
|
||||
D2PropertyStrc itemProperty = {};
|
||||
diablo2::structures::D2PropertyStrc itemProperty = {};
|
||||
itemProperty.nProperty = itemMove->prop; // Adjust the property ID
|
||||
itemProperty.nLayer = 0;
|
||||
itemProperty.nMin = itemMove->val;
|
||||
@@ -98,7 +103,7 @@ bool d2_tweaks::server::modules::item_move::handle_packet(diablo2::structures::g
|
||||
diablo2::d2_game::D2GAME_Transmogrify_6FC4A660(game, player, item);
|
||||
}
|
||||
else if (itemMove->updateBag == 1) {
|
||||
D2PropertyStrc itemProperty = {};
|
||||
diablo2::structures::D2PropertyStrc itemProperty = {};
|
||||
itemProperty.nProperty = itemMove->prop;
|
||||
itemProperty.nLayer = 0;
|
||||
itemProperty.nMin = itemMove->val;
|
||||
@@ -107,7 +112,7 @@ bool d2_tweaks::server::modules::item_move::handle_packet(diablo2::structures::g
|
||||
|
||||
diablo2::d2_common::inv_remove_item(player->inventory, item);
|
||||
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (item == nullptr)
|
||||
return true; //block further packet processing
|
||||
|
@@ -39,6 +39,7 @@
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
#include <CommCtrl.h> // Include for edit control
|
||||
#include <d2tweaks/client/modules/loot_filter/loot_filter_settings_toggle_menu.h>
|
||||
|
||||
// Define a static variable to keep track of the last time the stash window was toggled
|
||||
static std::chrono::steady_clock::time_point lastToggleTime;
|
||||
@@ -150,7 +151,7 @@ const char* ITEMS_armor_and_weapons[] = {
|
||||
"pa8", "pa9", "paa", "ne6", "ne7", "ne8", "ne9", "nea", "drb", "drc",
|
||||
"drd", "dre", "drf", "bab", "bac", "bad", "bae", "baf", "pab", "pac",
|
||||
"pad", "pae", "paf", "neb", "neg", "ned", "nee", "nef", "tor", "ooc",
|
||||
"eaq", "ebq", "ib1", "ib3", "aqv", "cqv"
|
||||
"eaq", "ebq", "ib3", "aqv", "cqv"
|
||||
|
||||
// demon keys/chests
|
||||
"dkr1", "dkr2", "dkr3", "dkr4", "dkr5", "da1", "db1", "dc1"
|
||||
@@ -158,7 +159,10 @@ const char* ITEMS_armor_and_weapons[] = {
|
||||
"afr", "afy", "afp", "af0", "afx", "afh", "afq", "afj", "aft", "afi",
|
||||
"afe", "afg", "afk", "ae7", "afn", "ae8", "afl", "ae9", "afv", "afz",
|
||||
"af3", "af1", "afm", "af5", "afc", "afo", "afw", "afs", "af2", "afd",
|
||||
"afb", "af4", "afu"
|
||||
"afb", "af4", "afu",
|
||||
|
||||
// rings/amulets
|
||||
"rin", "amu", "jew"
|
||||
};
|
||||
|
||||
const char* ITEMS_gems_and_runes[] = {
|
||||
@@ -513,7 +517,6 @@ bool isStoneCode(const char* normCode) {
|
||||
auto D2CLIENT_StoredTickCount1 = GetTickCount();
|
||||
|
||||
void sendPacketAndUpdateProperty(int gemBagGuid, uint32_t iCode, int prop, int val, int item_guid, diablo2::structures::unit* gemBag) {
|
||||
|
||||
// get item using item guid
|
||||
|
||||
if (250 < GetTickCount() - D2CLIENT_StoredTickCount1) {
|
||||
@@ -530,7 +533,7 @@ void sendPacketAndUpdateProperty(int gemBagGuid, uint32_t iCode, int prop, int v
|
||||
packet.target_page = 99;
|
||||
diablo2::d2_client::send_to_server(&packet, sizeof packet);
|
||||
|
||||
D2PropertyStrc itemProperty = {};
|
||||
diablo2::structures::D2PropertyStrc itemProperty = {};
|
||||
itemProperty.nProperty = prop - 3; // Adjust the property ID
|
||||
itemProperty.nLayer = 0;
|
||||
itemProperty.nMin = val;
|
||||
@@ -539,8 +542,6 @@ void sendPacketAndUpdateProperty(int gemBagGuid, uint32_t iCode, int prop, int v
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
LRESULT d2_tweaks::ui::ui_manager::wnd_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) {
|
||||
static auto& instance = singleton<ui_manager>::instance();
|
||||
|
||||
@@ -773,6 +774,7 @@ LRESULT d2_tweaks::ui::ui_manager::wnd_proc(HWND hWnd, UINT msg, WPARAM wParam,
|
||||
// Check if the current page is the stash or inventory, right click on gem/rune will
|
||||
// add it to the cube and send it to page 99 which is non existent
|
||||
// (hope it doesn't bloat save file size and actualy disappears from memory)
|
||||
/*
|
||||
if (currentPage == 0 || currentPage == 4) {
|
||||
// Check if the stash or inventory window is open
|
||||
if (diablo2::d2_client::get_ui_window_state(diablo2::UI_WINDOW_STASH) ||
|
||||
@@ -788,7 +790,7 @@ LRESULT d2_tweaks::ui::ui_manager::wnd_proc(HWND hWnd, UINT msg, WPARAM wParam,
|
||||
// Check if the code of the hovered item matches the current gem type
|
||||
if (strncmp(normCode, key, 3) == 0) {
|
||||
// Create a D2PropertyStrc structure to represent the gem property
|
||||
D2PropertyStrc itemProperty = {};
|
||||
diablo2::structures::D2PropertyStrc itemProperty = {};
|
||||
itemProperty.nProperty = value.rowID - 3; // Adjust the property ID
|
||||
itemProperty.nLayer = 0;
|
||||
itemProperty.nMin = value.chippedCount;
|
||||
@@ -859,7 +861,7 @@ LRESULT d2_tweaks::ui::ui_manager::wnd_proc(HWND hWnd, UINT msg, WPARAM wParam,
|
||||
// Check if the code of the hovered item matches the current gem type
|
||||
if (strncmp(normCode, key, 3) == 0) {
|
||||
// Create a D2PropertyStrc structure to represent the gem property
|
||||
D2PropertyStrc itemProperty = {};
|
||||
diablo2::structures::D2PropertyStrc itemProperty = {};
|
||||
itemProperty.nProperty = value.rowID - 3; // Adjust the property ID
|
||||
itemProperty.nLayer = 0;
|
||||
itemProperty.nMin = value.chippedCount;
|
||||
@@ -980,6 +982,11 @@ LRESULT d2_tweaks::ui::ui_manager::wnd_proc(HWND hWnd, UINT msg, WPARAM wParam,
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// For armor and weapon codes, right click will move the item to the stash or cube and transmute
|
||||
if (isArmorOrWeaponCode(normCode)
|
||||
@@ -1039,6 +1046,62 @@ LRESULT d2_tweaks::ui::ui_manager::wnd_proc(HWND hWnd, UINT msg, WPARAM wParam,
|
||||
// Clear the hovered item after processing
|
||||
(*reinterpret_cast<diablo2::structures::unit**>(diablo2::d2_client::get_base() + 0x1158F4)) = nullptr;
|
||||
}
|
||||
|
||||
if (strncmp(normCode, "ib1", 3) == 0) {
|
||||
// we need to get instance of loot_filter_settings_menu class singleton
|
||||
auto& toggle_menu = singleton<d2_tweaks::client::modules::loot_filter_settings_toggle_menu>::instance();
|
||||
|
||||
toggle_menu.m_show = !toggle_menu.m_show;
|
||||
|
||||
m_stats_enabled = !m_stats_enabled;
|
||||
|
||||
toggle_menu.m_filter_settings_menu->set_enabled(toggle_menu.m_show);
|
||||
toggle_menu.m_filter_settings_menu->set_visible(toggle_menu.m_show);
|
||||
}
|
||||
|
||||
|
||||
if (strncmp(normCode, "r01", 3) == 0) {
|
||||
auto localPlayer = diablo2::d2_client::get_local_player();
|
||||
diablo2::structures::path* playerPath = localPlayer->path;
|
||||
//diablo2::structures::room* pRoom = playerPath->pt_room;
|
||||
//diablo2::structures::game* pGame = player->game;
|
||||
//struct D2UnkMonCreateStrc
|
||||
//{
|
||||
// diablo2::structures::game* pGame; //0x00
|
||||
// diablo2::structures::room* pRoom; //0x04
|
||||
// DWORD pRoomCoordList; //0x08
|
||||
// int32_t nMonsterId; //0x0C
|
||||
// int32_t nAnimMode; //0x10
|
||||
// int32_t nUnitGUID; //0x14
|
||||
// int32_t nX; //0x18
|
||||
// int32_t nY; //0x1C
|
||||
// int32_t field_20; //0x20
|
||||
// int16_t nFlags; //0x24
|
||||
//};
|
||||
//auto nX = playerPath->mapx + 50;
|
||||
//auto nY = playerPath->mapy + 50;
|
||||
////auto nMonsterId = 1272;
|
||||
////int32_t nMode = 1;
|
||||
////auto rubyGolem = diablo2::d2_game::D2GAME_SpawnMonster_6FC69F10(pGame, pRoom, nX, nY, nMonsterId, nMode, -1, 0);
|
||||
|
||||
//// Create a packet to move an item
|
||||
//static d2_tweaks::common::item_move_cs packet;
|
||||
//packet.item_guid = g_hoverItem->guid;
|
||||
//packet.item_code = normCode;
|
||||
//packet.target_page = 99;
|
||||
//packet.summon = 1;
|
||||
//packet.x = nX;
|
||||
//packet.y = nY;
|
||||
//diablo2::d2_client::send_to_server(&packet, sizeof packet);
|
||||
//diablo2::d2_common::inv_remove_item(player->inventory, g_hoverItem);
|
||||
|
||||
//// Clear the hovered item after processing
|
||||
//(*reinterpret_cast<diablo2::structures::unit**>(diablo2::d2_client::get_base() + 0x1158F4)) = nullptr;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
block = instance.process_right_mouse(false);
|
||||
@@ -1198,16 +1261,15 @@ LRESULT d2_tweaks::ui::ui_manager::wnd_proc(HWND hWnd, UINT msg, WPARAM wParam,
|
||||
|
||||
if (strncmp(normCode, "rvs", 3) == 0) {
|
||||
// Create the packet
|
||||
sendPacketAndUpdateProperty(gemBagGuid, 'rvs ', 396, 1, g_hoverItem->guid, gemBag);
|
||||
sendPacketAndUpdateProperty(gemBagGuid, 'rvs ', 396, 1000, g_hoverItem->guid, gemBag);
|
||||
diablo2::d2_common::inv_remove_item(player->inventory, g_hoverItem);
|
||||
}
|
||||
if (strncmp(normCode, "rvl", 3) == 0) {
|
||||
// Create the packet
|
||||
sendPacketAndUpdateProperty(gemBagGuid, 'rvl ', 396, 3, g_hoverItem->guid, gemBag);
|
||||
sendPacketAndUpdateProperty(gemBagGuid, 'rvl ', 396, 3000, g_hoverItem->guid, gemBag);
|
||||
diablo2::d2_common::inv_remove_item(player->inventory, g_hoverItem);
|
||||
}
|
||||
|
||||
|
||||
if (strncmp(normCode, "hp1", 3) == 0) {
|
||||
sendPacketAndUpdateProperty(gemBagGuid, 'hp1 ', 397, 1, g_hoverItem->guid, gemBag);
|
||||
diablo2::d2_common::inv_remove_item(player->inventory, g_hoverItem);
|
||||
@@ -1258,16 +1320,89 @@ LRESULT d2_tweaks::ui::ui_manager::wnd_proc(HWND hWnd, UINT msg, WPARAM wParam,
|
||||
diablo2::d2_common::inv_remove_item(player->inventory, g_hoverItem);
|
||||
}
|
||||
|
||||
// add if block for the following codes: vps, yps, wms, frp, lrp, crp, prp, mrp
|
||||
if (strncmp(normCode, "vps", 3) == 0) {
|
||||
sendPacketAndUpdateProperty(gemBagGuid, 'vps ', 396, 5, g_hoverItem->guid, gemBag);
|
||||
diablo2::d2_common::inv_remove_item(player->inventory, g_hoverItem);
|
||||
}
|
||||
|
||||
if (strncmp(normCode, "yps", 3) == 0) {
|
||||
sendPacketAndUpdateProperty(gemBagGuid, 'yps ', 396, 10, g_hoverItem->guid, gemBag);
|
||||
diablo2::d2_common::inv_remove_item(player->inventory, g_hoverItem);
|
||||
}
|
||||
|
||||
if (strncmp(normCode, "wms", 3) == 0) {
|
||||
sendPacketAndUpdateProperty(gemBagGuid, 'wms ', 396, 15, g_hoverItem->guid, gemBag);
|
||||
diablo2::d2_common::inv_remove_item(player->inventory, g_hoverItem);
|
||||
}
|
||||
|
||||
if (strncmp(normCode, "frp", 3) == 0) {
|
||||
sendPacketAndUpdateProperty(gemBagGuid, 'frp ', 396, 50, g_hoverItem->guid, gemBag);
|
||||
diablo2::d2_common::inv_remove_item(player->inventory, g_hoverItem);
|
||||
}
|
||||
|
||||
if (strncmp(normCode, "lrp", 3) == 0) {
|
||||
sendPacketAndUpdateProperty(gemBagGuid, 'lrp ', 396, 50, g_hoverItem->guid, gemBag);
|
||||
diablo2::d2_common::inv_remove_item(player->inventory, g_hoverItem);
|
||||
}
|
||||
|
||||
if (strncmp(normCode, "crp", 3) == 0) {
|
||||
sendPacketAndUpdateProperty(gemBagGuid, 'crp ', 396, 50, g_hoverItem->guid, gemBag);
|
||||
diablo2::d2_common::inv_remove_item(player->inventory, g_hoverItem);
|
||||
}
|
||||
|
||||
if (strncmp(normCode, "prp", 3) == 0) {
|
||||
sendPacketAndUpdateProperty(gemBagGuid, 'prp ', 396, 50, g_hoverItem->guid, gemBag);
|
||||
diablo2::d2_common::inv_remove_item(player->inventory, g_hoverItem);
|
||||
}
|
||||
|
||||
if (strncmp(normCode, "mrp", 3) == 0) {
|
||||
sendPacketAndUpdateProperty(gemBagGuid, 'mrp ', 396, 50, g_hoverItem->guid, gemBag);
|
||||
diablo2::d2_common::inv_remove_item(player->inventory, g_hoverItem);
|
||||
}
|
||||
|
||||
|
||||
const char* key;
|
||||
// Iterate through each gem type in the gemTypes map
|
||||
for (const auto& gem : gemTypes) {
|
||||
// Accessing the key and value of the gemTypes map
|
||||
const std::string& _key = gem.first;
|
||||
key = gem.first.c_str();
|
||||
|
||||
const GemType& value = gem.second;
|
||||
|
||||
// Check if the code of the hovered item matches the current gem type
|
||||
if (strncmp(normCode, key, 3) == 0) {
|
||||
// Create a D2PropertyStrc structure to represent the gem property
|
||||
diablo2::structures::D2PropertyStrc itemProperty = {};
|
||||
itemProperty.nProperty = value.rowID - 3; // Adjust the property ID
|
||||
itemProperty.nLayer = 0;
|
||||
itemProperty.nMin = value.chippedCount;
|
||||
itemProperty.nMax = value.chippedCount;
|
||||
|
||||
// Add the gem property to the gem bag
|
||||
diablo2::d2_common::add_property(gemBag, &itemProperty, 0);
|
||||
|
||||
// Play the drop sound associated with the hovered item
|
||||
diablo2::d2_client::play_sound(record->drop_sound, nullptr, 0, 0, 0);
|
||||
|
||||
// Create and send a packet to the server to move the item
|
||||
static d2_tweaks::common::item_move_cs packet;
|
||||
packet.item_guid = g_hoverItem->guid;
|
||||
packet.item_code = key;
|
||||
packet.bag_guid = gemBagGuid;
|
||||
packet.updateBag = 1;
|
||||
packet.prop = itemProperty.nProperty;
|
||||
packet.val = itemProperty.nMin;
|
||||
packet.target_page = 99;
|
||||
diablo2::d2_client::send_to_server(&packet, sizeof packet);
|
||||
|
||||
diablo2::d2_common::inv_remove_item(player->inventory, g_hoverItem);
|
||||
|
||||
// Clear the hovered item after processing
|
||||
(*reinterpret_cast<diablo2::structures::unit**>(diablo2::d2_client::get_base() + 0x1158F4)) = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
if (isArmorOrWeaponCode(normCode)
|
||||
|| record->type == 61 - 3 // jewel
|
||||
|
@@ -244,8 +244,8 @@ void diablo2::d2_common::update_trade(structures::inventory* inventory, structur
|
||||
// set_item_flags(item, dwFlag, bSet);
|
||||
//}
|
||||
|
||||
void diablo2::d2_common::add_property(structures::unit* item, D2PropertyStrc* prop, int nUnused) {
|
||||
static wrap_func_std_import<void(structures::unit* item, D2PropertyStrc* prop, int nUnused)> add_property(10868, get_base());
|
||||
void diablo2::d2_common::add_property(structures::unit* item, diablo2::structures::D2PropertyStrc* prop, int nUnused) {
|
||||
static wrap_func_std_import<void(structures::unit* item, diablo2::structures::D2PropertyStrc* prop, int nUnused)> add_property(10868, get_base());
|
||||
add_property(item, prop, nUnused);
|
||||
}
|
||||
|
||||
@@ -273,4 +273,21 @@ int32_t diablo2::d2_common::get_item_id_from_item_code(uint32_t dwCode) {
|
||||
diablo2::structures::items_line* diablo2::d2_common::get_item_record_from_item_code(uint32_t dwCode, int* pItemId) {
|
||||
static wrap_func_std_import<diablo2::structures::items_line* (uint32_t, int*)> get_item_record_from_item_code(10601, get_base());
|
||||
return get_item_record_from_item_code(dwCode, pItemId);
|
||||
}
|
||||
}
|
||||
|
||||
// Add a wrapper function for the following:
|
||||
// //D2Common.0x6FD5EAA0 (#10620)
|
||||
// D2COMMON_DLL_DECL D2RunesTxt* __stdcall DATATBLS_GetRunesTxtRecord(int nRunewordId);
|
||||
diablo2::structures::D2RunesTxt* diablo2::d2_common::get_runes_txt_record(int nRunewordId) {
|
||||
static wrap_func_std_import<diablo2::structures::D2RunesTxt* (int)> get_runes_txt_record(10620, get_base());
|
||||
return get_runes_txt_record(nRunewordId);
|
||||
}
|
||||
|
||||
//D2Common.0x6FD57680 (#10600)
|
||||
//D2ItemsTxt* __stdcall DATATBLS_GetItemsTxtRecord(int nItemId)
|
||||
diablo2::structures::items_line* diablo2::d2_common::get_items_txt_record(int nItemId) {
|
||||
static wrap_func_std_import<diablo2::structures::items_line* (int)> get_items_txt_record(10600, get_base());
|
||||
return get_items_txt_record(nItemId);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -3,6 +3,12 @@
|
||||
#include <diablo2/structures/npc_record.h>
|
||||
#include <common/ptr_wrapper.h>
|
||||
|
||||
DWORD D2GAME_BASE = 0x6FC30000;
|
||||
|
||||
DWORD D2GAME_GetOffset(DWORD offset) {
|
||||
return offset - D2GAME_BASE;
|
||||
}
|
||||
|
||||
char* diablo2::d2_game::get_base() {
|
||||
static auto base = reinterpret_cast<char*>(GetModuleHandle("d2game.dll"));
|
||||
return base;
|
||||
@@ -157,4 +163,106 @@ int32_t __fastcall diablo2::d2_game::D2GAME_Transmogrify_6FC4A660(diablo2::struc
|
||||
diablo2::structures::unit* __fastcall diablo2::d2_game::QUESTS_CreateItem(diablo2::structures::game* pGame, diablo2::structures::unit* pPlayer, uint32_t dwCode, int32_t nLevel, uint8_t nQuality, int32_t bDroppable) {
|
||||
static wrap_func_fast< diablo2::structures::unit* (diablo2::structures::game*, diablo2::structures::unit*, uint32_t, int32_t, uint8_t, int32_t)>QUESTS_CreateItem(0x65DF0, get_base());
|
||||
return QUESTS_CreateItem(pGame, pPlayer, dwCode, nLevel, nQuality, bDroppable);
|
||||
}
|
||||
}
|
||||
|
||||
// Add wrapper for D2Game.0x6FC603D0
|
||||
// D2MonPropTxt* __fastcall MONSTER_GetMonPropTxtRecord(int32_t nId)
|
||||
diablo2::structures::D2MonPropTxt* __fastcall diablo2::d2_game::MONSTER_GetMonPropTxtRecord(int32_t nId) {
|
||||
static wrap_func_fast<diablo2::structures::D2MonPropTxt* (int32_t)>MONSTER_GetMonPropTxtRecord(0x303D0, get_base());
|
||||
return MONSTER_GetMonPropTxtRecord(nId);
|
||||
}
|
||||
|
||||
// add wrapper for //D2Game.0x6FCBC900
|
||||
// D2UnitStrc* __stdcall SUNIT_GetTargetUnit(D2GameStrc* pGame, D2UnitStrc* pUnit)
|
||||
diablo2::structures::unit* __stdcall diablo2::d2_game::SUNIT_GetTargetUnit(structures::game* pGame, structures::unit* pUnit) {
|
||||
static wrap_func_std<diablo2::structures::unit* (diablo2::structures::game*, diablo2::structures::unit*)>SUNIT_GetTargetUnit(0x8C900, get_base());
|
||||
return SUNIT_GetTargetUnit(pGame, pUnit);
|
||||
}
|
||||
|
||||
//D2Game.0x6FCF5B90
|
||||
//D2SkillsTxt* __fastcall SKILLS_GetSkillsTxtRecord(int32_t nSkillId)
|
||||
diablo2::structures::D2SkillsTxt* __fastcall diablo2::d2_game::SKILLS_GetSkillsTxtRecord(int32_t nSkillId) {
|
||||
static wrap_func_fast<diablo2::structures::D2SkillsTxt* (int32_t)>SKILLS_GetSkillsTxtRecord(0xC5B90, get_base());
|
||||
return SKILLS_GetSkillsTxtRecord(nSkillId);
|
||||
}
|
||||
|
||||
//D2Game.0x6FD15580
|
||||
// int32_t __fastcall D2GAME_GetSummonIdFromSkill_6FD15580(D2UnitStrc* pUnit, int32_t bFromMonster, int32_t nSkillId, int32_t nSkillLevel, int32_t* pSpawnMode, int32_t* pX, int32_t* pY)
|
||||
int32_t __fastcall diablo2::d2_game::D2GAME_GetSummonIdFromSkill_6FD15580(diablo2::structures::unit* pUnit, int32_t bFromMonster, int32_t nSkillId, int32_t nSkillLevel, int32_t* pSpawnMode, int32_t* pX, int32_t* pY) {
|
||||
static wrap_func_fast<int32_t(diablo2::structures::unit*, int32_t, int32_t, int32_t, int32_t*, int32_t*, int32_t*)>D2GAME_GetSummonIdFromSkill_6FD15580(0xE5580, get_base());
|
||||
return D2GAME_GetSummonIdFromSkill_6FD15580(pUnit, bFromMonster, nSkillId, nSkillLevel, pSpawnMode, pX, pY);
|
||||
}
|
||||
|
||||
//D2Game.0x6FD14430
|
||||
//D2UnitStrc* __fastcall D2GAME_SummonPet_6FD14430(D2GameStrc* pGame, D2SummonArgStrc* pSummonArg)
|
||||
diablo2::structures::unit* __fastcall diablo2::d2_game::D2GAME_SummonPet_6FD14430(diablo2::structures::game* pGame, diablo2::structures::D2SummonArgStrc* pSummonArg) {
|
||||
static wrap_func_fast<diablo2::structures::unit* (diablo2::structures::game*, diablo2::structures::D2SummonArgStrc*)>D2GAME_SummonPet_6FD14430(0xE4430, get_base());
|
||||
return D2GAME_SummonPet_6FD14430(pGame, pSummonArg);
|
||||
}
|
||||
|
||||
|
||||
//D2Game.0x6FD0CB10
|
||||
//int32_t __fastcall D2GAME_SKILLS_SetSummonBaseStats_6FD0CB10(D2GameStrc* pGame, D2UnitStrc* pUnit, D2UnitStrc* pPet, int32_t nPetLevelArg, int32_t nSkillLevel)
|
||||
int32_t __fastcall diablo2::d2_game::D2GAME_SKILLS_SetSummonBaseStats_6FD0CB10(diablo2::structures::game* pGame, diablo2::structures::unit* pUnit, diablo2::structures::unit* pPet, int32_t nPetLevelArg, int32_t nSkillLevel) {
|
||||
static wrap_func_fast<int32_t(diablo2::structures::game*, diablo2::structures::unit*, diablo2::structures::unit*, int32_t, int32_t)>D2GAME_SKILLS_SetSummonBaseStats_6FD0CB10(D2GAME_GetOffset(0x6FD0CB10), get_base());
|
||||
return D2GAME_SKILLS_SetSummonBaseStats_6FD0CB10(pGame, pUnit, pPet, nPetLevelArg, nSkillLevel);
|
||||
}
|
||||
|
||||
//D2Game.0x6FD0C530
|
||||
//int32_t __fastcall D2GAME_SetSummonPassiveStats_6FD0C530(D2GameStrc* pGame, D2UnitStrc* pUnit, D2UnitStrc* pPet, int32_t nSkillId, int32_t nSkillLevel, int32_t nItemLevel)
|
||||
// use D2GAME_GetOffset(0x6FD0C530)
|
||||
int32_t __fastcall diablo2::d2_game::D2GAME_SetSummonPassiveStats_6FD0C530(diablo2::structures::game* pGame, diablo2::structures::unit* pUnit, diablo2::structures::unit* pPet, int32_t nSkillId, int32_t nSkillLevel, int32_t nItemLevel) {
|
||||
static wrap_func_fast<int32_t(diablo2::structures::game*, diablo2::structures::unit*, diablo2::structures::unit*, int32_t, int32_t, int32_t)>D2GAME_SetSummonPassiveStats_6FD0C530(D2GAME_GetOffset(0x6FD0C530), get_base());
|
||||
return D2GAME_SetSummonPassiveStats_6FD0C530(pGame, pUnit, pPet, nSkillId, nSkillLevel, nItemLevel);
|
||||
}
|
||||
|
||||
//D2Game.0x6FD0C2E0
|
||||
//void __fastcall D2GAME_SetSummonResistance_6FD0C2E0(D2UnitStrc* pUnit, D2UnitStrc* pPet)
|
||||
void __fastcall diablo2::d2_game::D2GAME_SetSummonResistance_6FD0C2E0(diablo2::structures::unit* pUnit, diablo2::structures::unit* pPet) {
|
||||
static wrap_func_fast<void(diablo2::structures::unit*, diablo2::structures::unit*)>D2GAME_SetSummonResistance_6FD0C2E0(D2GAME_GetOffset(0x6FD0C2E0), get_base());
|
||||
D2GAME_SetSummonResistance_6FD0C2E0(pUnit, pPet);
|
||||
}
|
||||
|
||||
//D2Game.0x6FC3E200
|
||||
//void __fastcall sub_6FC3E200(D2ClientStrc* pClient, D2UnitStrc* pUnit)
|
||||
void __fastcall diablo2::d2_game::sub_6FC3E200(diablo2::structures::net_client* pClient , diablo2::structures::unit* pUnit) {
|
||||
static wrap_func_fast<void(diablo2::structures::net_client*, diablo2::structures::unit*)>sub_6FC3E200(D2GAME_GetOffset(0x6FC3E200), get_base());
|
||||
sub_6FC3E200(pClient, pUnit);
|
||||
}
|
||||
|
||||
|
||||
//D2Game.0x6FC69F10
|
||||
//D2UnitStrc* __fastcall D2GAME_SpawnMonster_6FC69F10(D2GameStrc* pGame, D2ActiveRoomStrc* pRoom, int32_t nX, int32_t nY, int32_t nMonsterId, int32_t nAnimMode, int32_t a7, int16_t nFlags)
|
||||
diablo2::structures::unit* __fastcall diablo2::d2_game::D2GAME_SpawnMonster_6FC69F10(diablo2::structures::game* pGame, diablo2::structures::room* pRoom, int32_t nX, int32_t nY, int32_t nMonsterId, int32_t nAnimMode, int32_t a7, int16_t nFlags) {
|
||||
static wrap_func_fast<diablo2::structures::unit* (diablo2::structures::game*, diablo2::structures::room*, int32_t, int32_t, int32_t, int32_t, int32_t, int16_t)>D2GAME_SpawnMonster_6FC69F10(D2GAME_GetOffset(0x6FC69F10), get_base());
|
||||
return diablo2::d2_game::D2GAME_SpawnMonster_6FC69F10(pGame, pRoom, nX, nY, nMonsterId, nAnimMode, a7, nFlags);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
56
vendor/json/.circleci/config.yml
vendored
Normal file
56
vendor/json/.circleci/config.yml
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
version: 2
|
||||
jobs:
|
||||
build_stable:
|
||||
docker:
|
||||
- image: debian:stretch
|
||||
|
||||
steps:
|
||||
- checkout
|
||||
|
||||
- run:
|
||||
name: Install required tools
|
||||
command: 'apt-get update && apt-get install -y gcc g++ git cmake'
|
||||
- run:
|
||||
name: Run CMake
|
||||
command: 'mkdir build ; cd build ; cmake .. -DJSON_BuildTests=On'
|
||||
- run:
|
||||
name: Compile
|
||||
command: 'cmake --build build'
|
||||
- run:
|
||||
name: Execute test suite
|
||||
command: 'cd build ; ctest --output-on-failure -j 2'
|
||||
|
||||
build_bleeding_edge:
|
||||
docker:
|
||||
- image: archlinux
|
||||
|
||||
steps:
|
||||
- checkout
|
||||
|
||||
- run:
|
||||
name: Install required tools
|
||||
command: 'pacman -Sy --noconfirm base base-devel gcc git cmake'
|
||||
- run:
|
||||
name: Run CMake
|
||||
command: 'mkdir build ; cd build ; cmake .. -DJSON_BuildTests=On'
|
||||
- run:
|
||||
name: Compile
|
||||
command: 'cmake --build build'
|
||||
- run:
|
||||
name: Execute test suite
|
||||
command: 'cd build ; ctest --output-on-failure -j 2'
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
build_and_test_all:
|
||||
jobs:
|
||||
- build_stable:
|
||||
filters:
|
||||
branches:
|
||||
ignore:
|
||||
gh-pages
|
||||
- build_bleeding_edge:
|
||||
filters:
|
||||
branches:
|
||||
ignore:
|
||||
gh-pages
|
84
vendor/json/.clang-format
vendored
Normal file
84
vendor/json/.clang-format
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
#AccessModifierOffset: 2
|
||||
AlignAfterOpenBracket: Align
|
||||
AlignConsecutiveAssignments: false
|
||||
#AlignConsecutiveBitFields: false
|
||||
AlignConsecutiveDeclarations: false
|
||||
AlignConsecutiveMacros: false
|
||||
AlignEscapedNewlines: Right
|
||||
#AlignOperands: AlignAfterOperator
|
||||
AlignTrailingComments: true
|
||||
AllowAllArgumentsOnNextLine: false
|
||||
AllowAllConstructorInitializersOnNextLine: false
|
||||
AllowAllParametersOfDeclarationOnNextLine: false
|
||||
AllowShortBlocksOnASingleLine: Empty
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
#AllowShortEnumsOnASingleLine: true
|
||||
AllowShortFunctionsOnASingleLine: Empty
|
||||
AllowShortIfStatementsOnASingleLine: Never
|
||||
AllowShortLambdasOnASingleLine: Empty
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AlwaysBreakAfterReturnType: None
|
||||
AlwaysBreakBeforeMultilineStrings: false
|
||||
AlwaysBreakTemplateDeclarations: Yes
|
||||
BinPackArguments: false
|
||||
BinPackParameters: false
|
||||
#BitFieldColonSpacing: Both
|
||||
BreakBeforeBraces: Custom # or Allman
|
||||
BraceWrapping:
|
||||
AfterCaseLabel: true
|
||||
AfterClass: true
|
||||
AfterControlStatement: Always
|
||||
AfterEnum: true
|
||||
AfterFunction: true
|
||||
AfterNamespace: false
|
||||
AfterStruct: true
|
||||
AfterUnion: true
|
||||
AfterExternBlock: false
|
||||
BeforeCatch: true
|
||||
BeforeElse: true
|
||||
#BeforeLambdaBody: false
|
||||
#BeforeWhile: false
|
||||
SplitEmptyFunction: false
|
||||
SplitEmptyRecord: false
|
||||
SplitEmptyNamespace: false
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakConstructorInitializers: BeforeComma
|
||||
BreakStringLiterals: false
|
||||
ColumnLimit: 0
|
||||
CompactNamespaces: false
|
||||
ConstructorInitializerIndentWidth: 2
|
||||
Cpp11BracedListStyle: true
|
||||
PointerAlignment: Left
|
||||
FixNamespaceComments: true
|
||||
IncludeBlocks: Preserve
|
||||
#IndentCaseBlocks: false
|
||||
IndentCaseLabels: true
|
||||
IndentGotoLabels: false
|
||||
IndentPPDirectives: BeforeHash
|
||||
IndentWidth: 4
|
||||
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||
MaxEmptyLinesToKeep: 1
|
||||
NamespaceIndentation: None
|
||||
ReflowComments: false
|
||||
SortIncludes: true
|
||||
SortUsingDeclarations: true
|
||||
SpaceAfterCStyleCast: false
|
||||
SpaceAfterLogicalNot: false
|
||||
SpaceAfterTemplateKeyword: false
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
SpaceBeforeCpp11BracedList: false
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpaceBeforeRangeBasedForLoopColon: true
|
||||
SpaceBeforeSquareBrackets: false
|
||||
SpaceInEmptyBlock: false
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesBeforeTrailingComments: 2
|
||||
SpacesInAngles: false
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInConditionalStatement: false
|
||||
SpacesInContainerLiterals: false
|
||||
SpacesInParentheses: false
|
||||
SpacesInSquareBrackets: false
|
||||
Standard: c++11
|
||||
TabWidth: 4
|
||||
UseTab: Never
|
23
vendor/json/.clang-tidy
vendored
Normal file
23
vendor/json/.clang-tidy
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
Checks: '*,
|
||||
-cppcoreguidelines-avoid-goto,
|
||||
-cppcoreguidelines-avoid-magic-numbers,
|
||||
-cppcoreguidelines-macro-usage,
|
||||
-fuchsia-default-arguments-calls,
|
||||
-fuchsia-default-arguments-declarations,
|
||||
-fuchsia-overloaded-operator,
|
||||
-google-explicit-constructor,
|
||||
-google-runtime-references,
|
||||
-hicpp-avoid-goto,
|
||||
-hicpp-explicit-conversions,
|
||||
-hicpp-no-array-decay,
|
||||
-hicpp-uppercase-literal-suffix,
|
||||
-llvm-header-guard,
|
||||
-llvm-include-order,
|
||||
-misc-non-private-member-variables-in-classes,
|
||||
-modernize-use-trailing-return-type,
|
||||
-readability-magic-numbers,
|
||||
-readability-uppercase-literal-suffix'
|
||||
|
||||
CheckOptions:
|
||||
- key: hicpp-special-member-functions.AllowSoleDefaultDtor
|
||||
value: 1
|
6
vendor/json/.github/CODEOWNERS
vendored
Normal file
6
vendor/json/.github/CODEOWNERS
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
# JSON for Modern C++ has been originally written by Niels Lohmann.
|
||||
# Since 2013 over 140 contributors have helped to improve the library.
|
||||
# This CODEOWNERS file is only to make sure that @nlohmann is requested
|
||||
# for a code review in case of a pull request.
|
||||
|
||||
* @nlohmann
|
71
vendor/json/.github/CONTRIBUTING.md
vendored
Normal file
71
vendor/json/.github/CONTRIBUTING.md
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
[](http://issuestats.com/github/nlohmann/json) [](http://issuestats.com/github/nlohmann/json)
|
||||
|
||||
# How to contribute
|
||||
|
||||
This project started as a little excuse to exercise some of the cool new C++11 features. Over time, people actually started to use the JSON library (yey!) and started to help improve it by proposing features, finding bugs, or even fixing my mistakes. I am really [thankful](https://github.com/nlohmann/json/blob/master/README.md#thanks) for this and try to keep track of all the helpers.
|
||||
|
||||
To make it as easy as possible for you to contribute and for me to keep an overview, here are a few guidelines which should help us avoid all kinds of unnecessary work or disappointment. And of course, this document is subject to discussion, so please [create an issue](https://github.com/nlohmann/json/issues/new/choose) or a pull request if you find a way to improve it!
|
||||
|
||||
## Private reports
|
||||
|
||||
Usually, all issues are tracked publicly on [GitHub](https://github.com/nlohmann/json/issues). If you want to make a private report (e.g., for a vulnerability or to attach an example that is not meant to be published), please send an email to <mail@nlohmann.me>.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Please [create an issue](https://github.com/nlohmann/json/issues/new/choose), assuming one does not already exist, and describe your concern. Note you need a [GitHub account](https://github.com/signup/free) for this.
|
||||
|
||||
## Describe your issue
|
||||
|
||||
Clearly describe the issue:
|
||||
|
||||
- If it is a bug, please describe how to **reproduce** it. If possible, attach a complete example which demonstrates the error. Please also state what you **expected** to happen instead of the error.
|
||||
- If you propose a change or addition, try to give an **example** how the improved code could look like or how to use it.
|
||||
- If you found a compilation error, please tell us which **compiler** (version and operating system) you used and paste the (relevant part of) the error messages to the ticket.
|
||||
|
||||
Please stick to the provided issue templates ([bug report](https://github.com/nlohmann/json/blob/develop/.github/ISSUE_TEMPLATE/Bug_report.md), [feature request](https://github.com/nlohmann/json/blob/develop/.github/ISSUE_TEMPLATE/Feature_request.md), or [question](https://github.com/nlohmann/json/blob/develop/.github/ISSUE_TEMPLATE/question.md)) if possible.
|
||||
|
||||
## Files to change
|
||||
|
||||
:exclamation: Before you make any changes, note the single-header file [`single_include/nlohmann/json.hpp`](https://github.com/nlohmann/json/blob/develop/single_include/nlohmann/json.hpp) is **generated** from the source files in the [`include/nlohmann` directory](https://github.com/nlohmann/json/tree/develop/include/nlohmann). Please **do not** edit file `single_include/nlohmann/json.hpp` directly, but change the `include/nlohmann` sources and regenerate file `single_include/nlohmann/json.hpp` by executing `make amalgamate`.
|
||||
|
||||
To make changes, you need to edit the following files:
|
||||
|
||||
1. [`include/nlohmann/*`](https://github.com/nlohmann/json/tree/develop/include/nlohmann) - These files are the sources of the library. Before testing or creating a pull request, execute `make amalgamate` to regenerate `single_include/nlohmann/json.hpp`.
|
||||
|
||||
2. [`test/src/unit-*.cpp`](https://github.com/nlohmann/json/tree/develop/test/src) - These files contain the [doctest](https://github.com/onqtam/doctest) unit tests which currently cover [100 %](https://coveralls.io/github/nlohmann/json) of the library's code.
|
||||
|
||||
If you add or change a feature, please also add a unit test to this file. The unit tests can be compiled and executed with
|
||||
|
||||
```sh
|
||||
$ mkdir build
|
||||
$ cd build
|
||||
$ cmake ..
|
||||
$ cmake --build .
|
||||
$ ctest
|
||||
```
|
||||
|
||||
The test cases are also executed with several different compilers on [Travis](https://travis-ci.org/nlohmann/json) once you open a pull request.
|
||||
|
||||
|
||||
## Note
|
||||
|
||||
- If you open a pull request, the code will be automatically tested with [Valgrind](http://valgrind.org)'s Memcheck tool to detect memory leaks. Please be aware that the execution with Valgrind _may_ in rare cases yield different behavior than running the code directly. This can result in failing unit tests which run successfully without Valgrind.
|
||||
- There is a Makefile target `make pretty` which runs [Artistic Style](http://astyle.sourceforge.net) to fix indentation. If possible, run it before opening the pull request. Otherwise, we shall run it afterward.
|
||||
|
||||
## Please don't
|
||||
|
||||
- The C++11 support varies between different **compilers** and versions. Please note the [list of supported compilers](https://github.com/nlohmann/json/blob/master/README.md#supported-compilers). Some compilers like GCC 4.7 (and earlier), Clang 3.3 (and earlier), or Microsoft Visual Studio 13.0 and earlier are known not to work due to missing or incomplete C++11 support. Please refrain from proposing changes that work around these compiler's limitations with `#ifdef`s or other means.
|
||||
- Specifically, I am aware of compilation problems with **Microsoft Visual Studio** (there even is an [issue label](https://github.com/nlohmann/json/issues?utf8=✓&q=label%3A%22visual+studio%22+) for these kind of bugs). I understand that even in 2016, complete C++11 support isn't there yet. But please also understand that I do not want to drop features or uglify the code just to make Microsoft's sub-standard compiler happy. The past has shown that there are ways to express the functionality such that the code compiles with the most recent MSVC - unfortunately, this is not the main objective of the project.
|
||||
- Please refrain from proposing changes that would **break [JSON](https://json.org) conformance**. If you propose a conformant extension of JSON to be supported by the library, please motivate this extension.
|
||||
- We shall not extend the library to **support comments**. There is quite some [controversy](https://www.reddit.com/r/programming/comments/4v6chu/why_json_doesnt_support_comments_douglas_crockford/) around this topic, and there were quite some [issues](https://github.com/nlohmann/json/issues/376) on this. We believe that JSON is fine without comments.
|
||||
- We do not preserve the **insertion order of object elements**. The [JSON standard](https://tools.ietf.org/html/rfc7159.html) defines objects as "an unordered collection of zero or more name/value pairs". To this end, this library does not preserve insertion order of name/value pairs. (In fact, keys will be traversed in alphabetical order as `std::map` with `std::less` is used by default.) Note this behavior conforms to the standard, and we shall not change it to any other order. If you do want to preserve the insertion order, you can specialize the object type with containers like [`tsl::ordered_map`](https://github.com/Tessil/ordered-map) or [`nlohmann::fifo_map`](https://github.com/nlohmann/fifo_map).
|
||||
|
||||
- Please do not open pull requests that address **multiple issues**.
|
||||
|
||||
## Wanted
|
||||
|
||||
The following areas really need contribution:
|
||||
|
||||
- Extending the **continuous integration** toward more exotic compilers such as Android NDK, Intel's Compiler, or the bleeding-edge versions Clang.
|
||||
- Improving the efficiency of the **JSON parser**. The current parser is implemented as a naive recursive descent parser with hand coded string handling. More sophisticated approaches like LALR parsers would be really appreciated. That said, parser generators like Bison or ANTLR do not play nice with single-header files -- I really would like to keep the parser inside the `json.hpp` header, and I am not aware of approaches similar to [`re2c`](http://re2c.org) for parsing.
|
||||
- Extending and updating existing **benchmarks** to include (the most recent version of) this library. Though efficiency is not everything, speed and memory consumption are very important characteristics for C++ developers, so having proper comparisons would be interesting.
|
2
vendor/json/.github/FUNDING.yml
vendored
Normal file
2
vendor/json/.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
github: nlohmann
|
||||
custom: http://paypal.me/nlohmann
|
57
vendor/json/.github/ISSUE_TEMPLATE/Bug_report.md
vendored
Normal file
57
vendor/json/.github/ISSUE_TEMPLATE/Bug_report.md
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: 'kind: bug'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!-- Provide a concise summary of the issue in the title above. -->
|
||||
|
||||
#### What is the issue you have?
|
||||
|
||||
<!-- Provide a detailed introduction to the issue itself, and why you consider it to be a bug. -->
|
||||
<!-- If possible, be specific and add stack traces, error messages, etc. Avoid vague terms like "crash" or "doesn't work". -->
|
||||
|
||||
#### Please describe the steps to reproduce the issue.
|
||||
|
||||
<!-- Provide a link to a live example, or an unambiguous set of steps to -->
|
||||
<!-- reproduce this bug. Include code to reproduce, if relevant -->
|
||||
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
|
||||
#### Can you provide a small but working code example?
|
||||
|
||||
<!-- Please understand that we cannot analyze and debug large code bases. -->
|
||||
|
||||
#### What is the expected behavior?
|
||||
|
||||
<!-- Tell us what should happen -->
|
||||
|
||||
#### And what is the actual behavior instead?
|
||||
|
||||
<!-- Tell us what happens instead. -->
|
||||
|
||||
#### Which compiler and operating system are you using?
|
||||
|
||||
<!-- Include as many relevant details about the environment you experienced the bug in. -->
|
||||
<!-- Make sure you use a supported compiler, see https://github.com/nlohmann/json#supported-compilers. -->
|
||||
|
||||
- Compiler: ___
|
||||
- Operating system: ___
|
||||
|
||||
#### Which version of the library did you use?
|
||||
|
||||
<!-- Please add an `x` to the respective line. -->
|
||||
|
||||
- [ ] latest release version 3.9.1
|
||||
- [ ] other release - please state the version: ___
|
||||
- [ ] the `develop` branch
|
||||
|
||||
#### If you experience a compilation error: can you [compile and run the unit tests](https://github.com/nlohmann/json#execute-unit-tests)?
|
||||
|
||||
- [ ] yes
|
||||
- [ ] no - please copy/paste the error message below
|
5
vendor/json/.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
5
vendor/json/.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: Ask a question
|
||||
url: https://github.com/nlohmann/json/discussions
|
||||
about: Ask questions and discuss with other community members
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user