Good day! Can anyone help? I want to modify my @ii / @iteminfo atcommands to have an itemlink and doesn't have limit on showing the results. Thanks in advance!
/*==========================================
* Show Items DB Info v 1.0
* originally by [Lupus]
*------------------------------------------*/
ACMD_FUNC(iteminfo)
{
struct item_data *item_array[MAX_SEARCH];
int i, count = 1;
if (!message || !*message) {
clif_displaymessage(fd, msg_txt(sd,1276)); // Please enter an item name/ID (usage: @ii/@iteminfo <item name/ID>).
return -1;
}
if ((item_array[0] = itemdb_exists(atoi(message))) == NULL)
count = itemdb_searchname_array(item_array, MAX_SEARCH, message);
if (!count) {
clif_displaymessage(fd, msg_txt(sd,19)); // Invalid item ID or name.
return -1;
}
if (count == MAX_SEARCH) {
sprintf(atcmd_output, msg_txt(sd,269), MAX_SEARCH); // Displaying first %d matches
clif_displaymessage(fd, atcmd_output);
}
for (i = 0; i < count; i++) {
struct item_data * item_data = item_array[i];
sprintf(atcmd_output, msg_txt(sd,1277), // Item: '%s'/'%s'[%d] (%hu) Type: %s | Extra Effect: %s
item_data->name,item_data->jname,item_data->slot,item_data->nameid,
(item_data->type != IT_AMMO) ? itemdb_typename((enum item_types)item_data->type) : itemdb_typename_ammo((enum e_item_ammo)item_data->look),
(item_data->script==NULL)? msg_txt(sd,1278) : msg_txt(sd,1279) // None / With script
);
clif_displaymessage(fd, atcmd_output);
sprintf(atcmd_output, msg_txt(sd,1280), item_data->value_buy, item_data->value_sell, item_data->weight/10. ); // NPC Buy:%dz, Sell:%dz | Weight: %.1f
clif_displaymessage(fd, atcmd_output);
if (item_data->maxchance == -1) {
strcpy(atcmd_output, msg_txt(sd,1281)); // - Available in the shops only.
clif_displaymessage(fd, atcmd_output);
}
else if (!battle_config.atcommand_mobinfo_type) {
if (item_data->maxchance)
sprintf(atcmd_output, msg_txt(sd,1282), (float)item_data->maxchance / 100 ); // - Maximal monsters drop chance: %02.02f%%
else
strcpy(atcmd_output, msg_txt(sd,1283)); // - Monsters don't drop this item.
clif_displaymessage(fd, atcmd_output);
}
}
return 0;
}