This commit is contained in:
Hash Borgir 2024-05-06 00:57:34 -06:00
parent ee810d5f38
commit 4e02101d5d
72 changed files with 797 additions and 408 deletions

Binary file not shown.

View File

@ -1,2 +1,2 @@
 ui_manager.cpp
 loot_filter_settings_menu.cpp
D2tweaks.vcxproj -> D:\Diablo II\MODS\ironman-dev\D2tweaks.dll

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -80,10 +80,10 @@ bool d2_tweaks::server::modules::item_move::handle_packet(diablo2::structures::g
//MessageBox(NULL, bag_guid.c_str(), "Bag GUID", MB_OK | MB_ICONINFORMATION);
D2PropertyStrc itemProperty = {};
itemProperty.nProperty = 388 - 3; // Adjust the property ID
itemProperty.nProperty = itemMove->prop - 3; // Adjust the property ID
itemProperty.nLayer = 0;
itemProperty.nMin = -1;
itemProperty.nMax = -1;
itemProperty.nMin = itemMove->val;
itemProperty.nMax = itemMove->val;
// Add the gem property to the gem bag
diablo2::d2_common::add_property(bag, &itemProperty, 0);
@ -91,56 +91,56 @@ bool d2_tweaks::server::modules::item_move::handle_packet(diablo2::structures::g
diablo2::d2_game::QUESTS_CreateItem(game, player, reverseDWORD(itemMove->iCode), 1, diablo2::structures::ITEMQUAL_NORMAL, true);
return true;
}
else
else
if (itemMove->tmog == 1) {
// here we need to add item to inventory
// here we need to add item to inventory
const auto item = instance.get_server_unit(game, itemMove->item_guid, diablo2::structures::unit_type_t::UNIT_TYPE_ITEM); //0x4 = item
const auto item = instance.get_server_unit(game, itemMove->item_guid, diablo2::structures::unit_type_t::UNIT_TYPE_ITEM); //0x4 = item
diablo2::d2_game::D2GAME_Transmogrify_6FC4A660(game, player, item);
diablo2::d2_game::D2GAME_Transmogrify_6FC4A660(game, player, item);
diablo2::d2_game::QUESTS_CreateItem(game, player, reverseDWORD('gfv '), 1, diablo2::structures::ITEMQUAL_NORMAL, true);
diablo2::d2_game::QUESTS_CreateItem(game, player, reverseDWORD('gfv '), 1, diablo2::structures::ITEMQUAL_NORMAL, true);
}
else {
D2PropertyStrc itemProperty = {};
itemProperty.nProperty = itemMove->prop;
itemProperty.nLayer = 0;
itemProperty.nMin = itemMove->val;
itemProperty.nMax = itemMove->val;
diablo2::d2_common::add_property(bag, &itemProperty, 1);
}
else {
D2PropertyStrc itemProperty = {};
itemProperty.nProperty = itemMove->prop;
itemProperty.nLayer = 0;
itemProperty.nMin = itemMove->val;
itemProperty.nMax = itemMove->val;
diablo2::d2_common::add_property(bag, &itemProperty, 1);
if (item == nullptr)
return true; //block further packet processing
if (item == nullptr)
return true; //block further packet processing
const auto inventoryIndex = diablo2::d2_common::get_inventory_index(player, itemMove->target_page, game->item_format == 101);
const auto inventoryIndex = diablo2::d2_common::get_inventory_index(player, itemMove->target_page, game->item_format == 101);
uint32_t tx, ty;
uint32_t tx, ty;
if (!find_free_space(player->inventory, item, inventoryIndex, itemMove->target_page, tx, ty))
return true; //block further packet processing
if (!find_free_space(player->inventory, item, inventoryIndex, itemMove->target_page, tx, ty))
return true; //block further packet processing
//diablo2::d2_common::set_unit_mode(item, 0); // mode 4 - ïðåäìåò íåëüçÿ âçÿòü ìûøêîé èç èíâåíòàðÿ, mode 0 - îáû÷íûé ðåæèì
//diablo2::d2_common::set_unit_mode(item, 0); // mode 4 - ïðåäìåò íåëüçÿ âçÿòü ìûøêîé èç èíâåíòàðÿ, mode 0 - îáû÷íûé ðåæèì
item->item_data->page = itemMove->target_page;
item->item_data->page = itemMove->target_page;
diablo2::d2_common::inv_add_item(player->inventory, item, tx, ty, inventoryIndex, false, item->item_data->page);
diablo2::d2_common::inv_update_item(player->inventory, item, false);
diablo2::d2_common::inv_add_item(player->inventory, item, tx, ty, inventoryIndex, false, item->item_data->page);
diablo2::d2_common::inv_update_item(player->inventory, item, false);
diablo2::d2_game::update_inventory_items(game, player);
diablo2::d2_game::update_inventory_items(game, player);
//send update packet
resp.item_guid = itemMove->item_guid;
resp.target_page = itemMove->target_page;
resp.tx = tx;
resp.ty = ty;
//send update packet
resp.item_guid = itemMove->item_guid;
resp.target_page = itemMove->target_page;
resp.tx = tx;
resp.ty = ty;
const auto client = player->player_data->net_client;
const auto client = player->player_data->net_client;
diablo2::d2_net::send_to_client(1, client->client_id, &resp, sizeof resp);
diablo2::d2_net::send_to_client(1, client->client_id, &resp, sizeof resp);
return true;
}
return true;
}
}
bool d2_tweaks::server::modules::item_move::find_free_space(diablo2::structures::inventory* inv,