Example #1
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////
        // Move Item From Buying To Inventory
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////
        public static byte[] MoveItemBuy(byte type, byte shopLine, byte itemLine, byte max, byte slot, short amount)
        {
            PacketWriter Writer = new PacketWriter();

            Writer.Create(Systems.SERVER_ITEM_MOVE);
            Writer.Bool(true);
            Writer.Byte(type);
            Writer.Byte(shopLine);
            Writer.Byte(itemLine);
            Writer.Byte(1);
            Writer.Byte(slot);
            Writer.Word(amount);
            Writer.DWord(0);
            return(Writer.GetBytes());
        }
Example #2
0
        public static byte[] Player_getExp(int id, long exp, long sp, short level)
        {
            PacketWriter Writer = new PacketWriter();

            Writer.Create(Systems.SERVER_PLAYER_GET_EXP);
            Writer.DWord(id);
            Writer.LWord(exp);
            Writer.LWord(sp);
            Writer.Byte(0);
            if (level != 0)
            {
                Writer.Word(level);
            }
            return(Writer.GetBytes());
        }
Example #3
0
        public static byte[] Exchange_ItemSlot(byte type, byte slot)
        {
            PacketWriter Writer = new PacketWriter();

            Writer.Create(Systems.SERVER_ITEM_MOVE);
            Writer.Byte(1);
            Writer.Byte(type);
            Writer.Byte(slot);
            if (type == 4)
            {
                Writer.Byte(0);
            }

            return(Writer.GetBytes());
        }
Example #4
0
        public static byte[] Player_Emote(int id, byte type)
        {
            PacketWriter Writer = new PacketWriter();

            Writer.Create(Systems.SERVER_EMOTE);
            Writer.DWord(id);
            if (type == 1)
            {
                Writer.Byte(1);
            }
            else
            {
                Writer.Byte(type);
            }
            return(Writer.GetBytes());
        }
Example #5
0
        public static byte[] GuildSetOnline(guild c, int memberid)
        {
            PacketWriter Writer = new PacketWriter();

            Writer.Create(Systems.SERVER_GUILD_ONLINE);
            Writer.DWord(memberid);
            Writer.DWord(c.Guildid);
            Writer.Text(c.Name);
            Writer.Word(0);
            Writer.DWord(0);
            Writer.DWord(0);
            Writer.DWord(0);
            Writer.Byte(0);
            Writer.Byte(1);
            return(Writer.GetBytes());
        }
Example #6
0
 void CharacterJobPick(byte[] buff)
 {
     //Wrap our function inside a catcher
     try
     {
         //Create new packet reader
         PacketReader Reader = new PacketReader(buff);
         //Skip first byte not used
         Reader.Skip(1);
         //Read name lenght
         short CharacterNameLEN = Reader.Int16();
         //Read character name
         string CharacterName = Reader.String(CharacterNameLEN);
         //Read job selection
         byte job = Reader.Byte();
         //Close packet reader
         Reader.Close();
         //Get row count from character to check if the current account and character match
         int NameCheck = MsSQL.GetRowsCount("SELECT * FROM character WHERE account='" + Player.AccountName + "'");
         //Get job information from database as integer
         int jobcheck = MsSQL.GetDataInt("SELECT jobtype FROM users WHERE id='" + Player.AccountName + "'", "jobtype");
         //If the name check is succesfull and account has no job set.
         if (jobcheck == 0 && NameCheck != 0)
         {
             //Write new job information to the database
             MsSQL.UpdateData("UPDATE users SET jobtype='" + job + "' WHERE id='" + Player.AccountName + "'");
         }
         //Send visual confirmation in packet
         PacketWriter writer = new PacketWriter();
         //Add opcode
         writer.Create(Systems.SERVER_CHARACTERSCREEN);
         //Write static byte 10
         writer.Byte(0x10);
         //Write succes byte 1
         writer.Byte(1);
         //Send bytes to client
         client.Send(writer.GetBytes());
     }
     //Catch any bad exception error
     catch (Exception ex)
     {
         //Write error information to the console
         Console.WriteLine("Job selection error {0}", ex);
         //Write error to debug log file
         Systems.Debugger.Write(ex);
     }
 }
Example #7
0
        public static byte[] ActionPacket(byte type1, byte type2, int skillid, int ownerid, int castingid, int target)
        {
            PacketWriter Writer = new PacketWriter();

            Writer.Create(Systems.SERVER_ACTION_DATA);
            Writer.Byte(type1);
            Writer.Byte(type2);
            Writer.Byte(0x30);

            Writer.DWord(skillid);
            Writer.DWord(ownerid);
            Writer.DWord(castingid);
            Writer.DWord(target);
            Writer.Byte(0);

            return(Writer.GetBytes());
        }
Example #8
0
        void ListPartyMatching(List <party> pt)
        {
            //Create new packet writer
            PacketWriter Writer = new PacketWriter();

            //Add opcode
            Writer.Create(Systems.SERVER_SEND_PARTYLIST);
            //Write static bytes
            Writer.Byte(1);
            Writer.Byte(4);
            Writer.Byte(0);
            //Write total count of partys
            Writer.Byte(pt.Count);
            //If party count higher is then zero
            if (pt.Count > 0)
            {
                //Repeat for each party in list of party's
                foreach (party currpt in pt)
                {
                    //Get player information using leaderid
                    Systems s = Systems.GetPlayer(currpt.LeaderID);
                    //Write party id
                    Writer.DWord(currpt.ptid);
                    //Write leader id
                    Writer.DWord(currpt.LeaderID);
                    //Write charactername
                    Writer.Text(s.Character.Information.Name);
                    //Write static byte 1
                    Writer.Byte(1);
                    //Write current party players count
                    Writer.Byte(currpt.Members.Count);
                    //Write party type
                    Writer.Byte(currpt.Type);
                    //Write party purpose
                    Writer.Byte(currpt.ptpurpose);
                    //Write min level required
                    Writer.Byte(currpt.minlevel);
                    //Write max level to join the party
                    Writer.Byte(currpt.maxlevel);
                    //Write party name
                    Writer.Text3(currpt.partyname);
                }
            }
            //Send bytes to the client
            client.Send(Writer.GetBytes());
        }
Example #9
0
 void CharacterJobInfo()
 {
     //Wrap our function into catcher
     try
     {
         //Set defaul int's to 0
         int TotalHunters = 0;
         int TotalThiefs  = 0;
         //Update hunter and thief count.
         TotalHunters = MsSQL.GetRowsCount("SELECT * FROM users WHERE jobtype='1'");
         TotalThiefs  = MsSQL.GetRowsCount("SELECT * FROM users WHERE jobtype='2'");
         //Set total count
         int jobplayercount = TotalThiefs + TotalHunters;
         //Set our null to 1 if this would happen
         if (jobplayercount == 0)
         {
             jobplayercount = 1;
         }
         //Calculate our % for the jobs
         double thiefpercentage  = (double)TotalThiefs / (double)jobplayercount * 100.0;
         double hunterpercentage = (double)TotalHunters / (double)jobplayercount * 100.0;
         //Send visual packet for job %
         PacketWriter writer = new PacketWriter();
         //Add opcode
         writer.Create(Systems.SERVER_CHARACTERSCREEN);
         //Static byte 9
         writer.Byte(9);
         //Static byte 1
         writer.Byte(1);
         //Byte total amount of hunters %
         writer.Byte((byte)hunterpercentage);
         //Byte total amount of thiefs %
         writer.Byte((byte)thiefpercentage);
         //Send bytes to client
         client.Send(writer.GetBytes());
     }
     //Catch bad exception errors
     catch (Exception ex)
     {
         //Write information to the console
         Console.WriteLine("Character job info error {0}", ex);
         //Write info to the debug log
         Systems.Debugger.Write(ex);
     }
 }
Example #10
0
 public static byte[] PlayerStat(character c)
 {
     PacketWriter Writer = new PacketWriter();
     Writer.Create(Systems.SERVER_PLAYERSTAT);
     Writer.DWord((int)c.Stat.MinPhyAttack);
     Writer.DWord((int)c.Stat.MaxPhyAttack);
     Writer.DWord((int)c.Stat.MinMagAttack);
     Writer.DWord((int)c.Stat.MaxMagAttack);
     Writer.Word((ushort)c.Stat.PhyDef);
     Writer.Word((ushort)c.Stat.MagDef);
     Writer.Word((ushort)c.Stat.Hit);
     Writer.Word((ushort)c.Stat.Parry);
     Writer.DWord((int)c.Stat.Hp);
     Writer.DWord((int)c.Stat.Mp);
     Writer.Word((ushort)c.Stat.Strength);
     Writer.Word((ushort)c.Stat.Intelligence);
     return Writer.GetBytes();
 }
Example #11
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////
        // Buy Item From Item Mall
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////
        public static byte[] BuyItemFromMall(byte type1, byte type2, byte type3, byte type4, byte type5, byte slot)
        {
            PacketWriter Writer = new PacketWriter();

            Writer.Create(Systems.SERVER_ITEM_MOVE);    //Select opcode
            Writer.Byte(1);                             //Static Byte 1
            Writer.Byte(0x18);                          //Static Byte 0x18 /switch possible perhaps
            Writer.Byte(type1);                         // Recheck
            Writer.Byte(type2);                         // Recheck
            Writer.Byte(type3);                         // Recheck
            Writer.Byte(type4);                         // Recheck
            Writer.Byte(type5);                         // Recheck
            Writer.Byte(1);                             //Static Byte 1
            Writer.Byte(slot);                          //Select To Slot
            Writer.Word(1);                             //Static
            Writer.DWord(0);                            //Static
            return(Writer.GetBytes());
        }
Example #12
0
        public static byte[] HonorRank(character c)
        {
            Systems.MsSQL ms        = new Systems.MsSQL("SELECT * FROM rank_honor");
            PacketWriter  Writer    = new PacketWriter();
            int           countinfo = ms.Count();

            Writer.Create(Systems.SERVER_HONOR_RANK);
            Writer.Byte(1);
            int i = 0;

            Writer.Byte(Convert.ToByte(countinfo));
            using (SqlDataReader reader = ms.Read())
            {
                while (reader.Read())
                {
                    byte   rankicon   = reader.GetByte(1);
                    string rankname   = reader.GetString(2);
                    byte   ranklevel  = reader.GetByte(3);
                    byte   ranklevelc = reader.GetByte(4);
                    int    graduatesc = reader.GetInt32(5);
                    int    rankposc   = reader.GetInt32(6);

                    Writer.DWord(i + 1);
                    Writer.Byte(rankicon);
                    Writer.Text(rankname);
                    Writer.Byte(ranklevel);
                    Writer.Byte(ranklevelc);
                    Writer.DWord(graduatesc);
                    //If player has no guild, we write a 0 word value
                    if (c.Network.Guild.Name == null)
                    {
                        Writer.Word(0);
                    }
                    //If player has a guild we write the guild name.
                    else
                    {
                        Writer.Text(c.Network.Guild.Name);
                    }
                    i++;
                }
                ms.Close();
            }
            return(Writer.GetBytes());
        }
Example #13
0
        public static byte[] SelectObject(int id, int model, byte type, int hp)
        {
            PacketWriter Writer = new PacketWriter();

            Writer.Create(Systems.SERVER_SELECT_OBJECT);
            Writer.Bool(true);
            Writer.DWord(id);
            switch (type)
            {
            case 1:
                Writer.Byte(1);
                Writer.DWord(hp);
                Writer.Byte(1);
                Writer.Byte(5);
                break;

            case 2:
                Systems.NPC.Chat(model, Writer);
                break;

            case 3:
                Systems.NPC.Chat(model, Writer);
                break;

            case 4:
                Writer.Byte(1);
                Writer.DWord(hp);
                Writer.Byte(1);
                Writer.Byte(5);
                break;

            case 5:
                Writer.Byte(1);
                Writer.Byte(5);
                //Writer.Byte(4);
                break;

            default:
                Console.WriteLine("Non Coded Select Type: " + type + "");
                break;
            }
            return(Writer.GetBytes());
        }
Example #14
0
        public static byte[] PromoteOrDisband(byte information)
        {
            PacketWriter Writer = new PacketWriter();

            switch (information)
            {
            case 1:
                //Disband message
                Writer.Create(Systems.SERVER_GUILD_PROMOTE_MSG);
                Writer.Byte(1);
                break;

            case 2:
                //Promote upgrade message
                Writer.Create(Systems.SERVER_GUILD_DISBAND_MSG);
                Writer.Byte(1);
                break;
            }
            return(Writer.GetBytes());
        }
Example #15
0
        public static byte[] JoinMerchant(int id, byte type)
        {
            PacketWriter Writer = new PacketWriter();

            Writer.Create(Systems.SERVER_JOIN_MERC);
            switch (type)
            {
            case 3:
                Writer.Byte(1);
                Writer.Byte(type);
                Writer.Byte(1);
                Writer.DWord(0);
                break;

            default:
                //Console.WriteLine("Join hunter Case: " + type);
                break;
            }
            return(Writer.GetBytes());
        }
Example #16
0
        public static byte[] PrevJobInfo(int character, byte type)
        {
            PacketWriter Writer = new PacketWriter();

            Writer.Create(Systems.SERVER_PREV_JOB);
            switch (type)
            {
            case 244:
                Writer.Byte(0x02);
                Writer.Byte(0x29);
                Writer.Byte(0x48);
                break;

            default:
                //Console.WriteLine("Job Case: " + type);
                break;
            }

            return(Writer.GetBytes());
        }
Example #17
0
        public static byte[] SkillPacket(byte type, int castingid, int ownerid = 0)
        {
            PacketWriter Writer = new PacketWriter();

            Writer.Create(Systems.SERVER_SKILL_DATA);
            Writer.Byte(1);
            Writer.DWord(castingid);
            Writer.Byte(type);
            switch (type)
            {
            case 0:
                Writer.DWord(ownerid);
                break;

            default:
                Console.WriteLine("Skill packet case: " + type);
                break;
            }
            return(Writer.GetBytes());
        }
Example #18
0
        public static byte[] OpenWarehouse2(byte storageslots, player c)
        {
            PacketWriter Writer = new PacketWriter();

            Writer.Create(Systems.SERVER_OPEN_WAREPROB);
            Writer.Byte(storageslots);

            Systems.MsSQL ms = new Systems.MsSQL("SELECT * FROM char_items WHERE storageacc='" + c.ID + "' AND storagetype='1'");

            Writer.Byte(ms.Count());
            using (System.Data.SqlClient.SqlDataReader reader = ms.Read())
            {
                while (reader.Read())
                {
                    Item.AddItemPacket(Writer, reader.GetByte(5), reader.GetInt32(2), reader.GetByte(4), reader.GetInt16(6), reader.GetInt32(7), reader.GetInt32(0), reader.GetInt32(9), reader.GetInt32(30));
                }
            }
            ms.Close();
            return(Writer.GetBytes());
        }
Example #19
0
        public static byte[] PartyRequest(byte Type, int id, byte type)
        {
            //Create new packet writer
            PacketWriter Writer = new PacketWriter();

            //Add opcode
            Writer.Create(Systems.SERVER_PARTY_REQUEST);
            //Write type byte
            Writer.Byte(Type);
            //Create switch on type
            switch (Type)
            {
            case 6:
                //Union invite
                Writer.DWord(id);
                break;

            case 5:
                //Guild invitation
                Writer.DWord(id);
                Systems InvitedPlayer = Systems.GetPlayer(id);
                Writer.Word(InvitedPlayer.Character.Information.Name.Length);
                Writer.String(InvitedPlayer.Character.Information.Name);
                Writer.Word(InvitedPlayer.Character.Network.Guild.Name.Length);
                Writer.String(InvitedPlayer.Character.Network.Guild.Name);
                break;

            case 2:
                //Party invite
                Writer.DWord(id);
                Writer.Byte(type);
                break;

            case 1:
                //Exchange invite
                Writer.DWord(id);
                break;
            }

            return(Writer.GetBytes());
        }
Example #20
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////
        // Movement Packet
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////

        public static byte[] Movement(DarkEmu_GameServer.Global.vektor p)
        {
            PacketWriter Writer = new PacketWriter();

            Writer.Create(Systems.SERVER_MOVEMENT);         //Select opcode
            Writer.DWord(p.ID);                             //Player ID
            Writer.Bool(true);                              //Bool 1
            Writer.Byte(p.xSec);                            //Player X Sector
            Writer.Byte(p.ySec);                            //Player Y Sector
            if (!File.FileLoad.CheckCave(p.xSec, p.ySec))
            {
                Writer.Word(p.x);                    //Player X Location
                Writer.Word(p.z);                    //Player Z Location
                Writer.Word(p.y);                    //Player Y Location
            }
            else
            {
                if (p.x < 0)
                {
                    Writer.Word(p.x);
                    Writer.Word(0xFFFF);
                }
                else
                {
                    Writer.DWord(p.x);
                }
                Writer.DWord(p.z);

                if (p.y < 0)
                {
                    Writer.Word(p.y);
                    Writer.Word(0xFFFF);
                }
                else
                {
                    Writer.DWord(p.y);
                }
            }
            Writer.Bool(false);
            return(Writer.GetBytes());
        }
Example #21
0
        public static byte[] GuildStorageStart(byte type)
        {
            PacketWriter Writer = new PacketWriter();

            Writer.Create(Systems.SERVER_GUILD_STORAGE);
            switch (type)
            {
            case 1:
                //Success opening
                //Need to sniff packet data
                break;

            case 2:
                //Level to low
                Writer.Byte(type);      //Type
                Writer.Word(0x4C4A);    //Message type revert
                break;
            }
            Writer.Byte(1);
            return(Writer.GetBytes());
        }
Example #22
0
 public static byte[] Testingpacket(int uniqueid, int skillid, int targetid)
 {
     PacketWriter writer = new PacketWriter();
     writer.Create(0xB070);
     writer.Byte(1);
     writer.Byte(2);
     writer.Byte(0x30);
     writer.DWord(skillid);
     writer.DWord(uniqueid);
     writer.DWord(0x400000); // random :)
     writer.DWord(targetid);
     //writer.Byte(0); // so hm 
     writer.Byte(1);
     writer.Byte(1);
     writer.Byte(1);
     writer.DWord(targetid);
     writer.Byte(0); // static i suppose and it signs the no more target affected
     writer.DWord(0x11); 
     writer.DWord(0x02); // effectid lets modify it a bit :p
     return writer.GetBytes();
     // could be  so if we dont need thoose bytes we can use it like
 }
Example #23
0
        public static byte[] GuildStorageData(character c)
        {
            Systems.MsSQL getstorage = new Systems.MsSQL("SELECT * FROM char_items WHERE guild_storage_id='" + c.Network.Guild.Guildid + "' AND storagetype='3'");
            int           itemcount  = getstorage.Count();
            PacketWriter  Writer     = new PacketWriter();

            Writer.Create(Systems.SERVER_GUILD_STORAGE3);
            Writer.Byte(c.Network.Guild.StorageSlots);
            Writer.Byte(itemcount);
            if (itemcount != 0)
            {
                using (System.Data.SqlClient.SqlDataReader reader = getstorage.Read())
                {
                    while (reader.Read())
                    {
                        Item.AddItemPacket(Writer, reader.GetByte(5), reader.GetInt32(2), reader.GetByte(4), reader.GetInt16(6), reader.GetInt32(7), reader.GetInt32(0), reader.GetInt32(9), reader.GetInt32(30));
                    }
                }
            }
            getstorage.Close();
            return(Writer.GetBytes());
        }
Example #24
0
        public static byte[] EnterStall(int CharacterID, stall stall)
        {
            PacketWriter Writer = new PacketWriter();

            Writer.Create(Systems.SERVER_STALL_OTHER_OPEN);
            Writer.Byte(1);
            Writer.DWord(stall.ownerID);
            Writer.Text3(stall.WelcomeMsg);
            Writer.Bool(stall.isOpened);
            Writer.Byte(0);
            StallItemPacket(stall.ItemList, Writer);
            Writer.Byte(stall.Members.Count - 2);
            for (byte i = 0; i < stall.Members.Count; i++)
            {
                if (stall.Members[i] != stall.ownerID && stall.Members[i] != CharacterID)
                {
                    Writer.DWord(stall.Members[i]);
                }
            }

            return(Writer.GetBytes());
        }
Example #25
0
        public static byte[] FriendData(int target, byte type, string name, character c, bool state)
        {
            PacketWriter Writer = new PacketWriter();

            Writer.Create(Systems.SERVER_FRIEND_DATA);
            switch (type)
            {
            case 2:
                //Friend invite accepted
                Writer.Byte(2);
                Writer.DWord(target);              //Id
                Writer.Text(c.Information.Name);   //Name
                Writer.DWord(c.Information.Model); //Model
                break;

            case 3:
                //Remove friend from own list
                Writer.Byte(3);
                Writer.DWord(target);
                break;

            case 4:
                //Fried online / offline update
                Writer.Byte(4);
                Writer.DWord(target);
                Writer.Byte(state);
                break;

            case 5:
                //Send private message..
                Writer.Byte(8);
                Writer.Text(name);
                Writer.DWord(0);
                Writer.DWord(0);    //time info
                break;
            }
            return(Writer.GetBytes());
        }
Example #26
0
        public static byte[] Unique_Data(byte type, int mobid, string name)
        {
            PacketWriter Writer = new PacketWriter();

            Writer.Create(Systems.SERVER_UNIQUE_ANNOUNCE);
            Writer.Byte(type);
            switch (type)
            {
            case 5:
                Writer.Byte(0x0C);
                Writer.DWord(mobid);
                break;

            case 6:
                Writer.Byte(0x0C);
                Writer.DWord(mobid);
                Writer.Text(name);
                break;
            }


            return(Writer.GetBytes());
        }
Example #27
0
        public static byte[] SendGuildInfo2(character c)
        {
            PacketWriter Writer = new PacketWriter();

            Writer.Create(Systems.SERVER_GUILD_ONLINE);
            Writer.DWord(c.Information.UniqueID);               // Guildmaster ID
            Writer.DWord(c.Network.Guild.Guildid);              // Guild ID
            Writer.Text(c.Network.Guild.Name);
            if (c.Network.Guild.GrantName != "")
            {
                Writer.Text(c.Network.Guild.GrantName);         // Guildmaster grand name len
            }
            else
            {
                Writer.Word(0);
            }
            Writer.DWord(0);                                    // ?
            Writer.DWord(0);                                    // ?
            Writer.DWord(0);                                    // ? Amount of guilds in union ?
            Writer.Byte(1);                                     // ?
            Writer.Byte(1);
            return(Writer.GetBytes());
        }
Example #28
0
        public static byte[] RankListsActivityHunter()
        {
            Systems.MsSQL ms        = new Systems.MsSQL("SELECT TOP 50 * FROM rank_job_activity WHERE job_type='3'");
            PacketWriter  Writer    = new PacketWriter();
            int           countinfo = ms.Count();
            int           i         = 0;

            Writer.Create(Systems.SERVER_RANK_LISTS);
            Writer.Byte(1);
            Writer.Byte(1);
            Writer.Byte(0);
            Writer.Byte(Convert.ToByte(countinfo));

            using (SqlDataReader reader = ms.Read())
            {
                for (i = 0; i < countinfo;)
                {
                    while (reader.Read())
                    {
                        byte   rank  = reader.GetByte(2);
                        string name  = reader.GetString(3);
                        byte   level = reader.GetByte(4);
                        int    exp   = reader.GetInt32(5);
                        byte   title = reader.GetByte(6);

                        Writer.Byte(rank);
                        Writer.Text(name);
                        Writer.Byte(level);
                        Writer.DWord(exp);
                        Writer.Byte(title);
                        i++;
                    }
                }
                ms.Close();
            }
            return(Writer.GetBytes());
        }
Example #29
0
        public static byte[] ChangeStatus(int id, byte type, byte stand)
        {
            PacketWriter Writer = new PacketWriter();

            Writer.Create(Systems.SERVER_CHANGE_STATUS);
            if (type == 2)
            {
                Writer.DWord(id);
                Writer.Byte(1);
                Writer.Byte(2);
            }
            else if (type == 3)
            {
                Writer.DWord(id);
                Writer.Byte(1);
                Writer.Byte(3);
            }
            else if (type == 4)
            {
                Writer.DWord(id);
                Writer.Byte(1);
                Writer.Byte(stand);
            }
            else if (type == 5)
            {
                Writer.DWord(id);
                Writer.Byte(4);
                Writer.Byte(0);
            }
            else if (type == 6)
            {
                Writer.Byte(stand);
                Writer.Byte(0x40);
                Writer.Byte(3);
            }
            return(Writer.GetBytes());
        }
Example #30
0
        public static byte[] AlchemyStoneResponse(bool isSuccess, Global.slotItem sItem)
        {
            PacketWriter Writer = new PacketWriter();

            Writer.Create(Systems.SERVER_ALCHEMY_STONE);
            if (isSuccess)
            {
                Writer.Byte(1);
                Writer.Byte(2);
                Writer.Byte(1);
                Writer.Byte(sItem.Slot);
                Writer.DWord(0);
                Writer.DWord(sItem.ID);
                Writer.Byte(sItem.PlusValue);
                Writer.LWord(0);
                Writer.DWord(sItem.Durability);
                Writer.Byte(Data.ItemBlue[sItem.dbID].totalblue);
                for (int i = 0; i <= Data.ItemBlue[sItem.dbID].totalblue - 1; i++)
                {
                    Writer.DWord(Data.MagicOptions.Find(mg => (mg.Name == Convert.ToString(Data.ItemBlue[sItem.dbID].blue[i]))).ID);
                    Writer.DWord(Data.ItemBlue[sItem.dbID].blueamount[i]);
                }
                Writer.Byte(1);
                Writer.Byte(0);
                Writer.Byte(2);
                Writer.Byte(0);
                Writer.Byte(3);
                Writer.Byte(0);
            }
            else
            {
                Writer.Byte(2);
                Writer.Byte(0x23);
                Writer.Byte(0x54);
            }
            return(Writer.GetBytes());
        }