Beispiel #1
0
		private static unsafe SkillCategory[] LoadCategories()
		{
			SkillCategory[] list = new SkillCategory[0];

			string grpPath = Client.GetFilePath("skillgrp.mul");

			if (grpPath == null)
			{ return new SkillCategory[0]; }
			else
			{
				List<SkillCategory> toAdd = new List<SkillCategory>();

				using (FileStream stream = new FileStream(grpPath, FileMode.Open, FileAccess.Read, FileShare.Read))
				{
					BinaryReader bin = new BinaryReader(stream);

					byte[] START = new byte[4]; //File Start Offset

					bin.Read(START, 0, 4);

					int index = 0;

					long
						x = stream.Length,
						y = 0;


					while (y < x) //Position < Length
					{
						string name = ParseName(stream);
						long fileIndex = stream.Position - name.Length;

						if (name.Length > 0)
						{
							toAdd.Add(new SkillCategory(new SkillCategoryData(fileIndex, index, name)));

							y = stream.Position;

							++index;
						}
					}
				}

				if (toAdd.Count > 0)
				{
					list = new SkillCategory[toAdd.Count];

					for (int i = 0; i < toAdd.Count; i++)
					{
						list[i] = toAdd[i];
					}

					toAdd.Clear();
				}
			}

			return list;
		}
Beispiel #2
0
 public SkillData(int index, string name, bool useButton, int extra, byte unk, SkillCategory mCategory)
 {
     m_Index     = index;
     m_Category  = mCategory;
     m_Name      = name;
     m_UseButton = useButton;
     m_Extra     = extra;
     m_Unknown   = unk;
 }
Beispiel #3
0
		public void ResetFromData(SkillData data)
		{
			m_Data = data;
			m_Index = m_Data.Index;
			m_UseButton = m_Data.UseButton;
			m_Name = m_Data.Name;
			m_Category = m_Data.Category;
			m_Unknown = m_Data.Unknown;
		}