Jump to content
  • 0
Mystery

@whodrops

Question

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 =/

proofm.png

proof2u.png

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

5 answers to this question

Recommended Posts

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;
}

Link to comment
Share on other sites

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 by Mysterious
Link to comment
Share on other sites

Change that line to:

sprintf(atcmd_output, "- %s (%02.02f%%)", mob_db(item_data->mob[j].id)->jname, item_data->mob[j].chance/100.);

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.