|
@@ -8412,35 +8412,26 @@ ACMD_FUNC(itemlist)
|
|
|
|
|
|
nullpo_retr(-1, sd);
|
|
|
|
|
|
- if( strcmp(command+1, "storagelist") == 0 )
|
|
|
- {
|
|
|
+ if( strcmp(command+1, "storagelist") == 0 ) {
|
|
|
location = "storage";
|
|
|
items = sd->status.storage.items;
|
|
|
size = sd->storage_size;
|
|
|
- }
|
|
|
- else
|
|
|
- if( strcmp(command+1, "cartlist") == 0 )
|
|
|
- {
|
|
|
+ } else if( strcmp(command+1, "cartlist") == 0 ) {
|
|
|
location = "cart";
|
|
|
items = sd->status.cart;
|
|
|
size = MAX_CART;
|
|
|
- }
|
|
|
- else
|
|
|
- if( strcmp(command+1, "itemlist") == 0 )
|
|
|
- {
|
|
|
+ } else if( strcmp(command+1, "itemlist") == 0 ) {
|
|
|
location = "inventory";
|
|
|
items = sd->status.inventory;
|
|
|
size = MAX_INVENTORY;
|
|
|
- }
|
|
|
- else
|
|
|
+ } else
|
|
|
return 1;
|
|
|
|
|
|
StringBuf_Init(&buf);
|
|
|
|
|
|
count = 0; // total slots occupied
|
|
|
counter = 0; // total items found
|
|
|
- for( i = 0; i < size; ++i )
|
|
|
- {
|
|
|
+ for( i = 0; i < size; ++i ) {
|
|
|
const struct item* it = &items[i];
|
|
|
struct item_data* itd;
|
|
|
|
|
@@ -8450,8 +8441,7 @@ ACMD_FUNC(itemlist)
|
|
|
counter += it->amount;
|
|
|
count++;
|
|
|
|
|
|
- if( count == 1 )
|
|
|
- {
|
|
|
+ if( count == 1 ) {
|
|
|
StringBuf_Printf(&buf, msg_txt(sd,1332), location, sd->status.name); // ------ %s items list of '%s' ------
|
|
|
clif_displaymessage(fd, StringBuf_Value(&buf));
|
|
|
StringBuf_Clear(&buf);
|
|
@@ -8462,38 +8452,70 @@ ACMD_FUNC(itemlist)
|
|
|
else
|
|
|
StringBuf_Printf(&buf, "%d %s (%s, id: %d)", it->amount, itd->jname, itd->name, it->nameid);
|
|
|
|
|
|
- if( it->equip )
|
|
|
- {
|
|
|
+ if( it->equip ) {
|
|
|
char equipstr[CHAT_SIZE_MAX];
|
|
|
- strcpy(equipstr, msg_txt(sd,1333)); // | equipped:
|
|
|
- if( it->equip & EQP_GARMENT )
|
|
|
- strcat(equipstr, msg_txt(sd,1334)); // garment,
|
|
|
- if( it->equip & EQP_ACC_L )
|
|
|
- strcat(equipstr, msg_txt(sd,1335)); // left accessory,
|
|
|
- if( it->equip & EQP_ARMOR )
|
|
|
- strcat(equipstr, msg_txt(sd,1336)); // body/armor,
|
|
|
- if( (it->equip & EQP_ARMS) == EQP_HAND_R )
|
|
|
- strcat(equipstr, msg_txt(sd,1337)); // right hand,
|
|
|
- if( (it->equip & EQP_ARMS) == EQP_HAND_L )
|
|
|
- strcat(equipstr, msg_txt(sd,1338)); // left hand,
|
|
|
- if( (it->equip & EQP_ARMS) == EQP_ARMS )
|
|
|
- strcat(equipstr, msg_txt(sd,1339)); // both hands,
|
|
|
- if( it->equip & EQP_SHOES )
|
|
|
- strcat(equipstr, msg_txt(sd,1340)); // feet,
|
|
|
- if( it->equip & EQP_ACC_R )
|
|
|
- strcat(equipstr, msg_txt(sd,1341)); // right accessory,
|
|
|
- if( (it->equip & EQP_HELM) == EQP_HEAD_LOW )
|
|
|
- strcat(equipstr, msg_txt(sd,1342)); // lower head,
|
|
|
- if( (it->equip & EQP_HELM) == EQP_HEAD_TOP )
|
|
|
- strcat(equipstr, msg_txt(sd,1343)); // top head,
|
|
|
- if( (it->equip & EQP_HELM) == (EQP_HEAD_LOW|EQP_HEAD_TOP) )
|
|
|
- strcat(equipstr, msg_txt(sd,1344)); // lower/top head,
|
|
|
- if( (it->equip & EQP_HELM) == EQP_HEAD_MID )
|
|
|
- strcat(equipstr, msg_txt(sd,1345)); // mid head,
|
|
|
- if( (it->equip & EQP_HELM) == (EQP_HEAD_LOW|EQP_HEAD_MID) )
|
|
|
- strcat(equipstr, msg_txt(sd,1346)); // lower/mid head,
|
|
|
- if( (it->equip & EQP_HELM) == EQP_HELM )
|
|
|
- strcat(equipstr, msg_txt(sd,1347)); // lower/mid/top head,
|
|
|
+
|
|
|
+ strcpy(equipstr, msg_txt(sd,1333)); // | Equipped:
|
|
|
+ if( it->equip&EQP_GARMENT )
|
|
|
+ strcat(equipstr, msg_txt(sd,1334)); // Robe,
|
|
|
+ if( it->equip&EQP_ACC_L )
|
|
|
+ strcat(equipstr, msg_txt(sd,1335)); // Left Accessory,
|
|
|
+ if( it->equip&EQP_ARMOR )
|
|
|
+ strcat(equipstr, msg_txt(sd,1336)); // Body/Armor,
|
|
|
+ if( (it->equip&EQP_ARMS) == EQP_HAND_R )
|
|
|
+ strcat(equipstr, msg_txt(sd,1337)); // Right Hand,
|
|
|
+ if( (it->equip&EQP_ARMS) == EQP_HAND_L )
|
|
|
+ strcat(equipstr, msg_txt(sd,1338)); // Left Hand,
|
|
|
+ if( (it->equip&EQP_ARMS) == EQP_ARMS )
|
|
|
+ strcat(equipstr, msg_txt(sd,1339)); // Both Hands,
|
|
|
+ if( it->equip&EQP_SHOES )
|
|
|
+ strcat(equipstr, msg_txt(sd,1340)); // Shoes,
|
|
|
+ if( it->equip&EQP_ACC_R )
|
|
|
+ strcat(equipstr, msg_txt(sd,1341)); // Right Accessory,
|
|
|
+ if( (it->equip&EQP_HELM) == EQP_HEAD_LOW )
|
|
|
+ strcat(equipstr, msg_txt(sd,1342)); // Lower Head,
|
|
|
+ if( (it->equip&EQP_HELM) == EQP_HEAD_TOP )
|
|
|
+ strcat(equipstr, msg_txt(sd,1343)); // Top Head,
|
|
|
+ if( (it->equip&EQP_HELM) == (EQP_HEAD_LOW|EQP_HEAD_TOP) )
|
|
|
+ strcat(equipstr, msg_txt(sd,1344)); // Top/Lower Head,
|
|
|
+ if( (it->equip&EQP_HELM) == EQP_HEAD_MID )
|
|
|
+ strcat(equipstr, msg_txt(sd,1345)); // Mid Head,
|
|
|
+ if( (it->equip&EQP_HELM) == (EQP_HEAD_LOW|EQP_HEAD_MID) )
|
|
|
+ strcat(equipstr, msg_txt(sd,1346)); // Mid/Lower Head,
|
|
|
+ if( (it->equip&EQP_HELM) == EQP_HELM )
|
|
|
+ strcat(equipstr, msg_txt(sd,1347)); // Top/Mid/Lower Head,
|
|
|
+ if( (it->equip&EQP_COSTUME_HELM) == EQP_COSTUME_HEAD_LOW )
|
|
|
+ strcat(equipstr, msg_txt(sd,518));
|
|
|
+ if( (it->equip&EQP_COSTUME_HELM) == EQP_COSTUME_HEAD_TOP )
|
|
|
+ strcat(equipstr, msg_txt(sd,519));
|
|
|
+ if( (it->equip&EQP_COSTUME_HELM) == (EQP_COSTUME_HEAD_LOW|EQP_COSTUME_HEAD_TOP) )
|
|
|
+ strcat(equipstr, msg_txt(sd,520));
|
|
|
+ if( (it->equip&EQP_COSTUME_HELM) == EQP_COSTUME_HEAD_MID )
|
|
|
+ strcat(equipstr, msg_txt(sd,521));
|
|
|
+ if( (it->equip&EQP_COSTUME_HELM) == (EQP_COSTUME_HEAD_LOW|EQP_COSTUME_HEAD_MID) )
|
|
|
+ strcat(equipstr, msg_txt(sd,522));
|
|
|
+ if( (it->equip&EQP_COSTUME_HELM) == EQP_COSTUME_HELM )
|
|
|
+ strcat(equipstr, msg_txt(sd,523));
|
|
|
+ if( it->equip&EQP_COSTUME_GARMENT )
|
|
|
+ strcat(equipstr, msg_txt(sd,524));
|
|
|
+ //if( it->equip&EQP_COSTUME_FLOOR )
|
|
|
+ //strcat(equipstr, msg_txt(sd,525));
|
|
|
+ if( it->equip&EQP_AMMO )
|
|
|
+ strcat(equipstr, msg_txt(sd,526));
|
|
|
+ if( it->equip&EQP_SHADOW_ARMOR )
|
|
|
+ strcat(equipstr, msg_txt(sd,527));
|
|
|
+ if( (it->equip&EQP_SHADOW_ARMS) == EQP_SHADOW_WEAPON )
|
|
|
+ strcat(equipstr, msg_txt(sd,528));
|
|
|
+ if( (it->equip&EQP_SHADOW_ARMS) == EQP_SHADOW_SHIELD )
|
|
|
+ strcat(equipstr, msg_txt(sd,529));
|
|
|
+ if( (it->equip&EQP_SHADOW_ARMS) == EQP_SHADOW_ARMS )
|
|
|
+ strcat(equipstr, msg_txt(sd,530));
|
|
|
+ if( it->equip&EQP_SHADOW_SHOES )
|
|
|
+ strcat(equipstr, msg_txt(sd,531));
|
|
|
+ if( it->equip&EQP_SHADOW_ACC_R )
|
|
|
+ strcat(equipstr, msg_txt(sd,532));
|
|
|
+ if( it->equip&EQP_SHADOW_ACC_L )
|
|
|
+ strcat(equipstr, msg_txt(sd,533));
|
|
|
// remove final ', '
|
|
|
equipstr[strlen(equipstr) - 2] = '\0';
|
|
|
StringBuf_AppendStr(&buf, equipstr);
|
|
@@ -8502,29 +8524,19 @@ ACMD_FUNC(itemlist)
|
|
|
clif_displaymessage(fd, StringBuf_Value(&buf));
|
|
|
StringBuf_Clear(&buf);
|
|
|
|
|
|
- if( it->card[0] == CARD0_PET )
|
|
|
- {// pet egg
|
|
|
+ if( it->card[0] == CARD0_PET ) { // pet egg
|
|
|
if (it->card[3])
|
|
|
StringBuf_Printf(&buf, msg_txt(sd,1348), (unsigned int)MakeDWord(it->card[1], it->card[2])); // -> (pet egg, pet id: %u, named)
|
|
|
else
|
|
|
StringBuf_Printf(&buf, msg_txt(sd,1349), (unsigned int)MakeDWord(it->card[1], it->card[2])); // -> (pet egg, pet id: %u, unnamed)
|
|
|
- }
|
|
|
- else
|
|
|
- if(it->card[0] == CARD0_FORGE)
|
|
|
- {// forged item
|
|
|
+ } else if(it->card[0] == CARD0_FORGE) { // forged item
|
|
|
StringBuf_Printf(&buf, msg_txt(sd,1350), (unsigned int)MakeDWord(it->card[2], it->card[3]), it->card[1]>>8, it->card[1]&0x0f); // -> (crafted item, creator id: %u, star crumbs %d, element %d)
|
|
|
- }
|
|
|
- else
|
|
|
- if(it->card[0] == CARD0_CREATE)
|
|
|
- {// created item
|
|
|
+ } else if(it->card[0] == CARD0_CREATE) { // created item
|
|
|
StringBuf_Printf(&buf, msg_txt(sd,1351), (unsigned int)MakeDWord(it->card[2], it->card[3])); // -> (produced item, creator id: %u)
|
|
|
- }
|
|
|
- else
|
|
|
- {// normal item
|
|
|
+ } else { // normal item
|
|
|
int counter2 = 0;
|
|
|
|
|
|
- for( j = 0; j < itd->slot; ++j )
|
|
|
- {
|
|
|
+ for( j = 0; j < itd->slot; ++j ) {
|
|
|
struct item_data* card;
|
|
|
|
|
|
if( it->card[j] == 0 || (card = itemdb_exists(it->card[j])) == NULL )
|
|
@@ -8698,29 +8710,22 @@ ACMD_FUNC(font)
|
|
|
nullpo_retr(-1,sd);
|
|
|
|
|
|
font_id = atoi(message);
|
|
|
- if( font_id == 0 )
|
|
|
- {
|
|
|
- if( sd->user_font )
|
|
|
- {
|
|
|
- sd->user_font = 0;
|
|
|
+ if( font_id == 0 ) {
|
|
|
+ if( sd->status.font ) {
|
|
|
+ sd->status.font = 0;
|
|
|
clif_displaymessage(fd, msg_txt(sd,1356)); // Returning to normal font.
|
|
|
clif_font(sd);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
+ } else {
|
|
|
clif_displaymessage(fd, msg_txt(sd,1357)); // Use @font <1-9> to change your message font.
|
|
|
clif_displaymessage(fd, msg_txt(sd,1358)); // Use 0 or no parameter to return to normal font.
|
|
|
}
|
|
|
- }
|
|
|
- else if( font_id < 0 || font_id > 9 )
|
|
|
+ } else if( font_id < 0 || font_id > 9 )
|
|
|
clif_displaymessage(fd, msg_txt(sd,1359)); // Invalid font. Use a value from 0 to 9.
|
|
|
- else if( font_id != sd->user_font )
|
|
|
- {
|
|
|
- sd->user_font = font_id;
|
|
|
+ else if( font_id != sd->status.font ) {
|
|
|
+ sd->status.font = font_id;
|
|
|
clif_font(sd);
|
|
|
clif_displaymessage(fd, msg_txt(sd,1360)); // Font changed.
|
|
|
- }
|
|
|
- else
|
|
|
+ } else
|
|
|
clif_displaymessage(fd, msg_txt(sd,1361)); // Already using this font.
|
|
|
|
|
|
return 0;
|