Issue information

Issue ID
#8091
Status
Fixed
Severity
None
Started
Tepoo
Mar 15, 2014 15:17
Last Post
Ind
Mar 30, 2014 2:59
Confirmation
N/A

Tepoo - Mar 15, 2014 15:17

the logic for showing the informations about rewards of mvps on @mi is bugged.

at it doesnt show the slot count of items on mvp rewards.
example @mi KNIGHT_OF_WINDSTORM this shows Boots instead of Boots[1]

i fixed the logic and also removed this ugly int j count logic. :P

atcommand.c line 6635
[code=auto:0] strcpy(atcmd_output, msg_txt(1248)); // MVP Items: for (i = 0; i < MAX_MVP_DROP; i++) { if (monster->mvpitem[i].nameid <= 0 || (item_data = itemdb->exists(monster->mvpitem[i].nameid)) == NULL) continue; if (monster->mvpitem[i].p > 0) { if (item_data->slot) sprintf(atcmd_output2, " %s %s[%d] %02.02f%%", (i==0?"":"-"), item_data->jname, item_data->slot, (float)monster->mvpitem[i].p / 100); else sprintf(atcmd_output2, " %s %s %02.02f%%",(i==0?"":"-"), item_data->jname, (float)monster->mvpitem[i].p / 100); strcat(atcmd_output, atcmd_output2); } } [/code]

Greetings
Tepoo aka Gardosen

Haru - Mar 15, 2014 15:27

The slot check part is good, but why did you remove the j++ part? It breaks the part that follows:[code=auto:0] if (j == 0) clif->message(fd, msg_txt(1249)); // This monster has no MVP prizes. else clif->message(fd, atcmd_output); [/code]

Tepoo - Mar 15, 2014 16:59

Sorry i forgot to copy everything.

also changed this part to
[code=nocode:0] if (monster->mvpitem[0].nameid==0) clif->message(fd, msg_txt(1249)); // This monster has no MVP prizes. else clif->message(fd, atcmd_output);[/code]
for me personaly it would not make sense if on arrayslot 0 is nothing and on other slots there is something.
thats why i check if the first arrayslot is empty, if so, there are no drops.

Haru - Mar 15, 2014 18:13

While that's true for all the current item db entries, the existing code never makes that assumption anywhere, and it is well possible to have the first entry empty and the following ones filled, so there may be custom mob entries that do that.

While I'm fine with adding the slot information, I'd rather keep the j counter for the time being, at least until we've transitioned to a libconfig-based mobdb.


Edit: I forgot to mention one valid reason why I'm assuming the existence of third party data with holes in the MVP drops arrays. If you want to remove a specific item ID and make it unavailable through mob drops, one easy way is to find all instances of it within the mob_db file, and replace them with zero.

This post has been edited by Haru on Mar 15, 2014 18:17

Tepoo - Mar 15, 2014 19:06

i dont want to tell you how to fix it :-)

just wanted to mention it and show how i fixed it.
if you want to keep the var its okay for me.

its only important that it gets fixed :-)

Ind - Mar 30, 2014 2:59

Fixed in [url="https://github.com/HerculesWS/Hercules/commit/f0229942aa9c92f4b7750fd2e56903d714a99351"]https://github.com/HerculesWS/Hercules/commit/f0229942aa9c92f4b7750fd2e56903d714a99351[/url]
Thank you very much!