예제 #1
0
 public static void WriteText(string address, string values)
 {
     string[] strArr = LoDDict.StringEncode(values).Split(' ');
     byte[]   arr    = new byte[strArr.Length];
     for (int i = 0; i < strArr.Length; i++)
     {
         arr[i] = Convert.ToByte(strArr[i], 16);
     }
     WriteProcessMemory(processHandle, new IntPtr(Constants.GetAddress(address) + Constants.OFFSET), arr, arr.Length, out int error);
 }
예제 #2
0
 public Equipment(byte index, string[] values)
 {
     ID   = index;
     Name = values[0];
     if (!(Name == "" || Name == " "))
     {
         EncodedName = LoDDict.StringEncode(Name) + " FF A0";
     }
     if (typeDict.TryGetValue(values[1].ToLower(), out byte bkey))
     {
         type = bkey;
     }
     else
     {
         Constants.WriteError(values[1] + " not found as equipment type for item: " + Name);
     }
     foreach (string substring in values[2].Replace(" ", "").Split(','))
     {
         if (charDict.TryGetValue(substring.ToLower(), out bkey))
         {
             equips |= bkey;
         }
         else
         {
             Constants.WriteError(substring + " not found as character for item: " + Name);
         }
     }
     if (IconDict.TryGetValue(values[3].ToLower(), out bkey))
     {
         Icon = bkey;
     }
     else
     {
         Constants.WriteError(values[3] + " not found as icon for item: " + Name);
     }
     if (LoDDict2.element2num.TryGetValue(values[4].ToLower(), out bkey))
     {
         element = bkey;
     }
     else
     {
         Constants.WriteError(values[4] + " not found as element for item: " + Name);
     }
     if (LoDDict2.status2num.TryGetValue(values[5].ToLower(), out bkey))
     {
         on_hit_status = bkey;
     }
     else
     {
         Constants.WriteError(values[5] + " not found as Status for item: " + Name);
     }
     if (Byte.TryParse(values[6], NumberStyles.AllowLeadingSign, null as IFormatProvider, out bkey))
     {
         status_chance = bkey;
     }
     else if (values[6] != "")
     {
         Constants.WriteError(values[6] + " not found as Status Chance for item: " + Name);
     }
     if (Byte.TryParse(values[7], NumberStyles.AllowLeadingSign, null as IFormatProvider, out bkey))
     {
         at = bkey;
     }
     else if (values[7] != "")
     {
         Constants.WriteError(values[7] + " not found as AT for item: " + Name);
     }
     if (Byte.TryParse(values[8], NumberStyles.AllowLeadingSign, null as IFormatProvider, out bkey))
     {
         mat = bkey;
     }
     else if (values[8] != "")
     {
         Constants.WriteError(values[8] + " not found as MAT for item: " + Name);
     }
     if (Byte.TryParse(values[9], NumberStyles.AllowLeadingSign, null as IFormatProvider, out bkey))
     {
         df = bkey;
     }
     else if (values[9] != "")
     {
         Constants.WriteError(values[9] + " not found as DF for item: " + Name);
     }
     if (Byte.TryParse(values[10], NumberStyles.AllowLeadingSign, null as IFormatProvider, out bkey))
     {
         mdf = bkey;
     }
     else if (values[10] != "")
     {
         Constants.WriteError(values[10] + " not found as MDF for item: " + Name);
     }
     if (Byte.TryParse(values[11], NumberStyles.AllowLeadingSign, null as IFormatProvider, out bkey))
     {
         spd = bkey;
     }
     else if (values[11] != "")
     {
         Constants.WriteError(values[11] + " not found as SPD for item: " + Name);
     }
     if (Byte.TryParse(values[12], NumberStyles.AllowLeadingSign, null as IFormatProvider, out bkey))
     {
         a_hit = bkey;
     }
     else if (values[12] != "")
     {
         Constants.WriteError(values[12] + " not found as A_Hit for item: " + Name);
     }
     if (Byte.TryParse(values[13], NumberStyles.AllowLeadingSign, null as IFormatProvider, out bkey))
     {
         m_hit = bkey;
     }
     else if (values[13] != "")
     {
         Constants.WriteError(values[13] + " not found as M_Hit for item: " + Name);
     }
     if (Byte.TryParse(values[14], NumberStyles.AllowLeadingSign, null as IFormatProvider, out bkey))
     {
         a_av = bkey;
     }
     else if (values[14] != "")
     {
         Constants.WriteError(values[14] + " not found as A_AV for item: " + Name);
     }
     if (Byte.TryParse(values[15], NumberStyles.AllowLeadingSign, null as IFormatProvider, out bkey))
     {
         m_av = bkey;
     }
     else if (values[15] != "")
     {
         Constants.WriteError(values[15] + " not found as M_AV for item: " + Name);
     }
     foreach (string substring in values[16].Replace(" ", "").Split(','))
     {
         if (LoDDict2.element2num.TryGetValue(substring.ToLower(), out bkey))
         {
             e_half |= bkey;
         }
         else
         {
             Constants.WriteError(substring + " not found as E_Half for item:" + Name);
         }
     }
     foreach (string substring in values[17].Replace(" ", "").Split(','))
     {
         if (LoDDict2.element2num.TryGetValue(substring.ToLower(), out bkey))
         {
             e_immune |= bkey;
         }
         else
         {
             Constants.WriteError(substring + " not found as E_Immune for item:" + Name);
         }
     }
     foreach (string substring in values[18].Replace(" ", "").Split(','))
     {
         if (LoDDict2.status2num.TryGetValue(substring.ToLower(), out bkey))
         {
             stat_res |= bkey;
         }
         else
         {
             Constants.WriteError(substring + " not found as Status_Resist for item:" + Name);
         }
     }
     foreach (string substring in values[19].Replace(" ", "").Split(','))
     {
         if (special12num.TryGetValue(substring.ToLower(), out bkey))
         {
             special1 |= bkey;
         }
         else
         {
             Constants.WriteError(substring + " not found as Special1 for item:" + Name);
         }
     }
     foreach (string substring in values[20].Replace(" ", "").Split(','))
     {
         if (special22num.TryGetValue(substring.ToLower(), out bkey))
         {
             special2 |= bkey;
         }
         else
         {
             Constants.WriteError(substring + " not found as Special2 for item:" + Name);
         }
     }
     if (Int16.TryParse(values[21], NumberStyles.AllowLeadingSign, null as IFormatProvider, out short skey))
     {
         special_ammount = skey;
     }
     else if (values[21] != "")
     {
         Constants.WriteError(values[21] + " not found as Special_Ammount for item: " + Name);
     }
     foreach (string substring in values[22].Replace(" ", "").Split(','))
     {
         if (death2num.TryGetValue(substring.ToLower(), out bkey))
         {
             death_res |= bkey;
         }
         else
         {
             Constants.WriteError(substring + " not found as Death_Res for item:" + Name);
         }
     }
     Description = values[23];
     if (!(Description == "" || Description == " "))
     {
         EncodedDescription = LoDDict.StringEncode(Description) + " FF A0";
     }
     if (UInt16.TryParse(values[24], NumberStyles.AllowLeadingSign, null as IFormatProvider, out ushort key3))
     {
         float temp = (float)key3 / 2;
         Sell_Price = (short)Math.Round(temp);
     }
     else if (values[24] != "")
     {
         Constants.WriteError(values[24] + " not found as Price for item: " + Name);
     }
 }
예제 #3
0
 public UsableItem(byte index, string[] values)
 {
     ID = index;
     if (!(values[0] == "" || values[0] == " "))
     {
         Name        = values[0];
         EncodedName = LoDDict.StringEncode(Name) + " FF A0";
     }
     if (Byte.TryParse(values[1], NumberStyles.AllowLeadingSign, null as IFormatProvider, out byte bkey))
     {
         target = bkey;
     }
     else if (values[1] != "")
     {
         Constants.WriteError(values[1] + " not found as Target for item: " + Name);
     }
     if (LoDDict2.element2num.TryGetValue(values[2].ToLower(), out bkey))
     {
         element = bkey;
     }
     else
     {
         Constants.WriteError(values[2] + " not found as Element for item: " + Name);
     }
     if (base_table.TryGetValue(values[3], out bkey))
     {
         damage = bkey;
     }
     else if (values[3] != "")
     {
         Constants.WriteError(values[3] + " not found as Damage for item: " + Name);
     }
     foreach (string substring in values[4].Replace(" ", "").Split(','))
     {
         if (special12num.TryGetValue(substring.ToLower(), out bkey))
         {
             special1 |= bkey;
         }
         else
         {
             Constants.WriteError(substring + " not found as Special1 for item:" + Name);
         }
     }
     foreach (string substring in values[5].Replace(" ", "").Split(','))
     {
         if (special22num.TryGetValue(substring.ToLower(), out bkey))
         {
             special2 |= bkey;
         }
         else
         {
             Constants.WriteError(substring + " not found as Special2 for item:" + Name);
         }
     }
     if (Byte.TryParse(values[6], NumberStyles.AllowLeadingSign, null as IFormatProvider, out bkey))
     {
         uu1 = bkey;
     }
     else if (values[6] != "")
     {
         Constants.WriteError(values[6] + " not found as UU1 for item: " + Name);
     }
     if (Int16.TryParse(values[7], NumberStyles.AllowLeadingSign, null as IFormatProvider, out short skey))
     {
         special_ammount = (byte)skey;
     }
     else if (values[7] != "")
     {
         Constants.WriteError(values[7] + " not found as Special_Ammount for item: " + Name);
     }
     if (IconDict.TryGetValue(values[8].ToLower(), out bkey))
     {
         Icon = bkey;
     }
     else
     {
         Constants.WriteError(values[8] + " not found as Icon for item: " + Name);
     }
     foreach (string substring in values[9].Replace(" ", "").Split(','))
     {
         if (LoDDict2.status2num.TryGetValue(substring.ToLower(), out bkey))
         {
             status |= bkey;
         }
         else
         {
             Constants.WriteError(substring + " not found as Status for item:" + Name);
         }
     }
     if (Byte.TryParse(values[10], NumberStyles.AllowLeadingSign, null as IFormatProvider, out bkey))
     {
         percentage = bkey;
     }
     else if (values[10] != "")
     {
         Constants.WriteError(values[10] + " not found as Percentage for item: " + Name);
     }
     if (Byte.TryParse(values[11], NumberStyles.AllowLeadingSign, null as IFormatProvider, out bkey))
     {
         uu2 = bkey;
     }
     else if (values[11] != "")
     {
         Constants.WriteError(values[11] + " not found as UU2 for item: " + Name);
     }
     foreach (string substring in values[12].Replace(" ", "").Split(','))
     {
         if (base_dict.TryGetValue(substring.ToLower(), out bkey))
         {
             baseSwitch |= bkey;
         }
         else
         {
             Constants.WriteError(substring + " not found as Base_Switch for item:" + Name);
         }
     }
     Description = values[13];
     if (!(Description == "" || Description == " "))
     {
         EncodedDescription = LoDDict.StringEncode(Description) + " FF A0";
     }
     if (UInt16.TryParse(values[14], NumberStyles.AllowLeadingSign, null as IFormatProvider, out ushort uskey))
     {
         float temp = (float)uskey / 2;
         Sell_Price = (short)Math.Round(temp);
     }
     else if (values[14] != "")
     {
         Constants.WriteError(values[14] + " not found as Price for item: " + Name);
     }
     battleDescription = values[15];
     if (!(battleDescription == "" || battleDescription == " "))
     {
         encondedBattleDescription = LoDDict.StringEncode(battleDescription) + " FF A0";
     }
 }