require "./avocado_2"
require "json"
require "./enums"

module Models

  @[AvocadoModel(opcode: 940)]
  struct FirstTime
    include Avocado::Pack

    property time : String = ""
  end
  
  @[AvocadoModel(opcode: 431)]
  struct Credentials
    include Avocado::Unpack

    property key : String = ""
    property login : String = ""
    property password : String = ""
    property mac : String = ""
    property is_cheat : UInt16 = 0
    property client_version : UInt16 = 0
  end

  struct InstAttribute
    include Avocado::Pack
    include Avocado::Unpack
    include JSON::Serializable

    property id : UInt16 = 0
    property value : UInt16 = 0
  end

  struct ItemAttribute
    include Avocado::Pack
    include Avocado::Unpack
    include JSON::Serializable

    property attr : UInt16 = 0
    property is_init : UInt8 = 0
  end

  # A2 (162 bytes)
  struct ItemGrid
    include Avocado::Pack
    include Avocado::Unpack
    include JSON::Serializable

    property id : UInt16 = 0
    property num : UInt16 = 0
    property endure : Array(UInt16) = Array(UInt16).new(2, 0) # 2
    property energy : Array(UInt16) = Array(UInt16).new(2, 0) # 2
    property forge_lv : UInt8 = 0
    property db_param : Array(UInt32) = Array(UInt32).new(2, 0) # 2
    property inst_attrs : Array(InstAttribute) = Array(InstAttribute).new(5)
    property item_attrs : Array(ItemAttribute) = Array(ItemAttribute).new(40)
    property change : Bool = true

    def initialize
      (1..5).each do |x|
          @inst_attrs << InstAttribute.from_json %({})
      end

      (1..40).each do |x|
          @item_attrs << ItemAttribute.from_json %({})
      end
    end
  end

  @[AvocadoModel(order: IO::ByteFormat::LittleEndian)]
  struct Look
    include Avocado::Pack
    include Avocado::Unpack
    include JSON::Serializable

    property ver : UInt16 = 0
    property type_id : UInt16 = 1
    property item_grids : Array(ItemGrid) = Array(ItemGrid).new(EQUIP_NUM) # 10
    property hair : UInt16 = 2062

    def initialize
      (1..EQUIP_NUM).each do |x|
          @item_grids << ItemGrid.new
      end
    end
  end

  struct Character
    include Avocado::Pack

    property is_active : UInt8 = 0

    @[AvocadoItem(if: "is_active")] # need to implement it in avocado parser 2
    property name : String = ""

    @[AvocadoItem(if: "is_active")] 
    property job : String = ""

    @[AvocadoItem(if: "is_active")]
    property level : UInt16 = 0

    @[AvocadoItem(if: "is_active")]
    property look_size : UInt16 = 1626

    @[AvocadoItem(if: "is_active")]
    property look : Look = Look.new
  end

  @[AvocadoModel(opcode: 931)]
  struct Auth
    include Avocado::Pack

    property error_code : UInt16 = 0
    property key_len : UInt16 = 8
    property key : Bytes = Bytes[0x7C, 0x35, 0x09, 0x19, 0xB2, 0x50, 0xD3, 0x49]

    @[AvocadoItem(len: true)]
    property characters : Array(Character) = Array(Character).new(0)
    property pincode : UInt8 = 0
    property encryption : UInt32 = 0
    property dw_flag : UInt32 = 12820
  end

  @[AvocadoModel(opcode: 435)]
  struct CreateCharacter
    include Avocado::Unpack

    property name : String = ""
    property map : String = ""
    property look_size : UInt16 = 0
    property look : Look = Look.new
  end

  @[AvocadoModel(opcode: 935)]
  struct CreateCharacterReply
    include Avocado::Pack

    property error_code : UInt16 = 0
  end

  @[AvocadoModel(opcode: 436)]
  struct DeleteCharacter
    include Avocado::Unpack

    property name : String = ""
    property pincode : String = ""
  end

  @[AvocadoModel(opcode: 936)]
  struct DeleteCharacterReply
    include Avocado::Pack

    property error_code : UInt16 = 0
  end

  @[AvocadoModel(opcode: 346)]
  struct CreatePincode
    include Avocado::Unpack

    property pincode : String = ""
  end

  @[AvocadoModel(opcode: 941)]
  struct CreatePincodeReply
    include Avocado::Pack

    property error_code : UInt16 = 0
  end

  @[AvocadoModel(opcode: 347)]
  struct ChangePincode
    include Avocado::Unpack

    property old_pincode : String = ""
    property new_pincode : String = ""
  end

  @[AvocadoModel(opcode: 942)]
  struct ChangePincodeReply
    include Avocado::Pack

    property error_code : UInt16 = 0
  end

  @[AvocadoModel(opcode: 432)]
  struct ExitAccount
    include Avocado::Unpack

    property error_code : UInt16 = 0
  end

  @[AvocadoModel(opcode: 433)]
  struct EnterGame
    include Avocado::Unpack

    property character_name : String = ""
  end

  struct Position
    include Avocado::Pack

    property x : UInt32 = 220025
    property y : UInt32 = 269725
    property radius : UInt32 = 40
  end

  struct CharacterSide
    include Avocado::Pack

    property side_id : UInt16 = 0
  end

  struct EntityEvent
    include Avocado::Pack

    property entity_id : UInt32 = 10262
    property entity_type : UInt8 = 1
    property event_id : UInt16 = 0
    property event_name : String = ""
  end

  struct CharacterLookBoat
    include Avocado::Pack

    property pos_id : UInt16 = 0
    property boat_id : UInt16 = 0
    property header : UInt16 = 0
    property body : UInt16 = 0
    property engine : UInt16 = 0
    property cannon : UInt16 = 0
    property equipment : UInt16 = 0
  end

  struct CharacterLookItemSync
    include Avocado::Pack

    property endure : UInt16 = 0
    property energy : UInt16 = 0
    property is_valid : UInt8 = 0
  end

  struct CharacterLookItemShow
    include Avocado::Pack

    property num : UInt16 = 0 
    property endure : Array(UInt16) = Array(UInt16).new(2, 0) # 2
    property energy : Array(UInt16) = Array(UInt16).new(2, 0) # 2
    property forge_level : UInt8 = 1
    property is_valid : UInt8 = 1
  end

  struct CharacterLookItem
      include Avocado::Pack

      property id : UInt32 = 0 
      property need_lv : UInt8 = 0
      property item_sync : CharacterLookItemSync = CharacterLookItemSync.new
      property item_show : CharacterLookItemShow = CharacterLookItemShow.new
      property is_db_params : UInt8 = 0
      property db_param : Array(UInt32) = Array(UInt32).new(2, 0) # 2
      property is_inst_attrs : UInt8 = 0
      property inst_attrs : Array(InstAttribute) = Array(InstAttribute).new(5)

      def pack(io, order, syn_type)
          @id.pack(io, order)

          if @id != 0
              @need_lv.pack(io, order)

              if syn_type == SynLookType::SYN_LOOK_CHANGE
                  @item_sync.pack(io, order)
              else
                  @item_show.pack(io, order)
                  @is_db_params.pack(io, order)
                  
                  if @is_db_params != 0
                    @db_param.pack(io, order)

                    @is_inst_attrs.pack(io, order)

                    if @is_inst_attrs != 0 
                        @inst_attrs.pack(io, order)
                    end
                  end
              end
          end
      end

      def pack(io, order)
          
      end
  end

  struct CharacterLookHuman
      include Avocado::Pack

      property hair_id : UInt16 = 2062
      property item_grid : Array(CharacterLookItem) = Array(CharacterLookItem).new(10)

      def initialize
          # hat
          hat = CharacterLookItem.new
          hat.id = 2554

          @item_grid << hat

          (2..10).each do |x|
              @item_grid << CharacterLookItem.new
          end
      end

      def pack(io, order, syn_type)
          @hair_id.pack(io, order)

          @item_grid.each do |item|
              item.pack(io, order, syn_type)
          end
      end

      def pack(io, order)
      end
  end

  struct CharacterLook
      include Avocado::Pack

      property syn_type : UInt8 = 0
      property type_id : UInt16 = 2
      property is_boat : UInt8 = 0
      property look_boat : CharacterLookBoat = CharacterLookBoat.new
      property look_human : CharacterLookHuman = CharacterLookHuman.new

      def pack(io, order = IO::ByteFormat::BigEndian)
          @syn_type.pack(io, order)
          @type_id.pack(io, order)
          @is_boat.pack(io, order)

          if @is_boat == 1 
              @look_boat.pack(io, order)
          else
              @look_human.pack(io, order, syn_type)
          end
      end
  end

  struct CharacterPK
    include Avocado::Pack

    property pk_ctrl : UInt8 = 1 # 1 == pk, 2 == friendly
  end

  struct CharacterAppendLook
    include Avocado::Pack

    property look_id : UInt16 = 0

    @[AvocadoItem(if: "look_id")] # need to implement it in avocado parser 2
    property is_valid : UInt8 = 0
  end

  struct CharacterBase
    include Avocado::Pack

    property cha_id : UInt32 = 10262
    # property world_id : UInt32 = 10262 (not supported by latest sources)
    property comm_id : UInt32 = 10262
    property comm_name : String = "test"
    property gm_lv : UInt8 = 30
    property handle : UInt32 = 33565841
    property ctrl_type : UInt8 = 1
    property name : String = ""
    property motto_name : String = ""
    property icon : UInt16 = 2
    property guild_id : UInt32 = 0
    property guild_name : String = ""
    property guild_motto : String = ""
    property stall_name : String = ""
    property state : UInt16 = 1
    property position : Position = Position.new
    property team_leader_id : UInt32 = 0
    property is_player : UInt8 = 0
    property side : CharacterSide = CharacterSide.new
    property entity_event : EntityEvent = EntityEvent.new
    property look : CharacterLook = CharacterLook.new
    #property pk_ctrl : CharacterPK = CharacterPK.new
    #property look_append : Array(CharacterAppendLook) = Array(CharacterAppendLook).new(4)

    def initialize
      (1..ESPE_KBGRID_NUM).each do |x|
          #@look_append << CharacterAppendLook.new
      end
    end
  end

  struct CharacterSkill
    include Avocado::Pack

    property id : UInt16 = 0
    property state : UInt8 = 0
    property level : UInt8 = 0
    property use_sp : UInt16 = 0
    property use_endure : UInt16 = 0
    property use_energy : UInt16 = 0
    property resume_time : UInt32 = 0
    property range_type : UInt16 = 0
    property params : Array(UInt16) = Array(UInt16).new(0, 0) # 4

    def initialize(id, level, range_params)
      @id = id
      @level = level

      if range_params.nil?
        @range_type = RANGE_TYPE_NONE.to_u16
      else
        range_params.each do |param|
          @params << param
        end
      end
    end
  end

  struct CharacterSkillBag
    include Avocado::Pack

    #property default_skill_id : UInt16 = 0
    #property type : UInt8 = 0
    property skill_num : UInt16 = 0
    property skills : Array(CharacterSkill) = Array(CharacterSkill).new(0)
    
    def initialize
      @skills << CharacterSkill.new(0x19, 1, nil)
      @skills << CharacterSkill.new(0x1C, 1, nil)
      @skills << CharacterSkill.new(0x1D, 1, nil)
      @skills << CharacterSkill.new(0x20, 1, nil)
      @skills << CharacterSkill.new(0x21, 1, nil)
      @skills << CharacterSkill.new(0x23, 1, nil)
      @skills << CharacterSkill.new(0x25, 1, nil)
      @skills << CharacterSkill.new(0x26, 1, nil)

      @skill_num = @skills.size.to_u16
    end
  end

  struct SkillState
    include Avocado::Pack

    property id : UInt8 = 0
    property level : UInt8 = 0
    property duration : UInt32 = 0
    property start : UInt32 = 0
  end

  struct CharacterSkillState
    include Avocado::Pack

    property current_server_time : UInt32 = 0

    @[AvocadoItem(len: true)]
    property states : Array(SkillState) = Array(SkillState).new(0)
  end

  struct Attribute
    include Avocado::Pack

    property id : UInt8 = 0
    property value : UInt32 = 0
  end

  struct CharacterAttribute
    include Avocado::Pack

    property type : UInt8 = 0
    property num : UInt16 = 0
    property attributes : Array(Attribute) = Array(Attribute).new(0)
  end

  struct Item
    property id : UInt16 = 0
    property type : UInt32 = 0
  end

  struct KitbagItem
    include Avocado::Pack

    property grid_id : UInt16 = 0
    property id : UInt16 = 0
    property db_id : UInt16 = 0 
    property need_level : UInt16 = 0
    property num : UInt16 = 0
    property endure : Array(UInt16) = Array(UInt16).new(2, 0) # 2
    property energy : Array(UInt16) = Array(UInt16).new(2, 0) # 2
    property forge_level : UInt8 = 0
    property is_valid : Bool = false
    property item_db_params0 : Array(UInt32) = Array(UInt32).new(0, 0)
    property item_db_forge : UInt32 = 0
    property item_db_params1 : Array(UInt32) = Array(UInt32).new(0, 0)
    property is_params : Bool = false
    property inst_attrs : Array(InstAttribute) = Array(InstAttribute).new(0) # 5

    def initialize(items)
      #if items[id].type == ItemType::Boat # Need to implement parser of items data from official client
        #item_db_params0 << UInt32.new(0)
        #item_db_params1 << UInt32.new(0)
      #else
        item_db_params0 << UInt32.new(0)
      #end

      @is_params = @inst_attrs.size != 0 ? true : false
    end
  end

  struct CharacterKitbag
    include Avocado::Pack

    property type : UInt8 = 0

    @[AvocadoItem(equal: {"type": SYN_KITBAG::INIT})] # need to implement it in avocado parser 2
    property keybag_num : UInt16 = 0

    property items : Array(KitbagItem) = Array(KitbagItem).new(48)

    def initialize
      (1..MAX_KBITEM_NUM_PER_TYPE).each do |x|
          @items << KitbagItem.new(Array(Item).new)
      end
    end
  end

  struct Shortcut
    include Avocado::Pack

    property type : UInt8 = 0
    property grid_id : UInt16 = 0
  end

  struct CharacterShortcut
    include Avocado::Pack

    property shortcuts : Array(Shortcut) = Array(Shortcut).new(0)

    def initialize
      (1..SHORT_CUT_NUM).each do |x|
          @shortcuts << Shortcut.new
      end
    end
  end

  struct CharacterBoat
    include Avocado::Pack

    property character_base : CharacterBase = CharacterBase.new
    property character_attribute : CharacterAttribute = CharacterAttribute.new
    property character_kitbag : CharacterKitbag = CharacterKitbag.new
    property character_skill_state : CharacterSkillState = CharacterSkillState.new
  end

  @[AvocadoModel(opcode: 516)]
  struct EnterGameReply
    include Avocado::Pack

    property enter_ret : UInt16 = 0
    property auto_lock : UInt8 = 0
    property kitbag_lock : UInt8 = 0
    property enter_type : UInt8 = 1
    property is_new_char : UInt8 = 0
    property map_name : String = "garner"
    property can_team : UInt8 = 1
    property imps : UInt32 = 2
    property character_base : CharacterBase = CharacterBase.new
    property character_skill_bag : CharacterSkillBag = CharacterSkillBag.new
    property undefined : Bytes = Bytes[0x00, 0x00, 0x00, 0x4A, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x64, 0x02, 0x00, 0x00, 0x00, 0x17, 0x03, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x07, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x01, 0x0B, 0x00, 0x00, 0x00, 0x01, 0x0C, 0x00, 0x00, 0x00, 0x01, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x05, 0x11, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x02, 0x71, 0x16, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x05, 0xDC, 0x19, 0x00, 0x00, 0x00, 0x05, 0x1A, 0x00, 0x00, 0x00, 0x05, 0x1B, 0x00, 0x00, 0x00, 0x05, 0x1C, 0x00, 0x00, 0x00, 0x05, 0x1D, 0x00, 0x00, 0x00, 0x05, 0x1E, 0x00, 0x00, 0x00, 0x05, 0x1F, 0x00, 0x00, 0x00, 0x64, 0x20, 0x00, 0x00, 0x00, 0x17, 0x21, 0x00, 0x00, 0x00, 0x07, 0x22, 0x00, 0x00, 0x00, 0x07, 0x23, 0x00, 0x00, 0x00, 0x02, 0x24, 0x00, 0x00, 0x00, 0x0A, 0x25, 0x00, 0x00, 0x00, 0x0A, 0x26, 0x00, 0x00, 0x00, 0x69, 0x27, 0x00, 0x00, 0x00, 0x0F, 0x28, 0x00, 0x00, 0x00, 0x02, 0x29, 0x00, 0x00, 0x00, 0x01, 0x2A, 0x00, 0x00, 0x05, 0x94, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x00, 0x01, 0xE0, 0x2D, 0x00, 0x00, 0x00, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x00, 0x2F, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x05, 0x33, 0x00, 0x00, 0x00, 0x05, 0x34, 0x00, 0x00, 0x00, 0x05, 0x35, 0x00, 0x00, 0x00, 0x05, 0x36, 0x00, 0x00, 0x00, 0x05, 0x37, 0x00, 0x00, 0x00, 0x05, 0x38, 0x00, 0x00, 0x00, 0x64, 0x39, 0x00, 0x00, 0x00, 0x17, 0x3A, 0x00, 0x00, 0x00, 0x07, 0x3B, 0x00, 0x00, 0x00, 0x07, 0x3C, 0x00, 0x00, 0x00, 0x02, 0x3D, 0x00, 0x00, 0x00, 0x0A, 0x3E, 0x00, 0x00, 0x00, 0x0A, 0x3F, 0x00, 0x00, 0x00, 0x69, 0x40, 0x00, 0x00, 0x00, 0x0F, 0x41, 0x00, 0x00, 0x00, 0x02, 0x42, 0x00, 0x00, 0x00, 0x01, 0x43, 0x00, 0x00, 0x05, 0x94, 0x44, 0x00, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x01, 0xE0, 0x46, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x01, 0x21, 0x00, 0x01, 0x27, 0x10, 0x27, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x24, 0x00, 0x02, 0x00, 0x2F, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x81, 0x00, 0x01, 0x27, 0x10, 0x27, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x27, 0x00, 0x01, 0x00, 0x24, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x08, 0x00, 0x01, 0x27, 0x10, 0x27, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x22, 0x00, 0x0E, 0x00, 0x23, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x01, 0xB4, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x16]
    property undefined2 : Bytes = Bytes[0x00, 0xA5, 0x80, 0x00, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x10, 0xB0, 0x00, 0x28, 0xB4, 0xB0, 0x00, 0x28, 0xB4, 0x00, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x09, 0x02, 0x00, 0x10, 0xC1, 0xE0, 0xED, 0xEA, 0xE8, 0xF0, 0x20, 0x2D, 0x20, 0xCC, 0xEE, 0xED, 0xE8, 0xEA, 0xE0, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x03, 0x63, 0x62, 0x00, 0x04, 0x20, 0x40, 0x00, 0x00, 0x00, 0x28, 0x00, 0xB4, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB0, 0x00, 0x28, 0xB4, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x2C, 0x01, 0x00, 0x00, 0x14, 0x9B, 0x1F, 0x00, 0x00, 0x14, 0x9B, 0x2A, 0x00, 0x00, 0x04, 0xC1, 0x2C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xAC, 0x80, 0x00, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x0B, 0xB0, 0x00, 0x29, 0x35, 0xB0, 0x00, 0x29, 0x35, 0x00, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x8A, 0x02, 0x00, 0x17, 0xCE, 0xF2, 0xE4, 0xE0, 0xFE, 0xF9, 0xE0, 0xFF, 0x20, 0xE4, 0xEE, 0xEB, 0xE3, 0xE8, 0x20, 0x2D, 0x20, 0xC1, 0xE8, 0xED, 0xE3, 0xEE, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x03, 0x67, 0xA9, 0x00, 0x04, 0x24, 0x9F, 0x00, 0x00, 0x00, 0x28, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB0, 0x00, 0x29, 0x35, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x2C, 0x01, 0x00, 0x00, 0x14, 0x9B, 0x1F, 0x00, 0x00, 0x14, 0x9B, 0x2A, 0x00, 0x00, 0x04, 0xC1, 0x2C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x80, 0x00, 0x00, 0x00, 0x01, 0xFC, 0x00, 0x00, 0x28, 0x16, 0x00, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x0C, 0x80, 0x00, 0x00, 0x00, 0x02, 0x18, 0x00, 0x00, 0x01, 0xF4, 0x00, 0x0C, 0x80, 0x00, 0x00, 0x00, 0x03, 0x3C, 0x01, 0x00, 0x01, 0x00, 0x00, 0x37, 0x80, 0x00, 0x00, 0x00, 0x02, 0x05, 0x00, 0x2D, 0xCF, 0xEE, 0xE3, 0xEE, 0xE4, 0xE0, 0x3A, 0x20, 0xC2, 0x20, 0xEB, 0xEE, 0xEA, 0xE0, 0xF6, 0xE8, 0xE8, 0x20, 0x28, 0x32, 0x34, 0x36, 0x32, 0x2C, 0x20, 0x32, 0x38, 0x34, 0x30, 0x29, 0x20, 0xC3, 0xF0, 0xEE, 0xE7, 0xEE, 0xE2, 0xE0, 0xFF, 0x20, 0xE1, 0xF3, 0xF0, 0xFF, 0x00, 0x00, 0x31, 0x80, 0x00, 0x00, 0x00, 0x02, 0x05, 0x00, 0x27, 0xCF, 0xEE, 0xE3, 0xEE, 0xE4, 0xE0, 0x3A, 0x20, 0xC2, 0x20, 0xEB, 0xEE, 0xEA, 0xE0, 0xF6, 0xE8, 0xE8, 0x20, 0x28, 0x32, 0x33, 0x32, 0x32, 0x2C, 0x20, 0x33, 0x30, 0x33, 0x36, 0x29, 0x20, 0xD2, 0xEE, 0xF0, 0xED, 0xE0, 0xE4, 0xEE, 0x00]
    #property character_skill_state : CharacterSkillState = CharacterSkillState.new
    #property character_attribute : CharacterAttribute = CharacterAttribute.new
    #property character_kitbag : CharacterKitbag = CharacterKitbag.new
    #property character_kitbag_temp : CharacterKitbag = CharacterKitbag.new
    #property character_shortcut : CharacterShortcut = CharacterShortcut.new

    #@[AvocadoItem(len: true)]
    #property character_boats : Array(CharacterBoat) = Array(CharacterBoat).new(0)
    #property character_kitbag_temp : CharacterKitbag = CharacterKitbag.new
  end
end