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

local db = require('ffxiv_db')
local ffxiv_ipc_npc_spawn = Proto("ffxiv_ipc_npc_spawn", "FFXIV-IPC Npc Spawn")

local npc_spawn_fields = {
  gimmick_id              = ProtoField.uint32("ffxiv_ipc_npc_spawn.gimmick_id", "gimmickId", base.DEC),
  u2b                     = ProtoField.uint8("ffxiv_ipc_npc_spawn.u2b", "u2b", base.DEC),
  u2ab                    = ProtoField.uint8("ffxiv_ipc_npc_spawn.u2ab", "u2ab", base.DEC),
  gm_rank                 = ProtoField.uint8("ffxiv_ipc_npc_spawn.gm_rank", "gmRank", base.DEC),
  u3b                     = ProtoField.uint8("ffxiv_ipc_npc_spawn.u3b", "u3b", base.DEC),
  aggression_mode         = ProtoField.uint8("ffxiv_ipc_npc_spawn.aggression_mode", "aggressionMode", base.DEC),
  online_status           = ProtoField.uint8("ffxiv_ipc_npc_spawn.online_status", "onlineStatus", base.DEC),
  u3c                     = ProtoField.uint8("ffxiv_ipc_npc_spawn.u3c", "u3c", base.DEC),
  pose                    = ProtoField.uint8("ffxiv_ipc_npc_spawn.pose", "pose", base.DEC),
  u4                      = ProtoField.uint32("ffxiv_ipc_npc_spawn.u4", "u4", base.DEC),
  target_id               = ProtoField.uint64("ffxiv_ipc_npc_spawn.target_id", "targetId", base.HEX),
  u6                      = ProtoField.uint32("ffxiv_ipc_npc_spawn.u6", "u6", base.DEC),
  u7                      = ProtoField.uint32("ffxiv_ipc_npc_spawn.u7", "u7", base.DEC),
  main_weapon_model       = ProtoField.uint64("ffxiv_ipc_npc_spawn.main_weapon_model", "mainWeaponModel", base.DEC),
  sec_weapon_model        = ProtoField.uint64("ffxiv_ipc_npc_spawn.sec_weapon_model", "secWeaponModel", base.DEC),
  craft_tool_model        = ProtoField.uint64("ffxiv_ipc_npc_spawn.craft_tool_model", "craftToolModel", base.DEC),
  u14                     = ProtoField.uint32("ffxiv_ipc_npc_spawn.u14", "u14", base.DEC),
  u15                     = ProtoField.uint32("ffxiv_ipc_npc_spawn.u15", "u15", base.DEC),
  b_npcbase               = ProtoField.uint32("ffxiv_ipc_npc_spawn.b_npcbase", "bNPCBase", base.DEC),
  b_npcname               = ProtoField.uint32("ffxiv_ipc_npc_spawn.b_npcname", "bNPCName", base.DEC, db.BNpcName),
  level_id                = ProtoField.uint32("ffxiv_ipc_npc_spawn.level_id", "levelId", base.DEC),
  u19                     = ProtoField.uint32("ffxiv_ipc_npc_spawn.u19", "u19", base.DEC),
  director_id             = ProtoField.uint32("ffxiv_ipc_npc_spawn.director_id", "directorId", base.DEC),
  spawner_id              = ProtoField.uint32("ffxiv_ipc_npc_spawn.spawner_id", "spawnerId", base.DEC),
  parent_actor_id         = ProtoField.uint32("ffxiv_ipc_npc_spawn.parent_actor_id", "parentActorId", base.DEC),
  h_pmax                  = ProtoField.uint32("ffxiv_ipc_npc_spawn.h_pmax", "hPMax", base.DEC),
  h_pcurr                 = ProtoField.uint32("ffxiv_ipc_npc_spawn.h_pcurr", "hPCurr", base.DEC),
  display_flags           = ProtoField.uint32("ffxiv_ipc_npc_spawn.display_flags", "displayFlags", base.DEC),
  fate_id                 = ProtoField.uint16("ffxiv_ipc_npc_spawn.fate_id", "fateID", base.DEC),
  m_pcurr                 = ProtoField.uint16("ffxiv_ipc_npc_spawn.m_pcurr", "mPCurr", base.DEC),
  t_pcurr                 = ProtoField.uint16("ffxiv_ipc_npc_spawn.t_pcurr", "tPCurr", base.DEC),
  m_pmax                  = ProtoField.uint16("ffxiv_ipc_npc_spawn.m_pmax", "mPMax", base.DEC),
  t_pmax                  = ProtoField.uint16("ffxiv_ipc_npc_spawn.t_pmax", "tPMax", base.DEC),
  model_chara             = ProtoField.uint16("ffxiv_ipc_npc_spawn.model_chara", "modelChara", base.DEC),
  rotation                = ProtoField.uint16("ffxiv_ipc_npc_spawn.rotation", "rotation", base.DEC),
  active_minion           = ProtoField.uint16("ffxiv_ipc_npc_spawn.active_minion", "activeMinion", base.DEC),
  spawn_index             = ProtoField.uint8("ffxiv_ipc_npc_spawn.spawn_index", "spawnIndex", base.DEC),
  state                   = ProtoField.uint8("ffxiv_ipc_npc_spawn.state", "state", base.DEC),
  persistant_emote        = ProtoField.uint8("ffxiv_ipc_npc_spawn.persistant_emote", "persistantEmote", base.DEC),
  model_type              = ProtoField.uint8("ffxiv_ipc_npc_spawn.model_type", "modelType", base.DEC),
  subtype                 = ProtoField.uint8("ffxiv_ipc_npc_spawn.subtype", "subtype", base.DEC),
  voice                   = ProtoField.uint8("ffxiv_ipc_npc_spawn.voice", "voice", base.DEC),
  enemy_type              = ProtoField.uint8("ffxiv_ipc_npc_spawn.enemy_type", "enemyType", base.DEC),
  level                   = ProtoField.uint8("ffxiv_ipc_npc_spawn.level", "level", base.DEC),
  class_job               = ProtoField.uint8("ffxiv_ipc_npc_spawn.class_job", "classJob", base.DEC),
  u26d                    = ProtoField.uint8("ffxiv_ipc_npc_spawn.u26d", "u26d", base.DEC),
  u27a                    = ProtoField.uint16("ffxiv_ipc_npc_spawn.u27a", "u27a", base.DEC),
  current_mount           = ProtoField.uint8("ffxiv_ipc_npc_spawn.current_mount", "currentMount", base.DEC),
  mount_head              = ProtoField.uint8("ffxiv_ipc_npc_spawn.mount_head", "mountHead", base.DEC),
  mount_body              = ProtoField.uint8("ffxiv_ipc_npc_spawn.mount_body", "mountBody", base.DEC),
  mount_feet              = ProtoField.uint8("ffxiv_ipc_npc_spawn.mount_feet", "mountFeet", base.DEC),
  mount_color             = ProtoField.uint8("ffxiv_ipc_npc_spawn.mount_color", "mountColor", base.DEC),
  scale                   = ProtoField.uint8("ffxiv_ipc_npc_spawn.scale", "scale", base.DEC),
  elemental_level         = ProtoField.uint16("ffxiv_ipc_npc_spawn.elemental_level", "elementalLevel", base.DEC),
  element                 = ProtoField.uint16("ffxiv_ipc_npc_spawn.element", "element", base.DEC),
  models0                 = ProtoField.uint32("ffxiv_ipc_npc_spawn.models0", "models0", base.DEC),
  models1                 = ProtoField.uint32("ffxiv_ipc_npc_spawn.models1", "models1", base.DEC),
  models2                 = ProtoField.uint32("ffxiv_ipc_npc_spawn.models2", "models2", base.DEC),
  models3                 = ProtoField.uint32("ffxiv_ipc_npc_spawn.models3", "models3", base.DEC),
  models4                 = ProtoField.uint32("ffxiv_ipc_npc_spawn.models4", "models4", base.DEC),
  models5                 = ProtoField.uint32("ffxiv_ipc_npc_spawn.models5", "models5", base.DEC),
  models6                 = ProtoField.uint32("ffxiv_ipc_npc_spawn.models6", "models6", base.DEC),
  models7                 = ProtoField.uint32("ffxiv_ipc_npc_spawn.models7", "models7", base.DEC),
  models8                 = ProtoField.uint32("ffxiv_ipc_npc_spawn.models8", "models8", base.DEC),
  models9                 = ProtoField.uint32("ffxiv_ipc_npc_spawn.models9", "models9", base.DEC),
  nickname                = ProtoField.string("ffxiv_ipc_npc_spawn.nickname", "Nickname", base.UNICODE),
  look                    = ProtoField.string("ffxiv_ipc_npc_spawn.look", "Look", base.UNICODE),
  fc_tag                  = ProtoField.string("ffxiv_ipc_npc_spawn.fc_tag", "fcTag", base.UNICODE),
  b_npcpart_slot          = ProtoField.uint8("ffxiv_ipc_npc_spawn.b_npcpart_slot", "bNPCPartSlot", base.DEC),
  unk32                   = ProtoField.uint8("ffxiv_ipc_npc_spawn.unk32", "unk32", base.DEC),
  unk33                   = ProtoField.uint16("ffxiv_ipc_npc_spawn.unk33", "unk33", base.DEC),
}

ffxiv_ipc_npc_spawn.fields = npc_spawn_fields

function ffxiv_ipc_npc_spawn.dissector(tvbuf, pktinfo, root)
  local tree = root:add(ffxiv_ipc_npc_spawn, tvbuf)
  pktinfo.cols.info:set("Npc Spawn")

  local len = tvbuf:len()

  -- dissect the gimmick_id field
  local gimmick_id_tvbr = tvbuf:range(0, 4)
  local gimmick_id_val  = gimmick_id_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.gimmick_id, gimmick_id_tvbr, gimmick_id_val)

  -- dissect the u2b field
  local u2b_tvbr = tvbuf:range(4, 1)
  local u2b_val  = u2b_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.u2b, u2b_tvbr, u2b_val)

  -- dissect the u2ab field
  local u2ab_tvbr = tvbuf:range(5, 1)
  local u2ab_val  = u2ab_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.u2ab, u2ab_tvbr, u2ab_val)

  -- dissect the gm_rank field
  local gm_rank_tvbr = tvbuf:range(6, 1)
  local gm_rank_val  = gm_rank_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.gm_rank, gm_rank_tvbr, gm_rank_val)

  -- dissect the u3b field
  local u3b_tvbr = tvbuf:range(7, 1)
  local u3b_val  = u3b_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.u3b, u3b_tvbr, u3b_val)

  -- dissect the aggression_mode field
  local aggression_mode_tvbr = tvbuf:range(8, 1)
  local aggression_mode_val  = aggression_mode_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.aggression_mode, aggression_mode_tvbr, aggression_mode_val)

  -- dissect the online_status field
  local online_status_tvbr = tvbuf:range(9, 1)
  local online_status_val  = online_status_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.online_status, online_status_tvbr, online_status_val)

  -- dissect the u3c field
  local u3c_tvbr = tvbuf:range(10, 1)
  local u3c_val  = u3c_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.u3c, u3c_tvbr, u3c_val)

  -- dissect the pose field
  local pose_tvbr = tvbuf:range(11, 1)
  local pose_val  = pose_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.pose, pose_tvbr, pose_val)

  -- dissect the u4 field
  local u4_tvbr = tvbuf:range(12, 4)
  local u4_val  = u4_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.u4, u4_tvbr, u4_val)

  -- dissect the target_id field
  local target_id_tvbr = tvbuf:range(16, 8)
  local target_id_val  = target_id_tvbr:le_uint64()
  tree:add_le(npc_spawn_fields.target_id, target_id_tvbr, target_id_val)

  -- dissect the u6 field
  local u6_tvbr = tvbuf:range(24, 4)
  local u6_val  = u6_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.u6, u6_tvbr, u6_val)

  -- dissect the u7 field
  local u7_tvbr = tvbuf:range(28, 4)
  local u7_val  = u7_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.u7, u7_tvbr, u7_val)

  -- dissect the main_weapon_model field
  local main_weapon_model_tvbr = tvbuf:range(32, 8)
  local main_weapon_model_val  = main_weapon_model_tvbr:le_uint64()
  tree:add_le(npc_spawn_fields.main_weapon_model, main_weapon_model_tvbr, main_weapon_model_val)

  -- dissect the sec_weapon_model field
  local sec_weapon_model_tvbr = tvbuf:range(40, 8)
  local sec_weapon_model_val  = sec_weapon_model_tvbr:le_uint64()
  tree:add_le(npc_spawn_fields.sec_weapon_model, sec_weapon_model_tvbr, sec_weapon_model_val)

  -- dissect the craft_tool_model field
  local craft_tool_model_tvbr = tvbuf:range(48, 8)
  local craft_tool_model_val  = craft_tool_model_tvbr:le_uint64()
  tree:add_le(npc_spawn_fields.craft_tool_model, craft_tool_model_tvbr, craft_tool_model_val)

  -- dissect the u14 field
  local u14_tvbr = tvbuf:range(56, 4)
  local u14_val  = u14_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.u14, u14_tvbr, u14_val)

  -- dissect the u15 field
  local u15_tvbr = tvbuf:range(60, 4)
  local u15_val  = u15_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.u15, u15_tvbr, u15_val)

  -- dissect the b_npcbase field
  local b_npcbase_tvbr = tvbuf:range(64, 4)
  local b_npcbase_val  = b_npcbase_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.b_npcbase, b_npcbase_tvbr, b_npcbase_val)

  -- dissect the b_npcname field
  local b_npcname_tvbr = tvbuf:range(68, 4)
  local b_npcname_val  = b_npcname_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.b_npcname, b_npcname_tvbr, b_npcname_val)

  local b_npcname_display = ", bNPCName: " .. (db.BNpcName[b_npcname_val] or "(unknown)")
  pktinfo.cols.info:append(b_npcname_display)
  tree:append_text(b_npcname_display)

  -- dissect the level_id field
  local level_id_tvbr = tvbuf:range(72, 4)
  local level_id_val  = level_id_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.level_id, level_id_tvbr, level_id_val)

  -- dissect the u19 field
  local u19_tvbr = tvbuf:range(76, 4)
  local u19_val  = u19_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.u19, u19_tvbr, u19_val)

  -- dissect the director_id field
  local director_id_tvbr = tvbuf:range(80, 4)
  local director_id_val  = director_id_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.director_id, director_id_tvbr, director_id_val)

  -- dissect the spawner_id field
  local spawner_id_tvbr = tvbuf:range(84, 4)
  local spawner_id_val  = spawner_id_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.spawner_id, spawner_id_tvbr, spawner_id_val)

  -- dissect the parent_actor_id field
  local parent_actor_id_tvbr = tvbuf:range(88, 4)
  local parent_actor_id_val  = parent_actor_id_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.parent_actor_id, parent_actor_id_tvbr, parent_actor_id_val)

  -- dissect the h_pmax field
  local h_pmax_tvbr = tvbuf:range(92, 4)
  local h_pmax_val  = h_pmax_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.h_pmax, h_pmax_tvbr, h_pmax_val)

  -- dissect the h_pcurr field
  local h_pcurr_tvbr = tvbuf:range(96, 4)
  local h_pcurr_val  = h_pcurr_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.h_pcurr, h_pcurr_tvbr, h_pcurr_val)

  -- dissect the display_flags field
  local display_flags_tvbr = tvbuf:range(100, 4)
  local display_flags_val  = display_flags_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.display_flags, display_flags_tvbr, display_flags_val)

  -- dissect the fate_id field
  local fate_id_tvbr = tvbuf:range(104, 2)
  local fate_id_val  = fate_id_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.fate_id, fate_id_tvbr, fate_id_val)

  -- dissect the m_pcurr field
  local m_pcurr_tvbr = tvbuf:range(106, 2)
  local m_pcurr_val  = m_pcurr_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.m_pcurr, m_pcurr_tvbr, m_pcurr_val)

  -- dissect the t_pcurr field
  local t_pcurr_tvbr = tvbuf:range(108, 2)
  local t_pcurr_val  = t_pcurr_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.t_pcurr, t_pcurr_tvbr, t_pcurr_val)

  -- dissect the m_pmax field
  local m_pmax_tvbr = tvbuf:range(110, 2)
  local m_pmax_val  = m_pmax_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.m_pmax, m_pmax_tvbr, m_pmax_val)

  -- dissect the t_pmax field
  local t_pmax_tvbr = tvbuf:range(112, 2)
  local t_pmax_val  = t_pmax_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.t_pmax, t_pmax_tvbr, t_pmax_val)

  -- dissect the model_chara field
  local model_chara_tvbr = tvbuf:range(114, 2)
  local model_chara_val  = model_chara_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.model_chara, model_chara_tvbr, model_chara_val)

  -- dissect the rotation field
  local rotation_tvbr = tvbuf:range(116, 2)
  local rotation_val  = rotation_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.rotation, rotation_tvbr, rotation_val)

  -- dissect the active_minion field
  local active_minion_tvbr = tvbuf:range(118, 2)
  local active_minion_val  = active_minion_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.active_minion, active_minion_tvbr, active_minion_val)

  -- dissect the spawn_index field
  local spawn_index_tvbr = tvbuf:range(120, 1)
  local spawn_index_val  = spawn_index_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.spawn_index, spawn_index_tvbr, spawn_index_val)

  -- dissect the state field
  local state_tvbr = tvbuf:range(121, 1)
  local state_val  = state_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.state, state_tvbr, state_val)

  -- dissect the persistant_emote field
  local persistant_emote_tvbr = tvbuf:range(122, 1)
  local persistant_emote_val  = persistant_emote_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.persistant_emote, persistant_emote_tvbr, persistant_emote_val)

  -- dissect the model_type field
  local model_type_tvbr = tvbuf:range(123, 1)
  local model_type_val  = model_type_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.model_type, model_type_tvbr, model_type_val)

  -- dissect the subtype field
  local subtype_tvbr = tvbuf:range(124, 1)
  local subtype_val  = subtype_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.subtype, subtype_tvbr, subtype_val)

  -- dissect the voice field
  local voice_tvbr = tvbuf:range(125, 1)
  local voice_val  = voice_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.voice, voice_tvbr, voice_val)

  -- dissect the enemy_type field
  local enemy_type_tvbr = tvbuf:range(126, 1)
  local enemy_type_val  = enemy_type_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.enemy_type, enemy_type_tvbr, enemy_type_val)

  -- dissect the level field
  local level_tvbr = tvbuf:range(129, 1)
  local level_val  = level_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.level, level_tvbr, level_val)

  -- dissect the class_job field
  local class_job_tvbr = tvbuf:range(132, 1)
  local class_job_val  = class_job_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.class_job, class_job_tvbr, class_job_val)

  -- dissect the u26d field
  local u26d_tvbr = tvbuf:range(133, 1)
  local u26d_val  = u26d_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.u26d, u26d_tvbr, u26d_val)

  -- dissect the u27a field
  local u27a_tvbr = tvbuf:range(134, 2)
  local u27a_val  = u27a_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.u27a, u27a_tvbr, u27a_val)

  -- dissect the current_mount field
  local current_mount_tvbr = tvbuf:range(136, 1)
  local current_mount_val  = current_mount_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.current_mount, current_mount_tvbr, current_mount_val)

  -- dissect the mount_head field
  local mount_head_tvbr = tvbuf:range(137, 1)
  local mount_head_val  = mount_head_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.mount_head, mount_head_tvbr, mount_head_val)

  -- dissect the mount_body field
  local mount_body_tvbr = tvbuf:range(138, 1)
  local mount_body_val  = mount_body_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.mount_body, mount_body_tvbr, mount_body_val)

  -- dissect the mount_feet field
  local mount_feet_tvbr = tvbuf:range(139, 1)
  local mount_feet_val  = mount_feet_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.mount_feet, mount_feet_tvbr, mount_feet_val)

  -- dissect the mount_color field
  local mount_color_tvbr = tvbuf:range(140, 1)
  local mount_color_val  = mount_color_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.mount_color, mount_color_tvbr, mount_color_val)

  -- dissect the scale field
  local scale_tvbr = tvbuf:range(141, 1)
  local scale_val  = scale_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.scale, scale_tvbr, scale_val)

  -- dissect the elemental_level field
  local elemental_level_tvbr = tvbuf:range(142, 2)
  local elemental_level_val  = elemental_level_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.elemental_level, elemental_level_tvbr, elemental_level_val)

  -- dissect the element field
  local element_tvbr = tvbuf:range(144, 2)
  local element_val  = element_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.element, element_tvbr, element_val)

  -- dissect status_effect_list_item
  local status_effect_list_item_dissector = Dissector.get('ffxiv_ipc_status_effect_list_item')
  local status_effect_list_item_pos = 148
  local status_effect_list_item_len = 12
  local status_effect_list_item_count = 30

  while status_effect_list_item_pos + status_effect_list_item_len <= len do
    local status_effect_list_item_tvbr = tvbuf:range(status_effect_list_item_pos, 12)
    status_effect_list_item_dissector:call(status_effect_list_item_tvbr:tvb(), pktinfo, root)
    status_effect_list_item_pos = status_effect_list_item_pos + status_effect_list_item_len
    status_effect_list_item_count = status_effect_list_item_count - 1
    if status_effect_list_item_count <= 0 then
      break
    end
  end

  -- dissect position3
  local position3_dissector = Dissector.get('ffxiv_ipc_position3')
  local position3_pos = 508
  local position3_len = 12
  local position3_count = 1

  while position3_pos + position3_len <= len do
    local position3_tvbr = tvbuf:range(position3_pos, 12)
    position3_dissector:call(position3_tvbr:tvb(), pktinfo, root)
    position3_pos = position3_pos + position3_len
    position3_count = position3_count - 1
    if position3_count <= 0 then
      break
    end
  end

  -- dissect the models0 field
  local models0_tvbr = tvbuf:range(520, 4)
  local models0_val  = models0_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.models0, models0_tvbr, models0_val)

  -- dissect the models1 field
  local models1_tvbr = tvbuf:range(524, 4)
  local models1_val  = models1_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.models1, models1_tvbr, models1_val)

  -- dissect the models2 field
  local models2_tvbr = tvbuf:range(528, 4)
  local models2_val  = models2_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.models2, models2_tvbr, models2_val)

  -- dissect the models3 field
  local models3_tvbr = tvbuf:range(532, 4)
  local models3_val  = models3_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.models3, models3_tvbr, models3_val)

  -- dissect the models4 field
  local models4_tvbr = tvbuf:range(536, 4)
  local models4_val  = models4_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.models4, models4_tvbr, models4_val)

  -- dissect the models5 field
  local models5_tvbr = tvbuf:range(540, 4)
  local models5_val  = models5_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.models5, models5_tvbr, models5_val)

  -- dissect the models6 field
  local models6_tvbr = tvbuf:range(544, 4)
  local models6_val  = models6_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.models6, models6_tvbr, models6_val)

  -- dissect the models7 field
  local models7_tvbr = tvbuf:range(548, 4)
  local models7_val  = models7_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.models7, models7_tvbr, models7_val)

  -- dissect the models8 field
  local models8_tvbr = tvbuf:range(552, 4)
  local models8_val  = models8_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.models8, models8_tvbr, models8_val)

  -- dissect the models9 field
  local models9_tvbr = tvbuf:range(556, 4)
  local models9_val  = models9_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.models9, models9_tvbr, models9_val)

  -- dissect the nickname field
  if tvbuf:len() >= 592 then
    local nickname_tvbr = tvbuf:range(560, 32)
    local nickname_val  = nickname_tvbr:string(ENC_UTF_8)
    tree:add(npc_spawn_fields.nickname, nickname_tvbr, nickname_val)

    local nickname_display = ", Nickname: " .. nickname_val
    pktinfo.cols.info:append(nickname_display)
    tree:append_text(nickname_display)
  end

  -- dissect the look field
  if tvbuf:len() >= 618 then
    local look_tvbr = tvbuf:range(592, 26)
    local look_val  = look_tvbr:string(ENC_UTF_8)
    tree:add(npc_spawn_fields.look, look_tvbr, look_val)
  end

  -- dissect the fc_tag field
  local fc_tag_tvbr = tvbuf:range(618, 14)
  local fc_tag_val  = fc_tag_tvbr:string(ENC_UTF_8)
  tree:add(npc_spawn_fields.fc_tag, fc_tag_tvbr, fc_tag_val)

  -- dissect the b_npcpart_slot field
  local b_npcpart_slot_tvbr = tvbuf:range(632, 1)
  local b_npcpart_slot_val  = b_npcpart_slot_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.b_npcpart_slot, b_npcpart_slot_tvbr, b_npcpart_slot_val)

  -- dissect the unk32 field
  local unk32_tvbr = tvbuf:range(633, 1)
  local unk32_val  = unk32_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.unk32, unk32_tvbr, unk32_val)

  -- dissect the unk33 field
  local unk33_tvbr = tvbuf:range(634, 2)
  local unk33_val  = unk33_tvbr:le_uint()
  tree:add_le(npc_spawn_fields.unk33, unk33_tvbr, unk33_val)

  return len
end