syntax = "proto3";

package freeexile.storyline;

enum StoryAct {
  STORY_ACT_UNSPECIFIED = 0;
  STORY_ACT_I_HUNGER = 1;          // Hồi I: Đáy Vực Đói Rét (Cấp 1-10)
  STORY_ACT_II_MIASMA = 2;        // Hồi II: Vũng Bùn Nhục Nhã (Cấp 10-25)
  STORY_ACT_III_CRUCIBLE = 3;     // Hồi III: Bão Cát Nung Thể (Cấp 25-45)
  STORY_ACT_IV_TITAN_HUNT = 4;    // Hồi IV: Trảm Sát Thú Vương (Cấp 45-65)
  STORY_ACT_V_SOVEREIGN = 5;      // Hồi V: Vinh Quang Đỉnh Phong (Cấp 65-100+)
}

enum BeggarAscentStage {
  STAGE_UNSPECIFIED = 0;
  STAGE_MENDICANT = 1;            // Kẻ Ăn Mày Rách Rưới
  STAGE_SCAVENGER = 2;            // Kẻ Mót Xương Bùn Độc
  STAGE_BONE_WARRIOR = 3;         // Cuồng Cốt Chiến Giả
  STAGE_PRIMAL_HUNTER = 4;        // Thợ Săn Cự Thú Cổ Đại
  STAGE_SOVEREIGN_OUTCAST = 5;    // Bá Chủ Tối Cao Cõi Lưu Đày
}

message JournalEntryMessage {
  string journal_id = 1;
  StoryAct act = 2;
  BeggarAscentStage stage = 3;
  uint32 chapter_index = 4;
  string title = 5;
  string narrator_monologue = 6;
  string unlock_quest_id = 7;
  string location_name = 8;
  string quote_highlight = 9;
  bool is_unlocked = 10;
  bool is_read = 11;
}

message StoryActMessage {
  StoryAct act = 1;
  string title = 2;
  string subtitle = 3;
  string description = 4;
  string recommended_level_range = 5;
  string primary_zone_id = 6;
  string climax_boss_name = 7;
  BeggarAscentStage stage_unlocked = 8;
  string completion_reward_title = 9;
  bool is_completed = 10;
}

message StoryCutsceneMessage {
  string cutscene_id = 1;
  StoryAct act = 2;
  string trigger_quest_id = 3;
  string title = 4;
  string speaker_name = 5;
  repeated string monologue_lines = 6;
  string ambiance_sound = 7;
  uint64 granted_exp = 8;
}

message PlayerStoryStateMessage {
  string player_id = 1;
  StoryAct current_act = 2;
  BeggarAscentStage current_stage = 3;
  repeated StoryAct completed_acts = 4;
  repeated string unlocked_journal_ids = 5;
  repeated string read_journal_ids = 6;
  repeated string completed_quest_ids = 7;
  string reputation_title = 8;
}

message GetStoryStateRequest {
  string player_id = 1;
}

message GetStoryStateResponse {
  bool success = 1;
  string message = 2;
  PlayerStoryStateMessage state = 3;
  repeated JournalEntryMessage journals = 4;
  repeated StoryActMessage acts = 5;
}

message ReadJournalRequest {
  string player_id = 1;
  string journal_id = 2;
}

message ReadJournalResponse {
  bool success = 1;
  string message = 2;
  JournalEntryMessage journal = 3;
}
