void clif_selllist(struct map_session_data *sd)
{
int fd,i,c=0,val;
nullpo_retv(sd);
fd=sd->fd;
WFIFOHEAD(fd, MAX_INVENTORY * 10 + 4);
WFIFOW(fd,0)=0xc7;
for( i = 0; i < MAX_INVENTORY; i++ )
{
if( sd->status.inventory[i].nameid > 0 && sd->inventory_data[i] )
{
if( !itemdb_cansell(&sd->status.inventory[i], pc_get_group_level(sd)) )
continue;
if( sd->status.inventory[i].expire_time )
continue; // Cannot Sell Rental Items
if( sd->status.inventory[i].card[0]== CARD0_CREATE && MakeDWord(sd->status.inventory[i].card[2],sd->status.inventory[i].card[3]) == BG_CHARID && BG_TRADE &8 )
continue; // "Battleground's Items"
if( sd->status.inventory[i].card[0]== CARD0_CREATE && MakeDWord(sd->status.inventory[i].card[2],sd->status.inventory[i].card[3]) == PVP_CHARID && PVP_TRADE &8 )
continue; // "PvP Items"
if( sd->status.inventory[i].card[0]== CARD0_CREATE && MakeDWord(sd->status.inventory[i].card[2],sd->status.inventory[i].card[3]) == WOE_CHARID && WOE_TRADE &8 )
continue; // "WoE's Items"
if( sd->status.inventory[i].bound && !pc_can_give_bound_items(sd))
continue; // Don't allow sale of bound items
val=sd->inventory_data[i]->value_sell;
if( val < 0 )
continue;
WFIFOW(fd,4+c*10)=i+2;
WFIFOL(fd,6+c*10)=val;
WFIFOL(fd,10+c*10)=pc->modifysellvalue(sd,val);
c++;
}
}
WFIFOW(fd,2)=c*10+4;
WFIFOSET(fd,WFIFOW(fd,2));
}