Jump to content
  • 0

@whodrops


Mystery

Question


  • Group:  Members
  • Topic Count:  94
  • Topics Per Day:  0.02
  • Content Count:  2192
  • Reputation:   252
  • Joined:  11/11/11
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  398
  • Reputation:   140
  • Joined:  01/04/12
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  94
  • Topics Per Day:  0.02
  • Content Count:  2192
  • Reputation:   252
  • Joined:  11/11/11
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  52
  • Reputation:   6
  • Joined:  01/06/12
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  65
  • Reputation:   13
  • Joined:  01/08/12
  • Last Seen:  

when u get an error like that try to use the command @reloadmobdb sometimes when you use @reloadscript this happens...

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

If you do @reloaditemdb, you should also do a @reloadmobdb.

bugreport:2397

http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=2397

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...