Exemple #1
0
/*==========================================
 * カプラ倉庫を開く
 *------------------------------------------
 */
int storage_storageopen(struct map_session_data *sd)
{
	struct storage *stor;
	int gmlvl = 0;

	nullpo_retr(0, sd);

	if(sd->state.storage_flag == 1)
		return 0;	// 既にカプラ倉庫を開いている

	gmlvl = pc_isGM(sd);
	if(gmlvl > 0 && battle_config.gm_can_drop_lv > gmlvl)
		return 0;	// 設定しているGMレベルより低い

	if((stor = (struct storage *)numdb_search(storage_db,sd->status.account_id)) != NULL) {
		if(stor->storage_status)
			return 1;
		stor->storage_status = 1;
	}

	if(sd->state.storage_flag == 2)
		storage_guild_storageclose(sd); // ギルド倉庫をすでに開いている場合閉じる

	if(stor != NULL) {
		sd->state.storage_flag = 1;
		clif_storageitemlist(sd,stor);
		clif_storageequiplist(sd,stor);
		clif_updatestorageamount(sd,stor);
	} else {
		intif_request_storage(sd->status.account_id);
	}
	return 0;
}
Exemple #2
0
/*==========================================
 * Opens a storage. Returns:
 * 0 - success
 * 1 - fail
 * 2 - Storage requested from char-server (will open automatically later)
 *------------------------------------------
 */
int storage_storageopen(struct map_session_data *sd)
{
	struct storage *stor;
	nullpo_retr(0, sd);

	if(sd->state.finalsave) //Refuse to open storage when you had your last save done.
		return 1;

	if(sd->state.storage_flag)
		return 1; //Already open?
	
	if(pc_can_give_items(pc_isGM(sd)))
  	{ //check is this GM level is allowed to put items to storage
		clif_displaymessage(sd->fd, msg_txt(246));
		return 1;
	}
	
	if((stor = idb_get(storage_db,sd->status.account_id)) == NULL)
  	{	//Request storage.
		intif_request_storage(sd->status.account_id);
		return 2;
	}
  
	if (stor->storage_status)
  		return 1; //Already open/player already has it open...

	stor->storage_status = 1;
	sd->state.storage_flag = 1;
	clif_storagelist(sd,stor);
	clif_updatestorageamount(sd,stor);
	return 0;
}
Exemple #3
0
/*==========================================
 * カプラ倉庫を開く
 *------------------------------------------
 */
int storage_storageopen(dumb_ptr<map_session_data> sd)
{
    nullpo_retz(sd);

    if (sd->state.storage_open)
        return 1;               //Already open?

    P<Storage> stor = TRY_UNWRAP(storage_db.search(sd->status_key.account_id),
    {                           //Request storage.
        intif_request_storage(sd->status_key.account_id);
        return 1;
    });