using System.Text.RegularExpressions; namespace Server.MirObjects { public class NPCPage { public string Key; public List SegmentList = new List(); public List Args = new List(); public List Buttons = new List(); public List ScriptCalls = new List(); public bool BreakFromSegments = false; public NPCPage(string key) { Key = key; } public string ArgumentParse(string key) { if (key.StartsWith("[@_")) return key; //Default NPC page so doesn't use arguments in this way Regex r = new Regex(@"\((.*)\)"); Match match = r.Match(key); if (!match.Success) return key; key = Regex.Replace(key, r.ToString(), "()"); string strValues = match.Groups[1].Value; string[] arrValues = strValues.Split(','); Args = new List(); foreach (var t in arrValues) Args.Add(t); return key; } } }