GetStaticTiles() 공개 메소드

public GetStaticTiles ( int x, int y ) : Ultima.HuedTile[]
x int
y int
리턴 Ultima.HuedTile[]
예제 #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            Ultima.Tile mytile = new Ultima.Tile();

            //mytile = tm.GetLandTile(2563, 489);
            int mytileid = (mytile.ID & 0x3FFF);
               // uonet.display(""+mytileid);

            Ultima.Tile mytile2 = new Ultima.Tile();
            Ultima.TileMatrix tm = new TileMatrix(0, 0, 6144, 4096);
            HuedTile[] htile = tm.GetStaticTiles(2563, 489);
            int mytileid2 = (htile[0].ID & 0x3FFF); // need a check, exception if ID is 0
            //uonet.display("" + htile[0].ID + "___" + htile[1].ID);

            //mytile2 =

            mytile = tm.GetLandTile(273, 1216);
            //txtOutput.Text = txtOutput.Text + StringList.Table[1076267];
            //txtOutput.Text = txtOutput.Text +
        }
예제 #2
0
        public void TargetGround(int X, int Y, int Z, int ID)
        {
            //ID should be 00
            // get ground type from x/y
            //if ((int)uonet.player.Facet <= 1) need a check to set right map size for tokuno/malas.
            // This will only work in britannia
                Ultima.TileMatrix tm = new TileMatrix(0, 0, 6144, 4096);
                HuedTile[] htile = tm.GetStaticTiles(X, Y);
                int mytileid2 = (htile[0].ID & 0x3FFF);

            uonet.Send(uonet.ClickTargetPacket(ID, X, Y, Z, mytileid2, CursorTarget.SelectXYZ));

            uonet.UOClient.TargCurs = 0;
        }
예제 #3
0
        private void button3_Click(object sender, EventArgs e)
        {
            string newPath = Application.ExecutablePath.Substring(0, Application.ExecutablePath.LastIndexOf('\\'));
            newPath += @"\Created\";

            if (!Directory.Exists(newPath))
                Directory.CreateDirectory(newPath);
            TileMatrix tm = new TileMatrix(0, 0, 6144, 4096);
            TransTable tt = new TransTable();
            for (int BlockX = 0; BlockX < 96; BlockX++)
            {
                for (int BlockY = 0; BlockY < 64; BlockY++)
                {
                    int BlockID = BlockX * 64 + BlockY + 1;
                    int firstID = BlockID / 100;
                    int secondID = BlockID - firstID * 100;
                    BlockID--;
                    String filename = newPath+"facet0_" + firstID + "_" + secondID + ".dat";
                    BinaryWriter bw = new BinaryWriter(File.Create(filename));
                    Tile t;
                    HuedTile[] ht;
                    bool overlap = false;
                    for (int X = BlockX * 64; X < (BlockX + 1) * 64; X++)
                    {
                        for (int Y = BlockY * 64; Y < (BlockY + 1) * 64; Y++)
                        {
                            t = tm.GetLandTile(X, Y);
                            if (!overlap)
                                bw.Write((byte)0);
                            else
                                overlap = false;
                            if (bw.BaseStream.Position == 1)
                                bw.Write((UInt16)BlockID);
                            else
                                bw.Write((UInt16)0);
                            bw.Write((SByte)t.Z);
                            bw.Write((UInt16)tt[t.ID]);
                            bw.Write(UopParser.Flip((UInt16)t.ID));
                            AddDelimiters(bw, BlockX, BlockY, X, Y);
                            ht = tm.GetStaticTiles(X, Y);
                            if (ht!=null)
                            {
                                for (int i = 0; i < ht.Length; i++)
                                {
                                    if (!overlap)
                                        bw.Write((byte)0);
                                    else
                                        overlap = false;
                                    bw.Write((byte)0);
                                    if (i == 0)
                                        bw.Write((byte)ht.Length);
                                    else
                                        bw.Write((byte)0);
                                    bw.Write((UInt16)ht[i].ID);
                                    bw.Write((UInt16)0);
                                    bw.Write((sbyte)ht[i].Z);
                                    bw.Write((UInt16)ht[i].Hue);
                                    overlap = true;
                                }
                            }                            
                        }
                    }
                    bw.Write(new byte[] { 0, 0, 0 });
                    bw.Close();
                }
            }

        }