Hello, change storage to premiumStorage.
You can try my changes. I can't test it with just the code provided.
// @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);
int32 stor_id = 2; //Storage ID to autostore
if (stor_id)
storage_premiumStorage_load(sd, stor_id, STOR_MODE_PUT);
if (sd->state.storage_flag == 3) {
storage_storageadd(sd, &sd->premiumStorage, i, amount);
storage_premiumStorage_close(sd);
}
else {
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;
}
}