Mystery Posted January 7, 2012 Posted January 7, 2012 For some reason, I think my @whodrops is bugged or something.. When I do, @whodrops 909 (jellopy) or anything for that matter, it keeps saying that the items are not dropped by any mobs. Edit: Sorry, this should help you guys =/ atcommand: ACMD_FUNC(whodrops) { struct item_data *item_data, *item_array[MAX_SEARCH]; int i,j, count = 1; if (!message || !*message) { clif_displaymessage(fd, "Please, enter Item name or its ID (usage: @whodrops <item name or 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(19)); // Invalid item ID or name. return -1; } if (count > MAX_SEARCH) { sprintf(atcmd_output, msg_txt(269), MAX_SEARCH, count); // Displaying first %d out of %d matches clif_displaymessage(fd, atcmd_output); count = MAX_SEARCH; } for (i = 0; i < count; i++) { item_data = item_array[i]; sprintf(atcmd_output, "Item: '%s'[%d]", item_data->jname,item_data->slot); clif_displaymessage(fd, atcmd_output); if (item_data->mob[0].chance == 0) { strcpy(atcmd_output, " - Item is not dropped by mobs."); clif_displaymessage(fd, atcmd_output); } else { sprintf(atcmd_output, "- Common mobs with highest drop chance (only max %d are listed):", MAX_SEARCH); clif_displaymessage(fd, atcmd_output); for (j=0; j < MAX_SEARCH && item_data->mob[j].chance > 0; j++) { sprintf(atcmd_output, "- %s (%02.02f%%)", mob_db(item_data->mob[j].id)->jname, item_data->mob[j].chance/100.); clif_displaymessage(fd, atcmd_output); } } } return 0; } EDIT: added images and atcommand.c (Whodrops) to help out xD Sorry =/ Total stupid moment before. Quote
Flaid Posted January 8, 2012 Posted January 8, 2012 Try to replace the code with this and don't forget to recompile. ACMD_FUNC(whodrops) { struct item_data *item_data, *item_array[MAX_SEARCH]; int i,j, count = 1; if (!message || !*message) { clif_displaymessage(fd, "Please, enter Item name or its ID (usage: @whodrops <item name or 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(19)); // Invalid item ID or name. return -1; } if (count > MAX_SEARCH) { sprintf(atcmd_output, msg_txt(269), MAX_SEARCH, count); // Displaying first %d out of %d matches clif_displaymessage(fd, atcmd_output); count = MAX_SEARCH; } for (i = 0; i < count; i++) { item_data = item_array[i]; sprintf(atcmd_output, "Item: '%s'[%d]", item_data->jname,item_data->slot); clif_displaymessage(fd, atcmd_output); if (item_data->mob[0].chance == 0) { strcpy(atcmd_output, " - Item is not dropped by mobs."); clif_displaymessage(fd, atcmd_output); } else { sprintf(atcmd_output, "- Common mobs with highest drop chance (only max %d are listed):", MAX_SEARCH); clif_displaymessage(fd, atcmd_output); for (j=0; j < MAX_SEARCH && item_data->mob[j].chance > 0; j++) { sprintf(atcmd_output, "- %s (%02.02f%%) %02.02f%% Base -", mob_db(item_data->mob[j].id)->jname, item_data->mob[j].chance/100., item_data->mob[j].bchance/100.); clif_displaymessage(fd, atcmd_output); } } } return 0; } Quote
Mystery Posted January 8, 2012 Author Posted January 8, 2012 (edited) Thanks!.. But error on: sprintf(atcmd_output, "- %s (%02.02f%%) %02.02f%% Base -", mob_db(item_data->mob[j].id)->jname, item_data->mob[j].chance/100., item_data->mob[j].bchance/100.); =/ Edited January 8, 2012 by Mysterious Quote
Variant Posted January 8, 2012 Posted January 8, 2012 Change that line to: sprintf(atcmd_output, "- %s (%02.02f%%)", mob_db(item_data->mob[j].id)->jname, item_data->mob[j].chance/100.); Quote
Vengeance Posted January 8, 2012 Posted January 8, 2012 when u get an error like that try to use the command @reloadmobdb sometimes when you use @reloadscript this happens... Quote
Brian Posted January 15, 2012 Posted January 15, 2012 If you do @reloaditemdb, you should also do a @reloadmobdb. bugreport:2397 http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=2397 Quote
Question
Mystery
For some reason, I think my @whodrops is bugged or something..
When I do, @whodrops 909 (jellopy) or anything for that matter, it keeps saying that the items are not dropped by any mobs.
Edit:
Sorry, this should help you guys =/
atcommand:
EDIT: added images and atcommand.c (Whodrops) to help out xD
Sorry =/ Total stupid moment before.
5 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.