%%%===================================================================
%%% @author zmh
%%% @doc 材料上交
%%% @end
%%%===================================================================
-module(pp_unite_buff).
-include("server.hrl").
-include("custom_unite_buff.hrl").
-include("custom_act.hrl").
-include("predefine.hrl").
-include("errcode.hrl").
-include("figure.hrl").
-export([handle/3]).

%%面板信息
handle(14100,Status,[SubType])->
	#player_status{id=RoleID,sid=Sid}=Status,
	Type = ?CUSTOM_ACT_TYPE_UNITE_BUFF,
	case lib_custom_act_api:is_open_act(Type,SubType) of
		true->
			RoleUniteB = custom_unite_buff:get_unite_buff(Type,SubType),
			mod_unite_buff_mgr:cast({get_pane_info,SubType,RoleID,RoleUniteB});
		_->
			{ok, Bin} = pt_141:write(14100,[SubType,0,0,[],[],[]]),
			lib_server_send:send_to_sid(Sid,Bin)
	end,
	{ok,Status};

%%材料提交
handle(14101,Status,[SubType,OpTy,Num])->
	NStatus = custom_unite_buff:submit_items(SubType,OpTy,Num,Status),
	{ok,NStatus};

%%领取
handle(14102,Status,[SubType,OpTy,Dot])->
	custom_unite_buff:fetch_awards(SubType,OpTy,Dot,Status),
	{ok,Status};


handle(_Cmd, _Status, _Data) ->
	ok.