Advertisement
RaWRCoder

Aion Kinah rates patcher

Jul 30th, 2014
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.26 KB | None | 0 0
  1. using System;
  2. using System.IO;
  3.  
  4. namespace aion_test
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             var fname = args[0];
  11.             var sr = new StreamReader(fname);
  12.             var br = new BinaryReader(sr.BaseStream);
  13.  
  14.             var bts = File.ReadAllBytes(fname);
  15.             Console.WriteLine("Opened!");
  16.             for (var i = 0; i +4< bts.Length; i++)
  17.             {
  18.                 var itemID = BitConverter.ToInt32(bts, i);
  19.                 if (itemID != 182400001)
  20.                     continue;
  21.                 var minKinahs = BitConverter.ToInt32(bts, i + 8);
  22.                 var maxKinahs = BitConverter.ToInt32(bts, i + 12);
  23.                 Console.WriteLine("Found kinahs, drops {0} - {1}, applying rates ...", minKinahs, maxKinahs);
  24.  
  25.                 minKinahs *= 500;
  26.                 maxKinahs *= 500;
  27.  
  28.                 BitConverter.GetBytes(minKinahs).CopyTo(bts, i + 8);
  29.                 BitConverter.GetBytes(maxKinahs).CopyTo(bts, i + 12);
  30.  
  31.                 i += 16;
  32.             }
  33.             Console.WriteLine("Search complete!");
  34.  
  35.             File.WriteAllBytes(fname+".new.dat", bts);
  36.  
  37.             Console.WriteLine("Saving complete!");
  38.             Console.ReadLine();
  39.         }
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement