Skip to content

Commit

Permalink
Improved atCommand(iteminfo)
Browse files Browse the repository at this point in the history
  • Loading branch information
Venseer committed Oct 29, 2024
1 parent 84da0df commit 7add4a1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/map/atcommand.c
Original file line number Diff line number Diff line change
Expand Up @@ -7720,11 +7720,19 @@ ACMD(iteminfo)
for (i = 0; i < count; i++) {
struct item_data *item_data = item_array[i];
if (item_data != NULL) {

struct item link_item = { 0 };
link_item.nameid = item_data->nameid;
StringBuf buf;
StrBuf->Init(&buf);
clif->format_itemlink(&buf, &link_item);

snprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, MSGTBL_ITEMINFO_DETAILS), // Item: '%s'/'%s'[%d] (%d) Type: %s | Extra Effect: %s
item_data->name, item_data->jname, item_data->slot, item_data->nameid,
item_data->name, StrBuf->Value(&buf), item_data->nameid,
itemdb->typename(item_data->type),
(item_data->script == NULL) ? msg_fd(fd, MSGTBL_ITEMINFO_NONE) : msg_fd(fd, MSGTBL_ITEMINFO_WITH_SCRIPT) // None / With script
);
StrBuf->Destroy(&buf);
clif->message(fd, atcmd_output);

snprintf(atcmd_output, sizeof(atcmd_output), msg_fd(fd, MSGTBL_ITEMINFO_NPC_DETAILS), item_data->value_buy, item_data->value_sell, item_data->weight / 10.); // NPC Buy:%dz, Sell:%dz | Weight: %.1f
Expand Down

0 comments on commit 7add4a1

Please sign in to comment.