public Npc(Variant config) { ID = config.GetStringOrDefault("_id"); NpcType = config.GetStringOrDefault("SubType"); Name = config.GetStringOrDefault("Name"); m_value = config.GetVariantOrDefault("Value"); if (m_value != null) { m_task = m_value.GetVariantOrDefault("Task"); SceneID = m_value.GetStringOrDefault("SceneID"); X = m_value.GetIntOrDefault("X"); Y = m_value.GetIntOrDefault("Y"); object lev; if (m_value.TryGetValueT("MustKill", out lev)) { if (lev is bool) { if ((bool)lev) { m_killLev = 1; } } else if (lev != null) { int.TryParse(lev.ToString(), out m_killLev); } } } }