Beispiel #1
0
        public static void unpackConfig(StreamLoader streamLoader)
        {
            Stream stream    = new Stream(streamLoader.getDataForName("flo.dat"));
            int    cacheSize = stream.readUnsignedWord();

            if (cache == null)
            {
                cache = new Flo[cacheSize];
            }
            for (int j = 0; j < cacheSize; j++)
            {
                if (cache[j] == null)
                {
                    cache[j] = new Flo();
                }
                cache[j].readValues(stream);
            }
        }
Beispiel #2
0
//		public static void unpackConfig(StreamLoader streamLoader)
//		{
//			Stream stream = new Stream(streamLoader.getDataForName("idk.dat"));
//			Length = stream.readUnsignedWord();
//			if (cache == null)
//				cache = new IDK[Length];
//			for (int j = 0; j < Length; j++)
//			{
//				if (cache[j] == null)
//					cache[j] = new IDK();
//				cache[j].readValues(stream);
//			}
//		}
//
//		private void readValues(Stream stream)
//		{
//			do
//			{
//				int i = stream.readUnsignedByte();
//				if (i == 0)
//					return;
//				if (i == 1)
//					anInt657 = stream.readUnsignedByte();
//				else
//					if (i == 2)
//					{
//						int j = stream.readUnsignedByte();
//						anIntArray658 = new int[j];
//						for (int k = 0; k < j; k++)
//							anIntArray658[k] = stream.readUnsignedWord();
//
//					}
//					else
//						if (i == 3)
//							aBoolean662 = true;
//						else
//							if (i >= 40 && i < 50)
//								anIntArray659[i - 40] = stream.readUnsignedWord();
//							else
//								if (i >= 50 && i < 60)
//									anIntArray660[i - 50] = stream.readUnsignedWord();
//								else
//									if (i >= 60 && i < 70)
//										anIntArray661[i - 60] = stream.readUnsignedWord();
//									else
//										UnityEngine.Debug.Log("Error unrecognised config code: " + i);
//			} while (true);
//		}
//
//		public bool method537()
//		{
//			if (anIntArray658 == null)
//				return true;
//			bool flag = true;
//			for (int j = 0; j < anIntArray658.Length; j++)
//				if (!Model.method463(anIntArray658[j]))
//					flag = false;
//
//			return flag;
//		}
//
//		public Model method538()
//		{
//			if (anIntArray658 == null)
//				return null;
//			Model[] aclass30_sub2_sub4_sub6s = new Model[anIntArray658.Length];
//			for (int i = 0; i < anIntArray658.Length; i++)
//				aclass30_sub2_sub4_sub6s[i] = Model.method462(anIntArray658[i]);
//
//			Model model;
//			if (aclass30_sub2_sub4_sub6s.Length == 1)
//				model = aclass30_sub2_sub4_sub6s[0];
//			else
//				model = new Model(aclass30_sub2_sub4_sub6s.Length, aclass30_sub2_sub4_sub6s);
//			for (int j = 0; j < 6; j++)
//			{
//				if (anIntArray659[j] == 0)
//					break;
//				model.method476(anIntArray659[j], anIntArray660[j]);
//			}
//
//			return model;
//		}
//
//		public bool method539()
//		{
//			bool flag1 = true;
//			for (int i = 0; i < 5; i++)
//				if (anIntArray661[i] != -1 && !Model.method463(anIntArray661[i]))
//					flag1 = false;
//
//			return flag1;
//		}
//
//		public Model method540()
//		{
//			Model[] aclass30_sub2_sub4_sub6s = new Model[5];
//			int j = 0;
//			for (int k = 0; k < 5; k++)
//				if (anIntArray661[k] != -1)
//					aclass30_sub2_sub4_sub6s[j++] = Model.method462(anIntArray661[k]);
//
//			Model model = new Model(j, aclass30_sub2_sub4_sub6s);
//			for (int l = 0; l < 6; l++)
//			{
//				if (anIntArray659[l] == 0)
//					break;
//				model.method476(anIntArray659[l], anIntArray660[l]);
//			}
//
//			return model;
//		}
//
//		private IDK()
//		{
//			anInt657 = -1;
//			anIntArray659 = new int[6];
//			anIntArray660 = new int[6];
//			aBoolean662 = false;
//		}
//
//		public static int Length;
//		public static IDK[] cache;
//		public int anInt657;
//		private int[] anIntArray658;
//		private int[] anIntArray659;
//		private int[] anIntArray660;
//		private int[] anIntArray661 = {
//        -1, -1, -1, -1, -1
//    };
//		public bool aBoolean662;
//	}

        public static void unpackConfig(StreamLoader streamLoader)
        {
            Stream stream = new Stream(streamLoader.getDataForName("idk.dat"));

            length = stream.readUnsignedWord();
            if (cache == null)
            {
                cache = new IDK[length];
            }
            for (int j = 0; j < length; j++)
            {
                if (cache[j] == null)
                {
                    cache[j] = new IDK();
                }
                cache[j].readValues(stream);
            }
        }
Beispiel #3
0
        private static Sprite method207(int i, StreamLoader streamLoader, String s)
        {
            long   l      = (TextClass.method585(s) << 8) + (long)i;
            Sprite sprite = (Sprite)aMRUNodes_238.insertFromCache(l);

            if (sprite != null)
            {
                return(sprite);
            }
            try
            {
                sprite = new Sprite(streamLoader, s, i);
                aMRUNodes_238.removeFromCache(sprite, l);
            }
            catch (Exception _ex)
            {
                return(null);
            }
            return(sprite);
        }
Beispiel #4
0
        public static void unpackConfig(StreamLoader streamLoader)
        {
            Stream stream = new Stream(streamLoader.getDataForName("spotanim.dat"));
            int    length = stream.readUnsignedWord();

            UnityEngine.Debug.Log("525 Graphics Amount: " + length);
            if (cache == null)
            {
                cache = new SpotAnim[length];
            }
            for (int j = 0; j < length; j++)
            {
                if (cache[j] == null)
                {
                    cache[j] = new SpotAnim();
                }
                cache[j].anInt404 = j;
                cache[j].readValues(stream);
            }
        }
Beispiel #5
0
        public static void unpackConfig(StreamLoader streamLoader)
        {
            buffer = new Stream(UnityClient.ReadAllBytes(sign.signlink.osHDDir + "loc.dat"));              //streamLoader.getDataForName("loc.dat"));
            Stream buffer2      = new Stream(UnityClient.ReadAllBytes(sign.signlink.osHDDir + "loc.idx")); //streamLoader.getDataForName("loc.idx"));
            int    totalObjects = buffer2.readUnsignedWord();

            Debug.Log("OS Object Amount: " + totalObjects);
            streamIndices = new int[totalObjects + 40000];
            int i = 2;

            for (int j = 0; j < totalObjects; j++)
            {
                streamIndices[j] = i;
                i += buffer2.readUnsignedWord();
            }
            cache = new ObjectDef[20];
            for (int k = 0; k < 20; k++)
            {
                cache[k] = new ObjectDef();
            }
        }
Beispiel #6
0
        public static void unpackConfig(StreamLoader streamLoader)
        {
            stream = new Stream(streamLoader.getDataForName("obj.dat"));
            Stream stream2 = new Stream(streamLoader.getDataForName("obj.idx"));

            totalItems    = stream2.readUnsignedWord();
            streamIndices = new int[totalItems + 10000];
            Debug.Log("Items Loaded: " + totalItems);
            int i = 2;

            for (int j = 0; j < totalItems; j++)
            {
                streamIndices[j] = i;
                i += stream2.readUnsignedWord();
            }
            cache = new ItemDef[10];
            for (int k = 0; k < 10; k++)
            {
                cache[k] = new ItemDef();
            }
        }
Beispiel #7
0
        public static void unpackConfig(StreamLoader streamLoader)
        {
            stream = new Stream(streamLoader.getDataForName("npc.dat"));
            Stream stream2   = new Stream(streamLoader.getDataForName("npc.idx"));
            int    totalNPCs = stream2.readUnsignedWord();

            streamIndices = new int[totalNPCs];
            Debug.Log("Npcs Loaded: " + totalNPCs);
            int i = 2;

            for (int j = 0; j < totalNPCs; j++)
            {
                streamIndices[j] = i;
                i += stream2.readUnsignedWord();
            }

            cache = new EntityDef[20];
            for (int k = 0; k < 20; k++)
            {
                cache[k] = new EntityDef();
            }
        }
Beispiel #8
0
        public static void unpack(StreamLoader streamLoader, TextDrawingArea[] textDrawingAreas, StreamLoader streamLoader_1)
        {
            aMRUNodes_238 = new MRUNodes(50000);
            Stream stream = new Stream(streamLoader.getDataForName("data"));
            int    i      = -1;
            int    j      = stream.readUnsignedWord();

            interfaceCache = new RSInterface[j];
            while (stream.currentOffset < stream.buffer.Length)
            {
                int k = stream.readUnsignedWord();
                if (k == 65535)
                {
                    i = stream.readUnsignedWord();
                    k = stream.readUnsignedWord();
                }

                RSInterface rsInterface = interfaceCache[k] = new RSInterface();
                rsInterface.id           = k;
                rsInterface.parentID     = i;
                rsInterface.type         = stream.readUnsignedByte();
                rsInterface.atActionType = stream.readUnsignedByte();
                rsInterface.anInt214     = stream.readUnsignedWord();
                rsInterface.width        = stream.readUnsignedWord();
                rsInterface.height       = stream.readUnsignedWord();
                rsInterface.aByte254     = (byte)stream.readUnsignedByte();
                rsInterface.anInt230     = stream.readUnsignedByte();
                if (rsInterface.anInt230 != 0)
                {
                    rsInterface.anInt230 = (rsInterface.anInt230 - 1 << 8) + stream.readUnsignedByte();
                }
                else
                {
                    rsInterface.anInt230 = -1;
                }
                int i1 = stream.readUnsignedByte();
                if (i1 > 0)
                {
                    rsInterface.anIntArray245 = new int[i1];
                    rsInterface.anIntArray212 = new int[i1];
                    for (int j1 = 0; j1 < i1; j1++)
                    {
                        rsInterface.anIntArray245[j1] = stream.readUnsignedByte();
                        rsInterface.anIntArray212[j1] = stream.readUnsignedWord();
                    }
                }
                int k1 = stream.readUnsignedByte();
                if (k1 > 0)
                {
                    rsInterface.valueIndexArray = new int[k1][];
                    for (int l1 = 0; l1 < k1; l1++)
                    {
                        int i3 = stream.readUnsignedWord();
                        rsInterface.valueIndexArray[l1] = new int[i3];
                        for (int l4 = 0; l4 < i3; l4++)
                        {
                            rsInterface.valueIndexArray[l1][l4] = stream.readUnsignedWord();
                        }
                    }
                }
                if (rsInterface.type == 0)
                {
                    rsInterface.scrollMax   = stream.readUnsignedWord();
                    rsInterface.aBoolean266 = stream.readUnsignedByte() == 1;
                    int i2 = stream.readUnsignedWord();
                    rsInterface.children = new int[i2];
                    rsInterface.childX   = new int[i2];
                    rsInterface.childY   = new int[i2];
                    for (int j3 = 0; j3 < i2; j3++)
                    {
                        rsInterface.children[j3] = stream.readUnsignedWord();
                        rsInterface.childX[j3]   = stream.readSignedWord();
                        rsInterface.childY[j3]   = stream.readSignedWord();
                    }
                }
                if (rsInterface.type == 1)
                {
                    stream.readUnsignedWord();
                    stream.readUnsignedByte();
                }
                if (rsInterface.type == 2)
                {
                    rsInterface.inv                  = new int[rsInterface.width * rsInterface.height];
                    rsInterface.invStackSizes        = new int[rsInterface.width * rsInterface.height];
                    rsInterface.aBoolean259          = stream.readUnsignedByte() == 1;
                    rsInterface.isInventoryInterface = stream.readUnsignedByte() == 1;
                    rsInterface.usableItemInterface  = stream.readUnsignedByte() == 1;
                    rsInterface.aBoolean235          = stream.readUnsignedByte() == 1;
                    rsInterface.invSpritePadX        = stream.readUnsignedByte();
                    rsInterface.invSpritePadY        = stream.readUnsignedByte();
                    rsInterface.spritesX             = new int[20];
                    rsInterface.spritesY             = new int[20];
                    rsInterface.sprites              = new Sprite[20];
                    for (int j2 = 0; j2 < 20; j2++)
                    {
                        int k3 = stream.readUnsignedByte();
                        if (k3 == 1)
                        {
                            rsInterface.spritesX[j2] = stream.readSignedWord();
                            rsInterface.spritesY[j2] = stream.readSignedWord();
                            String s1 = stream.readString();
                            if (streamLoader_1 != null && s1.Length > 0)
                            {
                                int i5 = s1.LastIndexOf(",");
                                rsInterface.sprites[j2] = method207(int.Parse(s1.Substring(i5 + 1)), streamLoader_1, s1.Substring(0, i5));
                            }
                        }
                    }

                    rsInterface.actions = new String[5];
                    for (int l3 = 0; l3 < 5; l3++)
                    {
                        rsInterface.actions[l3] = stream.readString();
                        if (rsInterface.actions[l3].Length == 0)
                        {
                            rsInterface.actions[l3] = null;
                        }
                    }
                }
                if (rsInterface.type == 3)
                {
                    rsInterface.aBoolean227 = stream.readUnsignedByte() == 1;
                }
                if (rsInterface.type == 4 || rsInterface.type == 1)
                {
                    rsInterface.aBoolean223 = stream.readUnsignedByte() == 1;
                    int k2 = stream.readUnsignedByte();
                    if (textDrawingAreas != null)
                    {
                        rsInterface.textDrawingAreas = textDrawingAreas[k2];
                    }
                    rsInterface.aBoolean268 = stream.readUnsignedByte() == 1;
                }
                if (rsInterface.type == 4)
                {
                    rsInterface.message    = stream.readString();
                    rsInterface.aString228 = stream.readString();
                }
                if (rsInterface.type == 1 || rsInterface.type == 3 || rsInterface.type == 4)
                {
                    rsInterface.textColor = stream.readDWord();
                }
                if (rsInterface.type == 3 || rsInterface.type == 4)
                {
                    rsInterface.anInt219 = stream.readDWord();
                    rsInterface.anInt216 = stream.readDWord();
                    rsInterface.anInt239 = stream.readDWord();
                }
                if (rsInterface.type == 5)
                {
                    String s = stream.readString();
                    if (streamLoader_1 != null && s.Length > 0)
                    {
                        int i4 = s.LastIndexOf(",");
                        rsInterface.sprite1 = method207(int.Parse(s.Substring(i4 + 1)), streamLoader_1, s.Substring(0, i4));
                    }
                    s = stream.readString();
                    if (streamLoader_1 != null && s.Length > 0)
                    {
                        int j4 = s.LastIndexOf(",");
                        rsInterface.sprite2 = method207(int.Parse(s.Substring(j4 + 1)), streamLoader_1, s.Substring(0, j4));
                    }
                }
                if (rsInterface.type == 6)
                {
                    int l = stream.readUnsignedByte();
                    if (l != 0)
                    {
                        rsInterface.anInt233 = 1;
                        rsInterface.mediaID  = (l - 1 << 8) + stream.readUnsignedByte();
                    }
                    l = stream.readUnsignedByte();
                    if (l != 0)
                    {
                        rsInterface.anInt255 = 1;
                        rsInterface.anInt256 = (l - 1 << 8) + stream.readUnsignedByte();
                    }
                    l = stream.readUnsignedByte();
                    if (l != 0)
                    {
                        rsInterface.anInt257 = (l - 1 << 8) + stream.readUnsignedByte();
                    }
                    else
                    {
                        rsInterface.anInt257 = -1;
                    }
                    l = stream.readUnsignedByte();
                    if (l != 0)
                    {
                        rsInterface.anInt258 = (l - 1 << 8) + stream.readUnsignedByte();
                    }
                    else
                    {
                        rsInterface.anInt258 = -1;
                    }
                    rsInterface.anInt269 = stream.readUnsignedWord();
                    rsInterface.anInt270 = stream.readUnsignedWord();
                    rsInterface.anInt271 = stream.readUnsignedWord();
                }
                if (rsInterface.type == 7)
                {
                    rsInterface.inv           = new int[rsInterface.width * rsInterface.height];
                    rsInterface.invStackSizes = new int[rsInterface.width * rsInterface.height];
                    rsInterface.aBoolean223   = stream.readUnsignedByte() == 1;
                    int l2 = stream.readUnsignedByte();
                    if (textDrawingAreas != null)
                    {
                        rsInterface.textDrawingAreas = textDrawingAreas[l2];
                    }
                    rsInterface.aBoolean268          = stream.readUnsignedByte() == 1;
                    rsInterface.textColor            = stream.readDWord();
                    rsInterface.invSpritePadX        = stream.readSignedWord();
                    rsInterface.invSpritePadY        = stream.readSignedWord();
                    rsInterface.isInventoryInterface = stream.readUnsignedByte() == 1;
                    rsInterface.actions = new String[5];
                    for (int k4 = 0; k4 < 5; k4++)
                    {
                        rsInterface.actions[k4] = stream.readString();
                        if (rsInterface.actions[k4].Length == 0)
                        {
                            rsInterface.actions[k4] = null;
                        }
                    }
                }
                if (rsInterface.atActionType == 2 || rsInterface.type == 2)
                {
                    rsInterface.selectedActionName = stream.readString();
                    rsInterface.spellName          = stream.readString();
                    rsInterface.spellUsableOn      = stream.readUnsignedWord();
                }

                if (rsInterface.type == 8)
                {
                    rsInterface.message = stream.readString();
                }

                if (rsInterface.atActionType == 1 || rsInterface.atActionType == 4 || rsInterface.atActionType == 5 || rsInterface.atActionType == 6)
                {
                    rsInterface.tooltip = stream.readString();
                    if (rsInterface.tooltip.Length == 0)
                    {
                        if (rsInterface.atActionType == 1)
                        {
                            rsInterface.tooltip = "Ok";
                        }
                        if (rsInterface.atActionType == 4)
                        {
                            rsInterface.tooltip = "Select";
                        }
                        if (rsInterface.atActionType == 5)
                        {
                            rsInterface.tooltip = "Select";
                        }
                        if (rsInterface.atActionType == 6)
                        {
                            rsInterface.tooltip = "Continue";
                        }
                    }
                }

                //aryan	Bot.notifyInterface(rsInterface);
            }
            interfaceCache[11877] = null;
            interfaceCache[426]   = null;
            interfaceCache[370]   = null;
            interfaceCache[481]   = null;
            interfaceCache[482]   = null;
            aMRUNodes_238         = null;
        }
Beispiel #9
0
        public TextDrawingArea(bool flag, String s, StreamLoader streamLoader)
        {
            aByteArrayArray1491 = new byte[256][];
            anIntArray1492      = new int[256];
            anIntArray1493      = new int[256];
            anIntArray1494      = new int[256];
            anIntArray1495      = new int[256];
            anIntArray1496      = new int[256];
            aRandom1498         = new System.Random();
            aBoolean1499        = false;
            Stream stream   = new Stream(streamLoader.getDataForName(s + ".dat"));
            Stream stream_1 = new Stream(streamLoader.getDataForName("index.dat"));

            stream_1.currentOffset = stream.readUnsignedWord() + 4;
            int k = stream_1.readUnsignedByte();

            if (k > 0)
            {
                stream_1.currentOffset += 3 * (k - 1);
            }
            for (int l = 0; l < 256; l++)
            {
                anIntArray1494[l] = stream_1.readUnsignedByte();
                anIntArray1495[l] = stream_1.readUnsignedByte();
                int i1 = anIntArray1492[l] = stream_1.readUnsignedWord();
                int j1 = anIntArray1493[l] = stream_1.readUnsignedWord();
                int k1 = stream_1.readUnsignedByte();
                int l1 = i1 * j1;
                aByteArrayArray1491[l] = new byte[l1];
                if (k1 == 0)
                {
                    for (int i2 = 0; i2 < l1; i2++)
                    {
                        aByteArrayArray1491[l][i2] = (byte)stream.readSignedByte();
                    }
                }
                else
                if (k1 == 1)
                {
                    for (int j2 = 0; j2 < i1; j2++)
                    {
                        for (int l2 = 0; l2 < j1; l2++)
                        {
                            aByteArrayArray1491[l][j2 + l2 * i1] = (byte)stream.readSignedByte();
                        }
                    }
                }
                if (j1 > anInt1497 && l < 128)
                {
                    anInt1497 = j1;
                }
                anIntArray1494[l] = 1;
                anIntArray1496[l] = i1 + 2;
                int k2 = 0;
                for (int i3 = j1 / 7; i3 < j1; i3++)
                {
                    k2 += aByteArrayArray1491[l][i3 * i1];
                }

                if (k2 <= j1 / 7)
                {
                    anIntArray1496[l]--;
                    anIntArray1494[l] = 0;
                }
                k2 = 0;
                for (int j3 = j1 / 7; j3 < j1; j3++)
                {
                    k2 += aByteArrayArray1491[l][(i1 - 1) + j3 * i1];
                }

                if (k2 <= j1 / 7)
                {
                    anIntArray1496[l]--;
                }
            }

            if (flag)
            {
                anIntArray1496[32] = anIntArray1496[73];
            }
            else
            {
                anIntArray1496[32] = anIntArray1496[105];
            }
        }