Server.MirObjects.NPCScript.ParseSpeech C# (CSharp) Method

ParseSpeech() private method

private ParseSpeech ( IList lines ) : void
lines IList
return void
        private void ParseSpeech(IList<string> lines)
        {
            var loadedNPC = NPCObject.Get(LoadedObjectID);

            if (loadedNPC == null)
            {
                return;
            }

            for (int i = 0; i < lines.Count; i++)
            {
                if (!lines[i].ToUpper().StartsWith(SpeechKey)) continue;

                while (++i < lines.Count)
                {
                    if (String.IsNullOrEmpty(lines[i])) continue;

                    var parts = lines[i].Split(' ');

                    if (parts.Length < 2 || !int.TryParse(parts[0], out int weight)) return;

                    loadedNPC.Speech.Add(new NPCSpeech { Weight = weight, Message = lines[i].Substring(parts[0].Length + 1) });
                }
            }
        }
        private void ParseCrafting(IList<string> lines)