syntax = "proto3";
option go_package = ".;pb";
import "battle/battle_msg.proto";
import "worldtask/worldtask_db.proto";
import "errorcode.proto";

// 我的世界任务
message WorldtaskMineReq {}

message WorldtaskMineResp { DBWorldtask task = 1; }

//接受任务
message WorldtaskAcceptReq{
  int32 groupId = 1;
  int32 taskId = 2;
}
message WorldtaskAcceptResp{
  ErrorCode Code = 1;
}

//任务完成条件推送
message WorldtaskCompletecondisPush{
  int32 groupId = 1;
  int32 taskId = 2;
  repeated int32 condiIds = 3;
}

//校验任务完成条件
message WorldtaskCompleteCondiReq{
  int32 groupId = 1;
  int32 taskId = 2;
  int32 condiId = 3;
}

message WorldtaskCompleteCondiResp{
  ErrorCode code = 1;
  int32 taskId = 2;
  int32 condiId = 3;
}

// 完成任务
message WorldtaskFinishReq {
  int32 groupId = 1;  //分组ID
  int32 taskId = 2;   //任务ID
}
message WorldtaskFinishResp {
  ErrorCode code = 1;
  int32 taskId = 2;
  int32 condiId = 3;
}

//任务完成条件达成的推送
message WorldtaskNexttaskPush {
  map<int32, Worldtask> nextTask = 1;
  repeated int32 finishedTaskIds = 2;// 当前完成的任务
}

// 开始战斗
message WorldtaskBattleStartReq {
  int32 battleConfId = 1;     //战斗配表ID
  BattleFormation battle = 2; //战斗类型
}

message WorldtaskBattleStartResp {
  BattleInfo info = 1; //战斗信息
}

// 战斗完成
message WorldtaskBattleFinishReq {
  int32 groupId = 1;
  int32 taskId = 2;        //任务ID
  int32 condiId = 3;  //完成条件ID 
  int32 battleConfId = 4;  //战斗配表ID
  BattleReport report = 5; //战报
}

message WorldtaskBattleFinishResp {
  int32 taskId = 1; //任务ID
}

// 当前完成的任务列表推送
message WorldtaskFinishIdsPush {
  repeated Worldtask taskList = 1; //完成的任务 key:groupId val:任务ID
}

// 章节奖励领取
message WorldtaskChapterrewardReq{
  int32 groupId = 1;
}

message WorldtaskChapterrewardResp{
  ErrorCode code = 1;
}