Exemple #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 +
        }
Exemple #2
0
 private void WriteStatics(BinaryWriter writer, int x, int y)
 {
     HuedTile[] statics = tileMatrix.GetStaticTiles(x, y);
     if (statics != null && statics.Length > 0)
     {
         writer.Write((byte)statics.Length);                   //BYTE -> STATICScount
         for (int i = 0; i < statics.Length; i++)
         {
             HuedTile hued = statics[i];
             writer.Write((UInt32)(hued.ID - 16384));        //DWORD -> STATICgraphic (16384 is the offet dued to the presence in the art.mul of the map art tiles?)
             writer.Write(GetZ((sbyte)hued.Z));              //BYTE  -> STATIC_z
             writer.Write((UInt32)hued.Hue);                 //DWORD -> STATICcolor (hue)
         }
     }
     else
     {
         writer.Write((byte)0);                                //no statics in this tile
     }
     statics = null;
 }
Exemple #3
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;
        }
Exemple #4
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();
                }
            }
        }