-- This file is generated by tools/json2lua.js

local ffxiv_ipc_effect8 = Proto("ffxiv_ipc_effect8", "FFXIV-IPC Effect8")

local effect8_fields = {
  padding_6_a0      = ProtoField.uint16("ffxiv_ipc_effect8.padding_6_a0", "padding_6A0", base.DEC),
  padding_6_a1      = ProtoField.uint16("ffxiv_ipc_effect8.padding_6_a1", "padding_6A1", base.DEC),
  padding_6_a2      = ProtoField.uint16("ffxiv_ipc_effect8.padding_6_a2", "padding_6A2", base.DEC),
  effect_target_id0 = ProtoField.uint64("ffxiv_ipc_effect8.effect_target_id0", "effectTargetId0", base.HEX),
  effect_target_id1 = ProtoField.uint64("ffxiv_ipc_effect8.effect_target_id1", "effectTargetId1", base.HEX),
  effect_target_id2 = ProtoField.uint64("ffxiv_ipc_effect8.effect_target_id2", "effectTargetId2", base.HEX),
  effect_target_id3 = ProtoField.uint64("ffxiv_ipc_effect8.effect_target_id3", "effectTargetId3", base.HEX),
  effect_target_id4 = ProtoField.uint64("ffxiv_ipc_effect8.effect_target_id4", "effectTargetId4", base.HEX),
  effect_target_id5 = ProtoField.uint64("ffxiv_ipc_effect8.effect_target_id5", "effectTargetId5", base.HEX),
  effect_target_id6 = ProtoField.uint64("ffxiv_ipc_effect8.effect_target_id6", "effectTargetId6", base.HEX),
  effect_target_id7 = ProtoField.uint64("ffxiv_ipc_effect8.effect_target_id7", "effectTargetId7", base.HEX),
  effect_flags      = ProtoField.uint32("ffxiv_ipc_effect8.effect_flags", "effectFlags", base.DEC),
  effect_flags2     = ProtoField.uint16("ffxiv_ipc_effect8.effect_flags2", "effectFlags2", base.DEC),
  padding_780       = ProtoField.uint16("ffxiv_ipc_effect8.padding_780", "padding_780", base.DEC),
  padding_781       = ProtoField.uint32("ffxiv_ipc_effect8.padding_781", "padding_781", base.DEC),
}

ffxiv_ipc_effect8.fields = effect8_fields

function ffxiv_ipc_effect8.dissector(tvbuf, pktinfo, root)
  local tree = root:add(ffxiv_ipc_effect8, tvbuf)
  pktinfo.cols.info:set("Effect8")

  local len = tvbuf:len()

  -- dissect effect_header
  local effect_header_dissector = Dissector.get('ffxiv_ipc_effect_header')
  local effect_header_pos = 0
  local effect_header_len = 42
  local effect_header_count = 1

  while effect_header_pos + effect_header_len <= len do
    local effect_header_tvbr = tvbuf:range(effect_header_pos, 42)
    effect_header_dissector:call(effect_header_tvbr:tvb(), pktinfo, root)
    effect_header_pos = effect_header_pos + effect_header_len
    effect_header_count = effect_header_count - 1
    if effect_header_count <= 0 then
      break
    end
  end

  -- dissect effect_entry
  local effect_entry_dissector = Dissector.get('ffxiv_ipc_effect_entry')
  local effect_entry_pos = 42
  local effect_entry_len = 8
  local effect_entry_count = 64

  while effect_entry_pos + effect_entry_len <= len do
    local effect_entry_tvbr = tvbuf:range(effect_entry_pos, 8)
    effect_entry_dissector:call(effect_entry_tvbr:tvb(), pktinfo, root)
    effect_entry_pos = effect_entry_pos + effect_entry_len
    effect_entry_count = effect_entry_count - 1
    if effect_entry_count <= 0 then
      break
    end
  end

  -- dissect the padding_6_a0 field
  local padding_6_a0_tvbr = tvbuf:range(554, 2)
  local padding_6_a0_val  = padding_6_a0_tvbr:le_uint()
  tree:add_le(effect8_fields.padding_6_a0, padding_6_a0_tvbr, padding_6_a0_val)

  -- dissect the padding_6_a1 field
  local padding_6_a1_tvbr = tvbuf:range(556, 2)
  local padding_6_a1_val  = padding_6_a1_tvbr:le_uint()
  tree:add_le(effect8_fields.padding_6_a1, padding_6_a1_tvbr, padding_6_a1_val)

  -- dissect the padding_6_a2 field
  local padding_6_a2_tvbr = tvbuf:range(558, 2)
  local padding_6_a2_val  = padding_6_a2_tvbr:le_uint()
  tree:add_le(effect8_fields.padding_6_a2, padding_6_a2_tvbr, padding_6_a2_val)

  -- dissect the effect_target_id0 field
  local effect_target_id0_tvbr = tvbuf:range(560, 8)
  local effect_target_id0_val  = effect_target_id0_tvbr:le_uint64()
  tree:add_le(effect8_fields.effect_target_id0, effect_target_id0_tvbr, effect_target_id0_val)

  -- dissect the effect_target_id1 field
  local effect_target_id1_tvbr = tvbuf:range(568, 8)
  local effect_target_id1_val  = effect_target_id1_tvbr:le_uint64()
  tree:add_le(effect8_fields.effect_target_id1, effect_target_id1_tvbr, effect_target_id1_val)

  -- dissect the effect_target_id2 field
  local effect_target_id2_tvbr = tvbuf:range(576, 8)
  local effect_target_id2_val  = effect_target_id2_tvbr:le_uint64()
  tree:add_le(effect8_fields.effect_target_id2, effect_target_id2_tvbr, effect_target_id2_val)

  -- dissect the effect_target_id3 field
  local effect_target_id3_tvbr = tvbuf:range(584, 8)
  local effect_target_id3_val  = effect_target_id3_tvbr:le_uint64()
  tree:add_le(effect8_fields.effect_target_id3, effect_target_id3_tvbr, effect_target_id3_val)

  -- dissect the effect_target_id4 field
  local effect_target_id4_tvbr = tvbuf:range(592, 8)
  local effect_target_id4_val  = effect_target_id4_tvbr:le_uint64()
  tree:add_le(effect8_fields.effect_target_id4, effect_target_id4_tvbr, effect_target_id4_val)

  -- dissect the effect_target_id5 field
  local effect_target_id5_tvbr = tvbuf:range(600, 8)
  local effect_target_id5_val  = effect_target_id5_tvbr:le_uint64()
  tree:add_le(effect8_fields.effect_target_id5, effect_target_id5_tvbr, effect_target_id5_val)

  -- dissect the effect_target_id6 field
  local effect_target_id6_tvbr = tvbuf:range(608, 8)
  local effect_target_id6_val  = effect_target_id6_tvbr:le_uint64()
  tree:add_le(effect8_fields.effect_target_id6, effect_target_id6_tvbr, effect_target_id6_val)

  -- dissect the effect_target_id7 field
  local effect_target_id7_tvbr = tvbuf:range(616, 8)
  local effect_target_id7_val  = effect_target_id7_tvbr:le_uint64()
  tree:add_le(effect8_fields.effect_target_id7, effect_target_id7_tvbr, effect_target_id7_val)

  -- dissect the effect_flags field
  local effect_flags_tvbr = tvbuf:range(624, 4)
  local effect_flags_val  = effect_flags_tvbr:le_uint()
  tree:add_le(effect8_fields.effect_flags, effect_flags_tvbr, effect_flags_val)

  -- dissect the effect_flags2 field
  local effect_flags2_tvbr = tvbuf:range(628, 2)
  local effect_flags2_val  = effect_flags2_tvbr:le_uint()
  tree:add_le(effect8_fields.effect_flags2, effect_flags2_tvbr, effect_flags2_val)

  -- dissect the padding_780 field
  local padding_780_tvbr = tvbuf:range(630, 2)
  local padding_780_val  = padding_780_tvbr:le_uint()
  tree:add_le(effect8_fields.padding_780, padding_780_tvbr, padding_780_val)

  -- dissect the padding_781 field
  local padding_781_tvbr = tvbuf:range(632, 4)
  local padding_781_val  = padding_781_tvbr:le_uint()
  tree:add_le(effect8_fields.padding_781, padding_781_tvbr, padding_781_val)

  return len
end