import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InvalidClassException;
import java.io.ObjectInputStream;
import java.io.OptionalDataException;
import java.io.StreamCorruptedException;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class Class118_Sub9 extends Class118 {

   int anInt8250;
   int anInt8251;
   Class214 aClass214_8252;
   int anInt8253;
   int anInt8254;
   public static Class171 aClass171_8255;


   Class118_Sub9(RS2Buffer var1) {
      super(var1);
      this.anInt8254 = var1.readUnsignedShort(-937710807) * -1634907093;
      this.anInt8251 = var1.readUnsignedByte(-700559597) * -1452837989;
      this.anInt8253 = var1.readUnsignedByte(-700559597) * -741926291;
      this.anInt8250 = var1.readUnsignedByte(-700559597) * 120502155;
   }

   public void method2308(int var1) {
      this.aClass214_8252 = Class37.method1052(344265347 * this.anInt8254, this.anInt8250 * -1607223261, 0, 1500428947 * this.anInt8251, 664862565 * this.anInt8253, -523415830);
   }

   void method2309(byte var1) {
      if(this.aClass214_8252 != null) {
         RS2Buffer.method13958(this.aClass214_8252, (byte)60);
         this.aClass214_8252 = null;
      }

   }

   public void method2316() {
      this.aClass214_8252 = Class37.method1052(344265347 * this.anInt8254, this.anInt8250 * -1607223261, 0, 1500428947 * this.anInt8251, 664862565 * this.anInt8253, 1974611080);
   }

   public void method2311() {
      this.aClass214_8252 = Class37.method1052(344265347 * this.anInt8254, this.anInt8250 * -1607223261, 0, 1500428947 * this.anInt8251, 664862565 * this.anInt8253, -652430968);
   }

   void method2314() {
      if(this.aClass214_8252 != null) {
         RS2Buffer.method13958(this.aClass214_8252, (byte)60);
         this.aClass214_8252 = null;
      }

   }

   static void method13190(Class222_Sub5 var0, int var1) {
      var0.aClass515_Sub1_Sub4_Sub4_8838 = null;
      if(Class222_Sub5.anInt8842 * -78697319 < 20) {
         Class222_Sub5.aClass462_8839.method7796(var0, -173146467);
         Class222_Sub5.anInt8842 += 274360233;
      }

   }

   static final void method13191(Class508 var0, byte var1) {
      var0.anInt6003 -= 294937419;
      long var2 = (long)var0.anIntArray6027[-937710807 * var0.anInt6003];
      long var4 = (long)var0.anIntArray6027[1 + -937710807 * var0.anInt6003];
      long var6 = (long)var0.anIntArray6027[2 + var0.anInt6003 * -937710807];
      var0.anIntArray6027[(var0.anInt6003 += 98312473) * -937710807 - 1] = (int)(var6 * var2 / var4);
   }

   public static void method13192(PacketBuffer var0, short var1) {
      Class225_Sub3 var2 = (Class225_Sub3)Class427.aClass456_5372.method7682((byte)80);
      if(null != var2) {
         int var3 = -543666943 * var0.position;
         var0.writeInt(-1560343379 * var2.anInt8378, -2064487342);

         for(int var4 = 0; var4 < -1140811347 * var2.anInt8377; ++var4) {
            if(var2.anIntArray8379[var4] != 0) {
               var0.writeByte(var2.anIntArray8379[var4], -765864773);
            } else {
               try {
                  int var5 = var2.anIntArray8380[var4];
                  Field var6;
                  int var7;
                  if(var5 == 0) {
                     var6 = var2.aFieldArray8376[var4];
                     var7 = var6.getInt((Object)null);
                     var0.writeByte(0, -765864773);
                     var0.writeInt(var7, -168844944);
                  } else if(var5 == 1) {
                     var6 = var2.aFieldArray8376[var4];
                     var6.setInt((Object)null, var2.anIntArray8381[var4]);
                     var0.writeByte(0, -765864773);
                  } else if(2 == var5) {
                     var6 = var2.aFieldArray8376[var4];
                     var7 = var6.getModifiers();
                     var0.writeByte(0, -765864773);
                     var0.writeInt(var7, -977094370);
                  }

                  Method var23;
                  if(3 == var5) {
                     var23 = var2.aMethodArray8382[var4];
                     byte[][] var24 = var2.aByteArrayArrayArray8383[var4];
                     Object[] var8 = new Object[var24.length];

                     for(int var9 = 0; var9 < var24.length; ++var9) {
                        ObjectInputStream var10 = new ObjectInputStream(new ByteArrayInputStream(var24[var9]));
                        var8[var9] = var10.readObject();
                     }

                     Object var25 = var23.invoke((Object)null, var8);
                     if(null == var25) {
                        var0.writeByte(0, -765864773);
                     } else if(var25 instanceof Number) {
                        var0.writeByte(1, -765864773);
                        var0.writeLong(((Number)var25).longValue());
                     } else if(var25 instanceof String) {
                        var0.writeByte(2, -765864773);
                        var0.writeString((String)var25, (byte)29);
                     } else {
                        var0.writeByte(4, -765864773);
                     }
                  } else if(4 == var5) {
                     var23 = var2.aMethodArray8382[var4];
                     var7 = var23.getModifiers();
                     var0.writeByte(0, -765864773);
                     var0.writeInt(var7, -996416175);
                  }
               } catch (ClassNotFoundException var11) {
                  var0.writeByte(-10, -765864773);
               } catch (InvalidClassException var12) {
                  var0.writeByte(-11, -765864773);
               } catch (StreamCorruptedException var13) {
                  var0.writeByte(-12, -765864773);
               } catch (OptionalDataException var14) {
                  var0.writeByte(-13, -765864773);
               } catch (IllegalAccessException var15) {
                  var0.writeByte(-14, -765864773);
               } catch (IllegalArgumentException var16) {
                  var0.writeByte(-15, -765864773);
               } catch (InvocationTargetException var17) {
                  var0.writeByte(-16, -765864773);
               } catch (SecurityException var18) {
                  var0.writeByte(-17, -765864773);
               } catch (IOException var19) {
                  var0.writeByte(-18, -765864773);
               } catch (NullPointerException var20) {
                  var0.writeByte(-19, -765864773);
               } catch (Exception var21) {
                  var0.writeByte(-20, -765864773);
               } catch (Throwable var22) {
                  var0.writeByte(-21, -765864773);
               }
            }
         }

         var0.method13765(var3, -1674609190);
         var2.method3857(-327641146);
      }
   }

   public static int[][] method13193(int var0, int var1, int var2, int var3, int var4, int var5, float var6, boolean var7, byte var8) {
      int[][] var9 = new int[var1][var0];
      Class225_Sub24_Sub1 var10 = new Class225_Sub24_Sub1();
      var10.aBool10405 = var7;
      var10.anInt10401 = var3 * -1662128801;
      var10.anInt10404 = 283797701 * var4;
      var10.anInt10403 = 1579365063 * var5;
      var10.anInt10392 = 975443379 * (int)(var6 * 4096.0F);
      var10.method16014((byte)9);
      Class425.method7255(var0, var1, 1244859690);

      for(int var11 = 0; var11 < var1; ++var11) {
         var10.method16008(var11, var9[var11], 1744173932);
      }

      return var9;
   }
}
