@@ -7156,14 +7156,14 @@ ACMD(mobinfo)
7156
7156
unsigned char msize [3 ][7 ] = {"Small" , "Medium" , "Large" };
7157
7157
unsigned char mrace [12 ][11 ] = {"Formless" , "Undead" , "Beast" , "Plant" , "Insect" , "Fish" , "Demon" , "Demi-Human" , "Angel" , "Dragon" , "Boss" , "Non-Boss" };
7158
7158
unsigned char melement [10 ][8 ] = {"Neutral" , "Water" , "Earth" , "Fire" , "Wind" , "Poison" , "Holy" , "Dark" , "Ghost" , "Undead" };
7159
- char atcmd_output2 [ CHAT_SIZE_MAX ] ;
7159
+ StringBuf buf ;
7160
7160
struct item_data * item_data ;
7161
7161
struct mob_db * monster , * mob_array [MAX_SEARCH ];
7162
7162
int count ;
7163
7163
int i , k ;
7164
7164
7165
7165
memset (atcmd_output , '\0' , sizeof (atcmd_output ));
7166
- memset ( atcmd_output2 , '\0' , sizeof ( atcmd_output2 ) );
7166
+ StrBuf -> Init ( & buf );
7167
7167
7168
7168
if (!* message ) {
7169
7169
clif -> message (fd , msg_fd (fd , MSGTBL_MOBINFO_USAGE )); // Please enter a monster name/ID (usage: @mobinfo <monster_name_or_monster_ID>).
@@ -7253,23 +7253,22 @@ ACMD(mobinfo)
7253
7253
}
7254
7254
#endif
7255
7255
7256
- if (item_data -> slot )
7257
- snprintf (atcmd_output2 , sizeof (atcmd_output2 ), " - %s[%d] %02.02f%%" , item_data -> jname , item_data -> slot , (float )droprate / 100 );
7258
- else
7259
- snprintf (atcmd_output2 , sizeof (atcmd_output2 ), " - %s %02.02f%%" , item_data -> jname , (float )droprate / 100 );
7260
-
7261
- strcat (atcmd_output , atcmd_output2 );
7262
-
7256
+ struct item link_item = { 0 };
7257
+ link_item .nameid = monster -> dropitem [i ].nameid ;
7258
+ StrBuf -> AppendStr (& buf , " - " );
7259
+ clif -> format_itemlink (& buf , & link_item );
7260
+ StrBuf -> Printf (& buf , " %02.02f%%" , (float )droprate / 100 );
7263
7261
if (++ j % 3 == 0 ) {
7264
- clif -> message (fd , atcmd_output );
7265
- strcpy ( atcmd_output , " " );
7262
+ clif -> message (fd , StrBuf -> Value ( & buf ) );
7263
+ StrBuf -> Clear ( & buf );
7266
7264
}
7267
7265
}
7268
7266
7269
7267
if (j == 0 )
7270
7268
clif -> message (fd , msg_fd (fd , MSGTBL_MOBINFO_NO_DROPS )); // This monster has no drops.
7271
7269
else if (j % 3 != 0 )
7272
- clif -> message (fd , atcmd_output );
7270
+ clif -> message (fd , StrBuf -> Value (& buf ));
7271
+ StrBuf -> Clear (& buf );
7273
7272
// mvp
7274
7273
if (monster -> mexp ) {
7275
7274
snprintf (atcmd_output , sizeof (atcmd_output ), msg_fd (fd , MSGTBL_MOBINFO_MVP_BONUS_EXP ), monster -> mexp ); // MVP Bonus EXP:%u
@@ -7282,19 +7281,21 @@ ACMD(mobinfo)
7282
7281
continue ;
7283
7282
if (monster -> mvpitem [i ].p > 0 ) {
7284
7283
j ++ ;
7285
- if ( item_data -> slot )
7286
- snprintf ( atcmd_output2 , sizeof ( atcmd_output2 ), " %s%s[%d] %02.02f%%" , j != 1 ? "- " : "" , item_data -> jname , item_data -> slot , ( float ) monster -> mvpitem [i ].p / 100 ) ;
7287
- else
7288
- snprintf ( atcmd_output2 , sizeof ( atcmd_output2 ), " %s%s %02.02f%%" , j != 1 ? "- " : "" , item_data -> jname , ( float ) monster -> mvpitem [ i ]. p / 100 );
7289
- strcat ( atcmd_output , atcmd_output2 );
7284
+ struct item link_item = { 0 };
7285
+ link_item . nameid = monster -> mvpitem [i ].nameid ;
7286
+ StrBuf -> AppendStr ( & buf , j != 1 ? " - " : "" );
7287
+ clif -> format_itemlink ( & buf , & link_item );
7288
+ StrBuf -> Printf ( & buf , " %02.02f%%" , ( float ) monster -> mvpitem [ i ]. p / 100 );
7290
7289
}
7291
7290
}
7291
+
7292
7292
if (j == 0 )
7293
7293
clif -> message (fd , msg_fd (fd , MSGTBL_MOBINFO_NO_MVP_PRIZES )); // This monster has no MVP prizes.
7294
7294
else
7295
- clif -> message (fd , atcmd_output );
7295
+ clif -> message (fd , StrBuf -> Value ( & buf ) );
7296
7296
}
7297
7297
}
7298
+ StrBuf -> Destroy (& buf );
7298
7299
return true;
7299
7300
}
7300
7301
0 commit comments