%%%-------------------------------------------------------------------
%%% @author liushl
%%% @doc
%%%
%%% @end
%%%-------------------------------------------------------------------
-module(pp_equipment_check).
-author("liushl").

-include("server.hrl").

%% API
-export([]).
-compile(export_all).

%% 装备考核-BOSS首杀-基本信息
handle(_Cmd = 14501, Player, []) ->
    boss_first_blood:first_blood_info(Player#player_status.sid, Player#player_status.boss_first_blood),
    ok;

%% 装备考核-BOSS首杀-领奖 Type:1全服首杀奖励/2个人首杀奖励
handle(Cmd = 14502, Player, [BossId, Type]) ->
    case boss_first_blood_logic:get_award(Player, BossId, Type) of
        {false, Err} ->
            lib_server_send:send_to_sid(Player#player_status.sid, pt_145, Cmd, [BossId, Type, Err]),
            ok;
        {ok, NewPlayer} ->
            lib_server_send:send_to_sid(Player#player_status.sid, pt_145, Cmd, [BossId, Type, 1]),
            {true, NewPlayer};
        _ ->
            ok
    end;

%% 装备考核-装备任务-基本信息
handle(Cmd = 14510, Player, []) ->
    AllTasks = equipment_task:get_all_task_info(Player),
    {ok, Bin} = pt_145:write(Cmd, [AllTasks]),
    lib_server_send:send_to_sid(Player#player_status.sid, Bin),
    ok;
%% 装备考核-装备任务-任务领奖
handle(Cmd = 14512, Player, [TaskId]) ->
    case equipment_task:get_task_award(Player, TaskId) of
        {false, Err} ->
            lib_server_send:send_to_sid(Player#player_status.sid, pt_145, Cmd, [TaskId, Err]),
            ok;
        {ok, NewPlayer} ->
            lib_server_send:send_to_sid(Player#player_status.sid, pt_145, Cmd, [TaskId, 1]),
            {true, NewPlayer}
    end;
handle(Cmd, _Player, Arg) ->
    erlang:display({?MODULE, ?LINE, Cmd, Arg}),
    ok.