mirror of
https://gitlab.com/hashborgir/d2tweaks-rnd2k.git
synced 2025-09-19 01:52:08 +00:00
broken
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -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 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, mode 0 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||
//diablo2::d2_common::set_unit_mode(item, 0); // mode 4 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, mode 0 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
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,
|
||||
|
Reference in New Issue
Block a user