enum e_additem_result pc_additem(map_session_data *sd,struct item *item,int amount,e_log_pick_type log_type)
{
struct item_data* data;
struct homun_data* hd;
int i;
unsigned int w;
int amt2 = 0;
if (item->nameid > 8030 && item->nameid < 9001) {
for (i = 8031; i < 9001; i++) {
amt2 += pc_countitem(sd, i);
}
amt2 += 1;
if ((hd = sd->hd) == NULL) {
amt2 -= 1;
}
if ((sd->status.lock) == 0)
amt2 = 0;
if (amt2 >= 6) {
storage_storageadd(sd, item->nameid, 1, LOG_TYPE_NONE);
return 7;
}
}
int pc_countitem(struct map_session_data* sd, int itemid) //[Hold -brA]
{
struct item_data* it_tmp;
int i, id, amt = 0;
if (!(it_tmp = item_db.exists(itemid)))
return 0;
id = it_tmp->nameid;
for (i = 0; i < MAX_INVENTORY; i++)
if (sd->inventory.u.items_inventory[i].nameid == id)
amt += sd->inventory.u.items_inventory[i].amount;
return amt;
}
Anyone can help me adapt this code for Reathena pls
Code 01 ERROR - storage_storageadd(sd, item->nameid, 1, LOG_TYPE_NONE);
Code 02 ERROR - if(! (it_tmp = item_db.exists(itemid))) return 0 ;