Mystery Posted January 7, 2012 Share 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 Link to comment Share on other sites More sharing options...
Flaid Posted January 8, 2012 Share 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 Link to comment Share on other sites More sharing options...
Mystery Posted January 8, 2012 Author Share 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 Link to comment Share on other sites More sharing options...
Variant Posted January 8, 2012 Share 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 Link to comment Share on other sites More sharing options...
Vengeance Posted January 8, 2012 Share 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 Link to comment Share on other sites More sharing options...
Brian Posted January 15, 2012 Share 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 Link to comment Share on other sites More sharing options...
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.
Link to comment
Share on other sites