// Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

import sign.signlink;

public class Class45
{

    public Class31_Sub3_Sub3_Sub2 method592(int i, byte byte0, int j, int ai[])
    {
        if(byte0 == 0)
            byte0 = 0;
        else
            anInt677 = -361;
        if(anIntArray696 != null)
        {
            Class45 class45 = method595(7);
            if(class45 == null)
                return null;
            else
                return class45.method592(i, (byte)0, j, ai);
        }
        Class31_Sub3_Sub3_Sub2 class31_sub3_sub3_sub2 = (Class31_Sub3_Sub3_Sub2)aClass36_690.method565(aLong681);
        if(class31_sub3_sub3_sub2 == null)
        {
            boolean flag = false;
            for(int k = 0; k < anIntArray673.length; k++)
                if(!Class31_Sub3_Sub3_Sub2.method468(anIntArray673[k]))
                    flag = true;

            if(flag)
                return null;
            Class31_Sub3_Sub3_Sub2 aclass31_sub3_sub3_sub2[] = new Class31_Sub3_Sub3_Sub2[anIntArray673.length];
            for(int l = 0; l < anIntArray673.length; l++)
                aclass31_sub3_sub3_sub2[l] = Class31_Sub3_Sub3_Sub2.method467(anIntArray673[l]);

            if(aclass31_sub3_sub3_sub2.length == 1)
                class31_sub3_sub3_sub2 = aclass31_sub3_sub3_sub2[0];
            else
                class31_sub3_sub3_sub2 = new Class31_Sub3_Sub3_Sub2(aclass31_sub3_sub3_sub2, 3, aclass31_sub3_sub3_sub2.length);
            if(anIntArray703 != null)
            {
                for(int i1 = 0; i1 < anIntArray703.length; i1++)
                    class31_sub3_sub3_sub2.method481(anIntArray703[i1], anIntArray678[i1]);

            }
            class31_sub3_sub3_sub2.method474(166);
            class31_sub3_sub3_sub2.method484(64 + anInt683, 850 + anInt704, -30, -50, -30, true);
            aClass36_690.method566(aLong681, true, class31_sub3_sub3_sub2);
        }
        Class31_Sub3_Sub3_Sub2 class31_sub3_sub3_sub2_1 = Class31_Sub3_Sub3_Sub2.aClass31_Sub3_Sub3_Sub2_1539;
        class31_sub3_sub3_sub2_1.method469(940, Class32.method509(j, true) & Class32.method509(i, true), class31_sub3_sub3_sub2);
        if(j != -1 && i != -1)
            class31_sub3_sub3_sub2_1.method476(j, i, -40256, ai);
        else
        if(j != -1)
            class31_sub3_sub3_sub2_1.method475(257, j);
        if(anInt693 != 128 || anInt700 != 128)
            class31_sub3_sub3_sub2_1.method483(anInt693, -39776, anInt700, anInt693);
        class31_sub3_sub3_sub2_1.method471((byte)50);
        class31_sub3_sub3_sub2_1.anIntArrayArray1575 = null;
        class31_sub3_sub3_sub2_1.anIntArrayArray1574 = null;
        if(aByte706 == 1)
            class31_sub3_sub3_sub2_1.aBoolean1576 = true;
        return class31_sub3_sub3_sub2_1;
    }

    public void method593(Class31_Sub3_Sub2 class31_sub3_sub2, byte byte0)
    {
        if(byte0 != 59)
            throw new NullPointerException();
        do
        {
            int i = class31_sub3_sub2.method422();
            if(i == 0)
                return;
            if(i == 1)
            {
                int j = class31_sub3_sub2.method422();
                anIntArray673 = new int[j];
                for(int j1 = 0; j1 < j; j1++)
                    anIntArray673[j1] = class31_sub3_sub2.method424();

            } else
            if(i == 2)
                aString691 = class31_sub3_sub2.method429();
            else
            if(i == 3)
                aByteArray701 = class31_sub3_sub2.method430((byte)0);
            else
            if(i == 12)
                aByte706 = class31_sub3_sub2.method423();
            else
            if(i == 13)
                anInt699 = class31_sub3_sub2.method424();
            else
            if(i == 14)
                anInt708 = class31_sub3_sub2.method424();
            else
            if(i == 17)
            {
                anInt708 = class31_sub3_sub2.method424();
                anInt674 = class31_sub3_sub2.method424();
                anInt687 = class31_sub3_sub2.method424();
                anInt705 = class31_sub3_sub2.method424();
            } else
            if(i >= 30 && i < 40)
            {
                if(aStringArray686 == null)
                    aStringArray686 = new String[5];
                aStringArray686[i - 30] = class31_sub3_sub2.method429();
                if(aStringArray686[i - 30].equalsIgnoreCase("hidden"))
                    aStringArray686[i - 30] = null;
            } else
            if(i == 40)
            {
                int k = class31_sub3_sub2.method422();
                anIntArray703 = new int[k];
                anIntArray678 = new int[k];
                for(int k1 = 0; k1 < k; k1++)
                {
                    anIntArray703[k1] = class31_sub3_sub2.method424();
                    anIntArray678[k1] = class31_sub3_sub2.method424();
                }

            } else
            if(i == 60)
            {
                int l = class31_sub3_sub2.method422();
                anIntArray689 = new int[l];
                for(int l1 = 0; l1 < l; l1++)
                    anIntArray689[l1] = class31_sub3_sub2.method424();

            } else
            if(i == 90)
                anInt710 = class31_sub3_sub2.method424();
            else
            if(i == 91)
                anInt692 = class31_sub3_sub2.method424();
            else
            if(i == 92)
                anInt682 = class31_sub3_sub2.method424();
            else
            if(i == 93)
                aBoolean698 = false;
            else
            if(i == 95)
                anInt685 = class31_sub3_sub2.method424();
            else
            if(i == 97)
                anInt693 = class31_sub3_sub2.method424();
            else
            if(i == 98)
                anInt700 = class31_sub3_sub2.method424();
            else
            if(i == 99)
                aBoolean676 = true;
            else
            if(i == 100)
                anInt683 = class31_sub3_sub2.method423();
            else
            if(i == 101)
                anInt704 = class31_sub3_sub2.method423() * 5;
            else
            if(i == 102)
                anInt679 = class31_sub3_sub2.method424();
            else
            if(i == 103)
                anInt709 = class31_sub3_sub2.method424();
            else
            if(i == 106)
            {
                anInt694 = class31_sub3_sub2.method424();
                if(anInt694 == 65535)
                    anInt694 = -1;
                anInt695 = class31_sub3_sub2.method424();
                if(anInt695 == 65535)
                    anInt695 = -1;
                int i1 = class31_sub3_sub2.method422();
                anIntArray696 = new int[i1 + 1];
                for(int i2 = 0; i2 <= i1; i2++)
                {
                    anIntArray696[i2] = class31_sub3_sub2.method424();
                    if(anIntArray696[i2] == 65535)
                        anIntArray696[i2] = -1;
                }

            } else
            if(i == 107)
                aBoolean688 = false;
        } while(true);
    }

    public Class31_Sub3_Sub3_Sub2 method594(int i)
    {
        if(anIntArray696 != null)
        {
            Class45 class45 = method595(7);
            if(class45 == null)
                return null;
            else
                return class45.method594(-384);
        }
        if(anIntArray689 == null)
            return null;
        boolean flag = false;
        if(i >= 0)
            throw new NullPointerException();
        for(int j = 0; j < anIntArray689.length; j++)
            if(!Class31_Sub3_Sub3_Sub2.method468(anIntArray689[j]))
                flag = true;

        if(flag)
            return null;
        Class31_Sub3_Sub3_Sub2 aclass31_sub3_sub3_sub2[] = new Class31_Sub3_Sub3_Sub2[anIntArray689.length];
        for(int k = 0; k < anIntArray689.length; k++)
            aclass31_sub3_sub3_sub2[k] = Class31_Sub3_Sub3_Sub2.method467(anIntArray689[k]);

        Class31_Sub3_Sub3_Sub2 class31_sub3_sub3_sub2;
        if(aclass31_sub3_sub3_sub2.length == 1)
            class31_sub3_sub3_sub2 = aclass31_sub3_sub3_sub2[0];
        else
            class31_sub3_sub3_sub2 = new Class31_Sub3_Sub3_Sub2(aclass31_sub3_sub3_sub2, 3, aclass31_sub3_sub3_sub2.length);
        if(anIntArray703 != null)
        {
            for(int l = 0; l < anIntArray703.length; l++)
                class31_sub3_sub3_sub2.method481(anIntArray703[l], anIntArray678[l]);

        }
        return class31_sub3_sub3_sub2;
    }

    public Class45 method595(int i)
    {
        if(i < 7 || i > 7)
            throw new NullPointerException();
        int j = -1;
        if(anInt694 != -1)
        {
            Class13 class13 = Class13.aClass13Array218[anInt694];
            int k = class13.anInt220;
            int l = class13.anInt221;
            int i1 = class13.anInt222;
            int j1 = client.anIntArray1305[i1 - l];
            j = aClient697.anIntArray1111[k] >> l & j1;
        } else
        if(anInt695 != -1)
            j = aClient697.anIntArray1111[anInt695];
        if(j < 0 || j >= anIntArray696.length || anIntArray696[j] == -1)
            return null;
        else
            return method598(anIntArray696[j]);
    }

    public static void method596(boolean flag)
    {
        aClass36_690 = null;
        if(flag)
        {
            return;
        } else
        {
            anIntArray680 = null;
            aClass45Array675 = null;
            aClass31_Sub3_Sub2_707 = null;
            return;
        }
    }

    public boolean method597(byte byte0)
    {
        if(byte0 != -92)
        {
            for(int i = 1; i > 0; i++);
        }
        if(anIntArray696 == null)
            return true;
        int j = -1;
        if(anInt694 != -1)
        {
            Class13 class13 = Class13.aClass13Array218[anInt694];
            int k = class13.anInt220;
            int l = class13.anInt221;
            int i1 = class13.anInt222;
            int j1 = client.anIntArray1305[i1 - l];
            j = aClient697.anIntArray1111[k] >> l & j1;
        } else
        if(anInt695 != -1)
            j = aClient697.anIntArray1111[anInt695];
        return j >= 0 && j < anIntArray696.length && anIntArray696[j] != -1;
    }

    public static Class45 method598(int i)
    {
        for(int j = 0; j < 20; j++)
            if(aClass45Array675[j].aLong681 == (long)i)
                return aClass45Array675[j];

        anInt702 = (anInt702 + 1) % 20;
        Class45 class45 = aClass45Array675[anInt702] = new Class45();
        aClass31_Sub3_Sub2_707.anInt1440 = anIntArray680[i];
        class45.aLong681 = i;
        class45.method593(aClass31_Sub3_Sub2_707, (byte)59);
        return class45;
    }

    public static void method599(Class11 class11)
    {
        aClass31_Sub3_Sub2_707 = new Class31_Sub3_Sub2((byte)114, class11.method204("npc.dat", null));
        Class31_Sub3_Sub2 class31_sub3_sub2 = new Class31_Sub3_Sub2((byte)114, class11.method204("npc.idx", null));
        anInt684 = class31_sub3_sub2.method424();
        anIntArray680 = new int[anInt684];
        int i = 2;
        for(int j = 0; j < anInt684; j++)
        {
            anIntArray680[j] = i;
            i += class31_sub3_sub2.method424();
        }

        aClass45Array675 = new Class45[20];
        for(int k = 0; k < 20; k++)
            aClass45Array675[k] = new Class45();

    }

    public Class45()
    {
        anInt674 = -1;
        aBoolean676 = false;
        anInt677 = 5;
        anInt679 = -1;
        aLong681 = -1L;
        anInt682 = -1;
        anInt685 = -1;
        anInt687 = -1;
        aBoolean688 = true;
        anInt692 = -1;
        anInt693 = 128;
        anInt694 = -1;
        anInt695 = -1;
        aBoolean698 = true;
        anInt699 = -1;
        anInt700 = 128;
        anInt705 = -1;
        aByte706 = 1;
        anInt708 = -1;
        anInt709 = 32;
        anInt710 = -1;
    }

    public int anIntArray673[];
    public int anInt674;
    public static Class45 aClass45Array675[];
    public boolean aBoolean676;
    public int anInt677;
    public int anIntArray678[];
    public int anInt679;
    public static int anIntArray680[];
    public long aLong681;
    public int anInt682;
    public int anInt683;
    public static int anInt684;
    public int anInt685;
    public String aStringArray686[];
    public int anInt687;
    public boolean aBoolean688;
    public int anIntArray689[];
    public static Class36 aClass36_690 = new Class36(30, false);
    public String aString691;
    public int anInt692;
    public int anInt693;
    public int anInt694;
    public int anInt695;
    public int anIntArray696[];
    public static client aClient697;
    public boolean aBoolean698;
    public int anInt699;
    public int anInt700;
    public byte aByteArray701[];
    public static int anInt702;
    public int anIntArray703[];
    public int anInt704;
    public int anInt705;
    public byte aByte706;
    public static Class31_Sub3_Sub2 aClass31_Sub3_Sub2_707;
    public int anInt708;
    public int anInt709;
    public int anInt710;

}
