Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void Parse(string Line)
- {
- string[] strArray2 = Line.Split(new string[] { "@@", " " }, StringSplitOptions.RemoveEmptyEntries);
- SpellInformation information = new SpellInformation();
- information.ID = Convert.ToUInt16(strArray2[1]);
- information.Name = strArray2[3];
- information.Level = Convert.ToByte(strArray2[8]);
- if (Convert.ToByte(strArray2[4]) == 1)
- information.CanKill = true;
- else
- information.CanKill = false;
- information.Sort = Convert.ToByte(strArray2[2]);
- if (Convert.ToByte(strArray2[5]) == 1)
- information.OnlyGround = true;
- else
- information.OnlyGround = false;
- if (Convert.ToByte(strArray2[6]) == 1)
- information.Multi = true;
- else
- information.Multi = false;
- information.Target = Convert.ToByte(strArray2[7]);
- information.Level = Convert.ToByte(strArray2[8]);
- information.TimeOpenSkill = Convert.ToUInt32(strArray2[47]);
- information.UseMana = Convert.ToUInt16(strArray2[9]);
- if (Convert.ToInt32(strArray2[10]) > 0)
- {
- information.Power = Convert.ToInt32(strArray2[10]);
- }
- //else
- //{
- // information.Power = 0;
- //}
- information.PowerPercent = ((float)information.Power % 1000) / 100;
- information.Percent = Convert.ToByte(strArray2[12]);
- information.Duration = Convert.ToInt32(strArray2[13]);
- information.Range = Convert.ToUInt16(strArray2[14]);
- information.Sector = information.Range * 20;
- information.Distance = Convert.ToUInt16(strArray2[15]);
- if (information.Distance >= 4)
- {
- information.Distance = (ushort)(information.Distance - 1);
- }
- information.Status = (ulong)Convert.ToInt64(strArray2[16]);
- information.NeedExperience = Convert.ToUInt32(strArray2[18]);
- information.NeedLevel = Convert.ToByte(strArray2[20]);
- var WeaponSubtype = Convert.ToUInt32(strArray2[22]);
- //if (wepsubtype.Length == 6)
- //{
- // information.WeaponSubtype =
- // information.OnlyWithThisWeaponSubtype = Convert.ToUInt16(wepsubtype.Substring(0, 3));
- // information.WeaponSubtype2 =
- // information.OnlyWithThisWeaponSubtype2 = Convert.ToUInt16(wepsubtype.Substring(3, 3));
- //}
- //if (wepsubtype.Length == 8)
- //{
- // information.WeaponSubtype =
- // information.OnlyWithThisWeaponSubtype = Convert.ToUInt16(wepsubtype.Substring(2, 3));
- // information.WeaponSubtype2 =
- // information.OnlyWithThisWeaponSubtype2 = Convert.ToUInt16(wepsubtype.Substring(5, 3));
- //}
- //else if (wepsubtype.Length == 3)
- //{
- // information.WeaponSubtype = information.OnlyWithThisWeaponSubtype = Convert.ToUInt16(wepsubtype);
- //}
- information.WeaponSubtype = new List<ushort>();
- information.OnlyWithThisWeaponSubtype = new List<ushort>();
- var subtype1 = (ushort)(WeaponSubtype % 1000);
- var subtype2 = (ushort)((WeaponSubtype / 1000) % 1000);
- var subtype3 = (ushort)((WeaponSubtype / 1000000) % 1000);
- if (WeaponSubtype == 60000)
- subtype1 = 614;
- if (subtype1 != 0)
- {
- information.WeaponSubtype.Add(subtype1);
- information.OnlyWithThisWeaponSubtype.Add(subtype1);
- }
- if (subtype2 != 0)
- {
- information.WeaponSubtype.Add(subtype2);
- information.OnlyWithThisWeaponSubtype.Add(subtype2);
- }
- if (subtype3 != 0)
- {
- information.WeaponSubtype.Add(subtype3);
- information.OnlyWithThisWeaponSubtype.Add(subtype3);
- }
- if (WeaponSubtype == 50000)
- information.WeaponSubtype = information.OnlyWithThisWeaponSubtype = new List<ushort>();
- information.NextSpellID = Convert.ToUInt16(strArray2[32]);
- information.NeedXP = Convert.ToByte(strArray2[21]);
- information.UseStamina = Convert.ToByte(strArray2[29]);
- information.UseArrows = Convert.ToByte(strArray2[34]);
- information.FirstDamage = (int)(Convert.ToInt32(strArray2[36]));
- information.SecondDamage = (int)(Convert.ToInt32(strArray2[37]));
- //information.CoolDown = Convert.ToUInt32(strArray2[47]);
- information.CPCost = Convert.ToUInt16(strArray2[48]);
- if (information.CPCost == 0 && information.Level == 0)
- information.CPCost = 27;
- if (information.CPCost == 0 && information.Level == 1)
- information.CPCost = 81;
- if (information.CPCost == 0 && information.Level == 2)
- information.CPCost = 122;
- if (information.CPCost == 0 && information.Level == 3)
- information.CPCost = 181;
- if (information.CPCost == 0 && information.Level == 4)
- information.CPCost = 274;
- if (information.CPCost == 0 && information.Level == 5)
- information.CPCost = 411;
- if (information.CPCost == 0 && information.Level == 6)
- information.CPCost = 617;
- if (information.CPCost == 0 && information.Level == 7)
- information.CPCost = 926;
- if (information.CPCost == 0 && information.Level == 8)
- information.CPCost = 1386;
- if (information.CPCost == 0 && information.Level == 9)
- information.CPCost = 2084;
- if (SpellInformations.ContainsKey(information.ID))
- {
- SpellInformations[information.ID].Add(information.Level, information);
- }
- else
- {
- SpellInformations.Add(information.ID, new SafeDictionary<byte, SpellInformation>(10));
- SpellInformations[information.ID].Add(information.Level, information);
- }
- if (information.Distance > 18)
- {
- information.Distance = 18;
- }
- if (information.WeaponSubtype.Count != 0)
- {
- switch (information.ID)
- {
- case 5010:
- case 7020:
- case 1290:
- case 1260:
- case 5030:
- case 5040:
- case 7000:
- case 7010:
- case 7030:
- case 7040:
- case 1250:
- case 5050:
- case 5020:
- case 10490:
- case 11140:
- case 1300:
- case 11990:
- case 12110:
- case 12240:
- case 12230:
- case 12220:
- case 12210:
- case 12570:
- case 12580:
- case 12590:
- case 12600:
- case 11230:
- for (int i = 0; i < information.WeaponSubtype.Count; i++)
- {
- var subtype = information.WeaponSubtype[i];
- if (!WeaponSpells.ContainsKey(subtype))
- WeaponSpells.Add(subtype, new List<ushort>());
- if (!WeaponSpells[subtype].Contains(information.ID))
- WeaponSpells[subtype].Add(information.ID);
- }
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement