Hello, this is Cydh's @autostore feature.
// @autostore [Cydh]
if (autostoring && sd->state.autostore && !item->expire_time && !id->flag.autoequip && !sd->state.storage_flag && !sd->npc_id) {
if ((!sd->autostore_weight || (sd->autostore_weight && get_percentage(sd->weight, sd->max_weight) >= sd->autostore_weight))
&& (
(sd->autostore_type&1 && (id->type == IT_HEALING || id->type == IT_USABLE || id->type == IT_DELAYCONSUME || id->type == IT_CASH))
|| (sd->autostore_type&2 && (id->type == IT_ARMOR || id->type == IT_WEAPON || id->type == IT_SHADOWGEAR || id->type == IT_PETEGG || id->type == IT_PETARMOR))
|| (sd->autostore_type&4 && (id->type == IT_ETC || id->type == IT_AMMO || id->type == IT_UNKNOWN || id->type == IT_UNKNOWN2))
|| (sd->autostore_type&8 && id->type == IT_CARD)
)
)
{
char output[CHAT_SIZE_MAX];
sd->weight += w;
clif_updatestatus(*sd, SP_WEIGHT);
storage_storageadd(sd, &sd->storage, i, amount);
storage_storageclose(sd);
clif_storageclose(*sd);
sprintf(output, "[ Autostore ] %dx %s", amount, id->ename.c_str());
clif_messagecolor(&sd->bl, color_table[COLOR_LIGHT_GREEN], output, false, SELF);
achievement_update_objective(sd, AG_GET_ITEM, 1, id->value_sell);
return ADDITEM_SUCCESS;
}
}
----------------------------------------------------------
- ID: 2
Name: "Storage 2"
Table: storage2
Max: 300
- ID: 3
Name: "Storage 3"
Table: storage3
Max: 300
This is the part where it stores the item in the storage.
storage_storageadd(sd, &sd->storage, i, amount);
Any idea how I can call storage ID: 2 or 3 in that part, so that the item to be autostored will go to the custom storage I created?"