-module(pp_live_skill).

-export([handle/3]).

-include("server.hrl").
-include("common.hrl").
-include("def_fun.hrl").
-include("live_skill.hrl").
-include("errcode.hrl").

%% 技能界面
handle(43501, PS, []) ->
	lib_live_skill:get_skill_list(PS);

%% 烹饪 打造界面
handle(43502, PS, [SkillType]) ->
	lib_live_skill:skill_handle_show(PS, SkillType);

%% 烹饪 打造
handle(43503, #player_status{sid = Sid} = PS, [SkillType, TypeId]) ->
	case lib_live_skill:skill_handle(PS, SkillType, TypeId) of
		{true, NPS} ->
			{ok, NPS};
		{false, Res} ->
			{ok, Bin} = pt_435:write(43500, [Res]),
			lib_server_send:send_to_sid(Sid, Bin),
			ok
	end;

handle(_, PlayerStatus, _) ->
  {ok, PlayerStatus}.
