Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Programming
You last visited: Today at 05:04

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



A Packet Compiler written in D

Discussion on A Packet Compiler written in D within the CO2 Programming forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
clintonselke's Avatar
 
elite*gold: 0
Join Date: Feb 2007
Posts: 348
Received Thanks: 2,175
A Packet Compiler written in D

A Packet Compiler written in D

Hi guys/girls, just thought I'd show off my packet compiler for conquer. It takes a packet grammar file, and produces C# code for handling the packets.

usage: (typed at command line, (cmd.exe))
Code:
CoPakitCompiler grammar.txt cofreedom.CO > MyPackets.cs
download:

SVN: (for latest code)

sample grammar
Code:
# The Character Creation packet is sent by the client to the game server when the account being used to login doesnt have a character associated with it on the target server.
NewCharacter <- ushort:120 ushort:1001 byte[16]:FirstName byte[16]:LastName ushort:Model ushort:Class uint:AccountId byte[12]:MacAddress

# The Chat packet has changed alot over the years, it still contains 4 strings(From, To, Suffix, Message), although only 3 (From, To, Message) are now used on official servers. Suffix is now ignored, people were adding "[PM]" & "[GM]" to the end of their names in order to access Admin commands which were built into the client, these commands have since been removed. The suffix was also used to scam people, people beleived they were speaking to an official member of staff and gave out their usernames and passwords. You do not need to include a suffix string within your packets, however the length is still required to be 0.
Chat <- ushort:Length ushort:1004 uint:Colour uint:Type uint:Id uint:UnknownA uint:UnknownB byte:StrCount blstring:From blstring:To blstring:Suffix blstring:Message

# The EntityMove packet, also known as the Walk packet, this packet is used by all entitys that can move, such as Players, Monsters and if you wish NPCs.
EntityMovement <- ushort:16 ushort:10005 uint:EntityId byte:Direction byte:speed uint:Timer

# The Character Information packet, this packet is sent primarily durring the login proccess to set the majority of your characters values.
CharacterInformation <- ushort:Length ushort:1006 uint:Id uint:Model ushort:HairStyle uint:Gold uint:CPoints ulong:Experience uint:Unknown ushort:Strength ushort:Dexterity ushort:Vitality ushort:Spirit ushort:StatPoints ushort:Hp ushort:Mp ushort:PkPoints byte:Level byte:Class byte:Reborn byte:NameDisplay uint:QuizPoints uint:Enlighten ushort:UnknownA uint:UnknownB byte:StringCount blstring:FirstName blstring:SecondName blstring:SpouseName

ItemInformation <- ushort:48 ushort:1008 uint:UniqueId uint:Id ushort:Dura ushort:MaxDura ushort:CreationType byte:Location ushort:SpecialType byte:FirstSocket byte:SecondSocket byte:Plus byte:Bless byte:Free byte:Enchant byte:Locked byte:Colour byte:CompositionProgress

# The Item Usage packet used for interacting with the warehouse and equiping/un-equiping/updating items.
ItemUsage <- ushort:28 ushort:1009 uint:ItemId uint:ItemLocation uint:UsageType uint:Timer

# The General Data packet performs a variety of tasks for the client, these varry from moving the client around the game, to ending an xp skill.
GeneralData <- ushort:37 ushort:10010 uint:EntityId uint:ValueA ushort:ValueB ushort:ValueC uint:Timer uint:DataType

# The Entity Spawn packet is used to spawn both Monsters and Characters, it does not spawn NPCs. The packet's layout changes slightly depending on which you are spawning.
EntitySpawn <- ushort:Length ushort:1014 uint:Id uint:ModelId uint:Status ushort:GuildId uint:HelmId uint:ArmorId uint:RightHandId uint:LeftHandId ushort:XCoord ushort:YCoord ushort:HairStyle byte:Direction byte:Action byte:ShowNames blstring:Name

# Intensity: Number increasing with intensity. Valid range is 0-999
# Appearance: The color or style of the particular weather type. For example, WEATHER_LEAFY would have different kinds of leaves. Valid Range (1-5)
Weather <- ushort:20 ushort:1016 byte:Type uint:Intensity uint:Direction uint:Appearance

# The Entity Status packet, also known as the "Update packet" is used to change the appearence(in some cases), certain values unique to a character (such as level, stat points, exp) and show active abilities (in other cases). This packet can be used to send 1 status update, or many.
EntityStatus <- ushort:Length ushort:10017 uint:EntityId dwlarray:(uint:Type ulong:Value):Status

# The Friend packet, used durring login and to update a player when a friend goes online and offline.
Friend <- ushort:Length ushort:1019 uint:Id byte:option byte:Online blstring:Name

# The Action packet, most commonly used for direct Melee/Archer attacks, but also used for certain player -> player actions, such as Marriage.
Action <- ushort:28 ushort:1022 uint:Timer uint:CharId uint:TargetId ushort:CoordX ushort:CoordY uint:ActionType uint:ActionValue

# The Team Option packet is sent for any type of options sent to the client for instance a change of whether or not Picking up Items is forbidden etc.. Please remember this packet hasn't changed at all really only in the newer versions their is the (string)"TQServer" at the end which is not included in the packet length of 12
TeamAction <- ushort:12 ushort:1023 uint:TeamOption uint:Id

# This packet is used to add stat points, sent from client to server, to inform the server of changes. Normally only one of the fields will be populated, and will just contain a 1.
StatusPoint <- ushort:8 ushort:1024 byte:Strength byte:Dexterity byte:Vitiality byte:Spirit

# The Weapon Proficiency Packet is sent durring login and when you learn a new Proficiency.
WeaponProficiency <- ushort:16 ushort:1025 uint:SkillId uint:SkillLevel uint:SkillExperience

# This is the Team Member Info packet, it is sent primarily when a member joins a team or is attacked to update its vitals. Please remember that the CharacterName is a fixed string with a size of 16 and Character_AV is the character Avatar/Picture displayed at the top of the team info area. Also remember for this to work with newer versions you need the (string)"TQServer" which is not included in the packet length of 36.
TeamMember <- ushort:36 ushort:1026 uint:TeamFlags byte[16]:CharName uint:CharId uint:CharAvatar ushort:CharHp ushort:CharMaxHp

# This is the socketing gem which is sent from client to server when adding/removing gems from items.
Gem <- ushort:20 ushort:1027 uint:MainItemUid uint:GemItemUid byte:Socket byte:SocketType

# The Date Packet has a weird format because of how TQ programmed the Client. Where you see -1900 that really is subtracting 1900.
Date <- ushort:36 ushort:1033 uint:Year uint:Month uint:DayOfYear uint:DayOfWeek uint:Hour uint:Minute uint:Second

# The Auth Message Packet is sent by the client durring initial Authentication, it is sent to the game server, the game server uses the keys to determine which account to link to the client. It is also sent by the auth server when you get your username/password wrong or the server is down for example, the packet contains the string of bytes which identify the message to display.
AuthMessage <- ushort:28 ushort:1052 uint:AccountId uint:LoginToken byte[16]:Message

# The Authorization Response is made by the Auth Server if the account is permitted to enter the Game Server.
AuthResponce <- ushort:32 ushort:1055 uint:AccountId uint:LoginToken byte[16]:GameServerIp ushort:GameServerPort

Trade <- ushort:12 ushort:1056 uint:UniqueId uint:TradeType

# The Drop Item Packet is used to drop items on the floor, it is also used to remove an item from a players inventory and to pickup items.
DropItem <- ushort:20 ushort:1101 uint:ItemUid uint:ItemId ushort:XCoord ushort:YCoord uint:LootType

# The Warehouse Packet, used to display the items within a warehouse when opened.
Warehouse <- ushort:Length ushort:1102 uint:WarehouseId dwlarray:(uint:ItemUid uint:ItemId byte:ItemFirstSocket byte:ItemSecondSocket byte:ItemPlus byte:ItemMinus ushort:ItemEnchant):Items

# The Skill Packet is sent durring login and when you learn a new skill.
Skill <- ushort:12 ushort:1103 uint:SkillExp ushort:SkillId ushort:SkillLevel

# The Skill Experience packet can be used to update both Skills and Proficiencys.
SkillExperience <- ushort:12 ushort:1104 uint:SkillExp ushort:SkillId ushort:Type

# The Magic Attack Packet, used for offensive and defensive spells of all kind.
Magic <- ushort:Length ushort:1105 ushort:TargetXCoord ushort:TargetYCoord ushort:SkillId ushort:SkillLevel dwlarray:(uint:TargetId ulong:TargetDamage):Targets

# The Guild Information Packet or Guild Status Packet is sent everytime you open the guild window in the client.
GuildInfo <- ushort:Length ushort:1106 uint:GuildId uint:Donation uint:Fund uint:MemberCount byte:Rank blstring:GuildLeaderName

# The Guild Command Packet is used to perform various guild functions, such as joining and donating.
GuildCommand <- ushort:12 ushort:1107 uint:GuildFunction uint:Value

# This is the NPC Spawn packet which hasn't changed really changed since its original layout.
NpcSpawn <- ushort:20 ushort:2030 uint:NpcId ushort:XCoord ushort:YCoord ushort:TypeDirection ushort:Interaction

# This is the packet that is sent when a NPC is initialized
NpcInit <- ushort:16 ushort:2031 uint:NpcId uint:Unknown ushort:Mode ushort:TypeDirection

# The Nobility Icon packet displays the correct nobility icon for your rank. Send from Server -> Client.
NobilityIcon <- ushort:Length ushort:2064 uint:Type uint:UniqueId byte:StringCount blstring:NobilityRank

# The Mentor packet, used to populate Mentor information.
MentorInfo <- ushort:Length ushort:2065 byte:Type uint:MentorUid uint:ApprenticeUid byte:Online byte:StringCount blstring:CharacterName

# The Mentor packet, used to perform Mentor actions.
Mentor <- ushort:Length ushort:2066 uint:Type uint:MentorUid uint:ApprenticeUid uint:MentorModel uint:SharedBattlePower uint:EnroleDate byte:MentorLevel byte:MentorClass byte:MentorPkPoints byte:MentorOnline uint:ApprenticeExp ushort:ApprenticeBlessing ushort:ApprenticeComposing byte:StringCount blstring:MentoName blstring:ApprenticeName blstring:SpouseName
and the code produced by the packet grammar compiler:
Code:
using System.Text;

namespace cofreedom.CO {

public interface PacketInterface {
    byte   ReadByte    (int pos);
    ushort ReadUshort  (int pos);
    uint   ReadUint    (int pos);
    ulong  ReadUlong   (int pos);
    string ReadBlstring(int pos);
    string ReadClstring(int len, int pos);
    void WriteByte    (int pos, byte b);
    void WriteUshort  (int pos, ushort s);
    void WriteUint    (int pos, uint i);
    void WriteUlong   (int pos, ulong l);
    void WriteBlstring(int pos, string s);
    void WriteClstring(int len, int pos, string s);
}

public class Packet : PacketInterface {
    private byte[] data;

    public Packet(byte[] data) {
    	this.data = (byte[])data.Clone();
    }

    public byte ReadByte(int pos) {
        return data[pos];
    }

    public ushort ReadUshort(int pos) {
        ushort x;
        unchecked {
        	x = data[pos];
        	x |= (ushort)(data[pos+1] << 8);
        }
        return x;
    }

    public uint ReadUint(int pos) {
        uint x;
        unchecked {
        	x = ReadUshort(pos);
        	x |= (uint)(ReadUshort(pos+2) << 16);
        }
        return x;
    }

    public ulong ReadUlong(int pos) {
        ulong x;
        unchecked {
        	x = ReadUint(pos);
        	x |= (((ulong)ReadUint(pos+4)) << 32);
        }
        return x;
    }

    public string ReadBlstring(int pos) {
        StringBuilder sb = new StringBuilder();
        int l = ReadByte(pos);
        for (int i = 0; i < l; ++i) {
            sb.Append((char)ReadByte(pos+i+1));
        }
        return sb.ToString();
    }

    public string ReadClstring(int len, int pos) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < len && ReadByte(pos+i)!=0; ++i) {
            sb.Append((char)ReadByte(pos+i));
        }
        return sb.ToString();
    }

    public void WriteByte(int pos, byte b) {
        data[pos] = b;
    }

    public void WriteUshort(int pos, ushort s) {
        data[pos] = (byte)(s & 0xFF);
        data[pos+1] = (byte)((s >> 8) & 0xFF);
    }

    public void WriteUint(int pos, uint i) {
        WriteUshort(pos, (ushort)(i & 0xFFFF));
        WriteUshort(pos+2, (ushort)((i >> 16) & 0xFFFF));
    }

    public void WriteUlong(int pos, ulong l) {
        WriteUint(pos, (uint)(l & 0xFFFFFFFF));
        WriteUint(pos+4, (uint)((l >> 32) & 0xFFFFFFFF));
    }

    public void WriteBlstring(int pos, string s) {
        WriteByte(pos, (byte)s.Length);
        for (int i = 0; i < s.Length; ++i) {
        	WriteByte(pos + i + 1, (byte)s[i]);
        }
    }

    public void WriteClstring(int len, int pos, string s) {
        for (int i = 0; i < s.Length && i < len; ++i) {
    		WriteByte(pos + i, (byte)s[i]);
        }
    }
}

public class NewCharacter : PacketInterface {
    public byte   ReadByte    (int pos) { return packet.ReadByte(pos); }
    public ushort ReadUshort  (int pos) { return packet.ReadUshort(pos); }
    public uint   ReadUint    (int pos) { return packet.ReadUint(pos); }
    public ulong  ReadUlong   (int pos) { return packet.ReadUlong(pos); }
    public string ReadBlstring(int pos) { return packet.ReadBlstring(pos); }
    public string ReadClstring(int len, int pos) { return packet.ReadClstring(len, pos); }
    public void WriteByte    (int pos, byte b)   { packet.WriteByte(pos, b); }
    public void WriteUshort  (int pos, ushort s) { packet.WriteUshort(pos, s); }
    public void WriteUint    (int pos, uint i)   { packet.WriteUint(pos, i); }
    public void WriteUlong   (int pos, ulong l)  { packet.WriteUlong(pos, l); }
    public void WriteBlstring(int pos, string s) { packet.WriteBlstring(pos, s); }
    public void WriteClstring(int len, int pos, string s) { packet.WriteClstring(len, pos, s); }
    public string FirstName {
        get { return ReadClstring(16, 4); }
        set { WriteClstring(16, 4, value); }
    }
    public string LastName {
        get { return ReadClstring(16, 20); }
        set { WriteClstring(16, 20, value); }
    }
    public ushort Model {
        get { return ReadUshort(36); }
        set { WriteUshort(36, value); }
    }
    public ushort Class {
        get { return ReadUshort(38); }
        set { WriteUshort(38, value); }
    }
    public uint AccountId {
        get { return ReadUint(40); }
        set { WriteUint(40, value); }
    }
    public string MacAddress {
        get { return ReadClstring(12, 44); }
        set { WriteClstring(12, 44, value); }
    }
    public static bool IsThisType(Packet p) {
        return p.ReadUshort(0) == 120 && p.ReadUshort(2) == 1001;
    }
    private Packet packet;
    public NewCharacter(Packet packet) {
        this.packet = packet;
    }
}

public class Chat : PacketInterface {
    public byte   ReadByte    (int pos) { return packet.ReadByte(pos); }
    public ushort ReadUshort  (int pos) { return packet.ReadUshort(pos); }
    public uint   ReadUint    (int pos) { return packet.ReadUint(pos); }
    public ulong  ReadUlong   (int pos) { return packet.ReadUlong(pos); }
    public string ReadBlstring(int pos) { return packet.ReadBlstring(pos); }
    public string ReadClstring(int len, int pos) { return packet.ReadClstring(len, pos); }
    public void WriteByte    (int pos, byte b)   { packet.WriteByte(pos, b); }
    public void WriteUshort  (int pos, ushort s) { packet.WriteUshort(pos, s); }
    public void WriteUint    (int pos, uint i)   { packet.WriteUint(pos, i); }
    public void WriteUlong   (int pos, ulong l)  { packet.WriteUlong(pos, l); }
    public void WriteBlstring(int pos, string s) { packet.WriteBlstring(pos, s); }
    public void WriteClstring(int len, int pos, string s) { packet.WriteClstring(len, pos, s); }
    public ushort Length {
        get { return ReadUshort(0); }
        set { WriteUshort(0, value); }
    }
    public uint Colour {
        get { return ReadUint(4); }
        set { WriteUint(4, value); }
    }
    public uint Type {
        get { return ReadUint(8); }
        set { WriteUint(8, value); }
    }
    public uint Id {
        get { return ReadUint(12); }
        set { WriteUint(12, value); }
    }
    public uint UnknownA {
        get { return ReadUint(16); }
        set { WriteUint(16, value); }
    }
    public uint UnknownB {
        get { return ReadUint(20); }
        set { WriteUint(20, value); }
    }
    public byte StrCount {
        get { return ReadByte(24); }
        set { WriteByte(24, value); }
    }
    public string From {
        get { return ReadBlstring(25); }
        set { WriteBlstring(25, value); }
    }
    public string To {
        get { return ReadBlstring(25 + ReadByte(25)); }
        set { WriteBlstring(25 + ReadByte(25), value); }
    }
    public string Suffix {
        get { return ReadBlstring(25 + ReadByte(25) + ReadByte(ReadByte(25) + 25)); }
        set { WriteBlstring(25 + ReadByte(25) + ReadByte(ReadByte(25) + 25), value); }
    }
    public string Message {
        get { return ReadBlstring(25 + ReadByte(25) + ReadByte(ReadByte(25) + 25) + ReadByte(ReadByte(25) + ReadByte(ReadByte(25) + 25) + 25)); }
        set { WriteBlstring(25 + ReadByte(25) + ReadByte(ReadByte(25) + 25) + ReadByte(ReadByte(25) + ReadByte(ReadByte(25) + 25) + 25), value); }
    }
    public static bool IsThisType(Packet p) {
        return p.ReadUshort(2) == 1004;
    }
    private Packet packet;
    public Chat(Packet packet) {
        this.packet = packet;
    }
}

public class EntityMovement : PacketInterface {
    public byte   ReadByte    (int pos) { return packet.ReadByte(pos); }
    public ushort ReadUshort  (int pos) { return packet.ReadUshort(pos); }
    public uint   ReadUint    (int pos) { return packet.ReadUint(pos); }
    public ulong  ReadUlong   (int pos) { return packet.ReadUlong(pos); }
    public string ReadBlstring(int pos) { return packet.ReadBlstring(pos); }
    public string ReadClstring(int len, int pos) { return packet.ReadClstring(len, pos); }
    public void WriteByte    (int pos, byte b)   { packet.WriteByte(pos, b); }
    public void WriteUshort  (int pos, ushort s) { packet.WriteUshort(pos, s); }
    public void WriteUint    (int pos, uint i)   { packet.WriteUint(pos, i); }
    public void WriteUlong   (int pos, ulong l)  { packet.WriteUlong(pos, l); }
    public void WriteBlstring(int pos, string s) { packet.WriteBlstring(pos, s); }
    public void WriteClstring(int len, int pos, string s) { packet.WriteClstring(len, pos, s); }
    public uint EntityId {
        get { return ReadUint(4); }
        set { WriteUint(4, value); }
    }
    public byte Direction {
        get { return ReadByte(8); }
        set { WriteByte(8, value); }
    }
    public byte speed {
        get { return ReadByte(9); }
        set { WriteByte(9, value); }
    }
    public uint Timer {
        get { return ReadUint(10); }
        set { WriteUint(10, value); }
    }
    public static bool IsThisType(Packet p) {
        return p.ReadUshort(0) == 16 && p.ReadUshort(2) == 10005;
    }
    private Packet packet;
    public EntityMovement(Packet packet) {
        this.packet = packet;
    }
}

public class CharacterInformation : PacketInterface {
    public byte   ReadByte    (int pos) { return packet.ReadByte(pos); }
    public ushort ReadUshort  (int pos) { return packet.ReadUshort(pos); }
    public uint   ReadUint    (int pos) { return packet.ReadUint(pos); }
    public ulong  ReadUlong   (int pos) { return packet.ReadUlong(pos); }
    public string ReadBlstring(int pos) { return packet.ReadBlstring(pos); }
    public string ReadClstring(int len, int pos) { return packet.ReadClstring(len, pos); }
    public void WriteByte    (int pos, byte b)   { packet.WriteByte(pos, b); }
    public void WriteUshort  (int pos, ushort s) { packet.WriteUshort(pos, s); }
    public void WriteUint    (int pos, uint i)   { packet.WriteUint(pos, i); }
    public void WriteUlong   (int pos, ulong l)  { packet.WriteUlong(pos, l); }
    public void WriteBlstring(int pos, string s) { packet.WriteBlstring(pos, s); }
    public void WriteClstring(int len, int pos, string s) { packet.WriteClstring(len, pos, s); }
    public ushort Length {
        get { return ReadUshort(0); }
        set { WriteUshort(0, value); }
    }
    public uint Id {
        get { return ReadUint(4); }
        set { WriteUint(4, value); }
    }
    public uint Model {
        get { return ReadUint(8); }
        set { WriteUint(8, value); }
    }
    public ushort HairStyle {
        get { return ReadUshort(12); }
        set { WriteUshort(12, value); }
    }
    public uint Gold {
        get { return ReadUint(14); }
        set { WriteUint(14, value); }
    }
    public uint CPoints {
        get { return ReadUint(18); }
        set { WriteUint(18, value); }
    }
    public ulong Experience {
        get { return ReadUlong(22); }
        set { WriteUlong(22, value); }
    }
    public uint Unknown {
        get { return ReadUint(30); }
        set { WriteUint(30, value); }
    }
    public ushort Strength {
        get { return ReadUshort(34); }
        set { WriteUshort(34, value); }
    }
    public ushort Dexterity {
        get { return ReadUshort(36); }
        set { WriteUshort(36, value); }
    }
    public ushort Vitality {
        get { return ReadUshort(38); }
        set { WriteUshort(38, value); }
    }
    public ushort Spirit {
        get { return ReadUshort(40); }
        set { WriteUshort(40, value); }
    }
    public ushort StatPoints {
        get { return ReadUshort(42); }
        set { WriteUshort(42, value); }
    }
    public ushort Hp {
        get { return ReadUshort(44); }
        set { WriteUshort(44, value); }
    }
    public ushort Mp {
        get { return ReadUshort(46); }
        set { WriteUshort(46, value); }
    }
    public ushort PkPoints {
        get { return ReadUshort(48); }
        set { WriteUshort(48, value); }
    }
    public byte Level {
        get { return ReadByte(50); }
        set { WriteByte(50, value); }
    }
    public byte Class {
        get { return ReadByte(51); }
        set { WriteByte(51, value); }
    }
    public byte Reborn {
        get { return ReadByte(52); }
        set { WriteByte(52, value); }
    }
    public byte NameDisplay {
        get { return ReadByte(53); }
        set { WriteByte(53, value); }
    }
    public uint QuizPoints {
        get { return ReadUint(54); }
        set { WriteUint(54, value); }
    }
    public uint Enlighten {
        get { return ReadUint(58); }
        set { WriteUint(58, value); }
    }
    public ushort UnknownA {
        get { return ReadUshort(62); }
        set { WriteUshort(62, value); }
    }
    public uint UnknownB {
        get { return ReadUint(64); }
        set { WriteUint(64, value); }
    }
    public byte StringCount {
        get { return ReadByte(68); }
        set { WriteByte(68, value); }
    }
    public string FirstName {
        get { return ReadBlstring(69); }
        set { WriteBlstring(69, value); }
    }
    public string SecondName {
        get { return ReadBlstring(69 + ReadByte(69)); }
        set { WriteBlstring(69 + ReadByte(69), value); }
    }
    public static bool IsThisType(Packet p) {
        return p.ReadUshort(2) == 1006;
    }
    private Packet packet;
    public CharacterInformation(Packet packet) {
        this.packet = packet;
    }
}

public class ItemInformation : PacketInterface {
    public byte   ReadByte    (int pos) { return packet.ReadByte(pos); }
    public ushort ReadUshort  (int pos) { return packet.ReadUshort(pos); }
    public uint   ReadUint    (int pos) { return packet.ReadUint(pos); }
    public ulong  ReadUlong   (int pos) { return packet.ReadUlong(pos); }
    public string ReadBlstring(int pos) { return packet.ReadBlstring(pos); }
    public string ReadClstring(int len, int pos) { return packet.ReadClstring(len, pos); }
    public void WriteByte    (int pos, byte b)   { packet.WriteByte(pos, b); }
    public void WriteUshort  (int pos, ushort s) { packet.WriteUshort(pos, s); }
    public void WriteUint    (int pos, uint i)   { packet.WriteUint(pos, i); }
    public void WriteUlong   (int pos, ulong l)  { packet.WriteUlong(pos, l); }
    public void WriteBlstring(int pos, string s) { packet.WriteBlstring(pos, s); }
    public void WriteClstring(int len, int pos, string s) { packet.WriteClstring(len, pos, s); }
    public uint UniqueId {
        get { return ReadUint(4); }
        set { WriteUint(4, value); }
    }
    public uint Id {
        get { return ReadUint(8); }
        set { WriteUint(8, value); }
    }
    public ushort Dura {
        get { return ReadUshort(12); }
        set { WriteUshort(12, value); }
    }
    public ushort MaxDura {
        get { return ReadUshort(14); }
        set { WriteUshort(14, value); }
    }
    public ushort CreationType {
        get { return ReadUshort(16); }
        set { WriteUshort(16, value); }
    }
    public byte Location {
        get { return ReadByte(18); }
        set { WriteByte(18, value); }
    }
    public ushort SpecialType {
        get { return ReadUshort(19); }
        set { WriteUshort(19, value); }
    }
    public byte FirstSocket {
        get { return ReadByte(21); }
        set { WriteByte(21, value); }
    }
    public byte SecondSocket {
        get { return ReadByte(22); }
        set { WriteByte(22, value); }
    }
    public byte Plus {
        get { return ReadByte(23); }
        set { WriteByte(23, value); }
    }
    public byte Bless {
        get { return ReadByte(24); }
        set { WriteByte(24, value); }
    }
    public byte Free {
        get { return ReadByte(25); }
        set { WriteByte(25, value); }
    }
    public byte Enchant {
        get { return ReadByte(26); }
        set { WriteByte(26, value); }
    }
    public byte Locked {
        get { return ReadByte(27); }
        set { WriteByte(27, value); }
    }
    public byte Colour {
        get { return ReadByte(28); }
        set { WriteByte(28, value); }
    }
    public byte CompositionProgress {
        get { return ReadByte(29); }
        set { WriteByte(29, value); }
    }
    public static bool IsThisType(Packet p) {
        return p.ReadUshort(0) == 48 && p.ReadUshort(2) == 1008;
    }
    private Packet packet;
    public ItemInformation(Packet packet) {
        this.packet = packet;
    }
}

public class ItemUsage : PacketInterface {
    public byte   ReadByte    (int pos) { return packet.ReadByte(pos); }
    public ushort ReadUshort  (int pos) { return packet.ReadUshort(pos); }
    public uint   ReadUint    (int pos) { return packet.ReadUint(pos); }
    public ulong  ReadUlong   (int pos) { return packet.ReadUlong(pos); }
    public string ReadBlstring(int pos) { return packet.ReadBlstring(pos); }
    public string ReadClstring(int len, int pos) { return packet.ReadClstring(len, pos); }
    public void WriteByte    (int pos, byte b)   { packet.WriteByte(pos, b); }
    public void WriteUshort  (int pos, ushort s) { packet.WriteUshort(pos, s); }
    public void WriteUint    (int pos, uint i)   { packet.WriteUint(pos, i); }
    public void WriteUlong   (int pos, ulong l)  { packet.WriteUlong(pos, l); }
    public void WriteBlstring(int pos, string s) { packet.WriteBlstring(pos, s); }
    public void WriteClstring(int len, int pos, string s) { packet.WriteClstring(len, pos, s); }
    public uint ItemId {
        get { return ReadUint(4); }
        set { WriteUint(4, value); }
    }
    public uint ItemLocation {
        get { return ReadUint(8); }
        set { WriteUint(8, value); }
    }
    public uint UsageType {
        get { return ReadUint(12); }
        set { WriteUint(12, value); }
    }
    public uint Timer {
        get { return ReadUint(16); }
        set { WriteUint(16, value); }
    }
    public static bool IsThisType(Packet p) {
        return p.ReadUshort(0) == 28 && p.ReadUshort(2) == 1009;
    }
    private Packet packet;
    public ItemUsage(Packet packet) {
        this.packet = packet;
    }
}

public class GeneralData : PacketInterface {
    public byte   ReadByte    (int pos) { return packet.ReadByte(pos); }
    public ushort ReadUshort  (int pos) { return packet.ReadUshort(pos); }
    public uint   ReadUint    (int pos) { return packet.ReadUint(pos); }
    public ulong  ReadUlong   (int pos) { return packet.ReadUlong(pos); }
    public string ReadBlstring(int pos) { return packet.ReadBlstring(pos); }
    public string ReadClstring(int len, int pos) { return packet.ReadClstring(len, pos); }
    public void WriteByte    (int pos, byte b)   { packet.WriteByte(pos, b); }
    public void WriteUshort  (int pos, ushort s) { packet.WriteUshort(pos, s); }
    public void WriteUint    (int pos, uint i)   { packet.WriteUint(pos, i); }
    public void WriteUlong   (int pos, ulong l)  { packet.WriteUlong(pos, l); }
    public void WriteBlstring(int pos, string s) { packet.WriteBlstring(pos, s); }
    public void WriteClstring(int len, int pos, string s) { packet.WriteClstring(len, pos, s); }
    public uint EntityId {
        get { return ReadUint(4); }
        set { WriteUint(4, value); }
    }
    public uint ValueA {
        get { return ReadUint(8); }
        set { WriteUint(8, value); }
    }
    public ushort ValueB {
        get { return ReadUshort(12); }
        set { WriteUshort(12, value); }
    }
    public ushort ValueC {
        get { return ReadUshort(14); }
        set { WriteUshort(14, value); }
    }
    public uint Timer {
        get { return ReadUint(16); }
        set { WriteUint(16, value); }
    }
    public uint DataType {
        get { return ReadUint(20); }
        set { WriteUint(20, value); }
    }
    public static bool IsThisType(Packet p) {
        return p.ReadUshort(0) == 37 && p.ReadUshort(2) == 10010;
    }
    private Packet packet;
    public GeneralData(Packet packet) {
        this.packet = packet;
    }
}

public class EntitySpawn : PacketInterface {
    public byte   ReadByte    (int pos) { return packet.ReadByte(pos); }
    public ushort ReadUshort  (int pos) { return packet.ReadUshort(pos); }
    public uint   ReadUint    (int pos) { return packet.ReadUint(pos); }
    public ulong  ReadUlong   (int pos) { return packet.ReadUlong(pos); }
    public string ReadBlstring(int pos) { return packet.ReadBlstring(pos); }
    public string ReadClstring(int len, int pos) { return packet.ReadClstring(len, pos); }
    public void WriteByte    (int pos, byte b)   { packet.WriteByte(pos, b); }
    public void WriteUshort  (int pos, ushort s) { packet.WriteUshort(pos, s); }
    public void WriteUint    (int pos, uint i)   { packet.WriteUint(pos, i); }
    public void WriteUlong   (int pos, ulong l)  { packet.WriteUlong(pos, l); }
    public void WriteBlstring(int pos, string s) { packet.WriteBlstring(pos, s); }
    public void WriteClstring(int len, int pos, string s) { packet.WriteClstring(len, pos, s); }
    public ushort Length {
        get { return ReadUshort(0); }
        set { WriteUshort(0, value); }
    }
    public uint Id {
        get { return ReadUint(4); }
        set { WriteUint(4, value); }
    }
    public uint ModelId {
        get { return ReadUint(8); }
        set { WriteUint(8, value); }
    }
    public uint Status {
        get { return ReadUint(12); }
        set { WriteUint(12, value); }
    }
    public ushort GuildId {
        get { return ReadUshort(16); }
        set { WriteUshort(16, value); }
    }
    public uint HelmId {
        get { return ReadUint(18); }
        set { WriteUint(18, value); }
    }
    public uint ArmorId {
        get { return ReadUint(22); }
        set { WriteUint(22, value); }
    }
    public uint RightHandId {
        get { return ReadUint(26); }
        set { WriteUint(26, value); }
    }
    public uint LeftHandId {
        get { return ReadUint(30); }
        set { WriteUint(30, value); }
    }
    public ushort XCoord {
        get { return ReadUshort(34); }
        set { WriteUshort(34, value); }
    }
    public ushort YCoord {
        get { return ReadUshort(36); }
        set { WriteUshort(36, value); }
    }
    public ushort HairStyle {
        get { return ReadUshort(38); }
        set { WriteUshort(38, value); }
    }
    public byte Direction {
        get { return ReadByte(40); }
        set { WriteByte(40, value); }
    }
    public byte Action {
        get { return ReadByte(41); }
        set { WriteByte(41, value); }
    }
    public byte ShowNames {
        get { return ReadByte(42); }
        set { WriteByte(42, value); }
    }
    public string Name {
        get { return ReadBlstring(43); }
        set { WriteBlstring(43, value); }
    }
    public static bool IsThisType(Packet p) {
        return p.ReadUshort(2) == 1014;
    }
    private Packet packet;
    public EntitySpawn(Packet packet) {
        this.packet = packet;
    }
}

public class Weather : PacketInterface {
    public byte   ReadByte    (int pos) { return packet.ReadByte(pos); }
    public ushort ReadUshort  (int pos) { return packet.ReadUshort(pos); }
    public uint   ReadUint    (int pos) { return packet.ReadUint(pos); }
    public ulong  ReadUlong   (int pos) { return packet.ReadUlong(pos); }
    public string ReadBlstring(int pos) { return packet.ReadBlstring(pos); }
    public string ReadClstring(int len, int pos) { return packet.ReadClstring(len, pos); }
    public void WriteByte    (int pos, byte b)   { packet.WriteByte(pos, b); }
    public void WriteUshort  (int pos, ushort s) { packet.WriteUshort(pos, s); }
    public void WriteUint    (int pos, uint i)   { packet.WriteUint(pos, i); }
    public void WriteUlong   (int pos, ulong l)  { packet.WriteUlong(pos, l); }
    public void WriteBlstring(int pos, string s) { packet.WriteBlstring(pos, s); }
    public void WriteClstring(int len, int pos, string s) { packet.WriteClstring(len, pos, s); }
    public byte Type {
        get { return ReadByte(4); }
        set { WriteByte(4, value); }
    }
    public uint Intensity {
        get { return ReadUint(5); }
        set { WriteUint(5, value); }
    }
    public uint Direction {
        get { return ReadUint(9); }
        set { WriteUint(9, value); }
    }
    public uint Appearance {
        get { return ReadUint(13); }
        set { WriteUint(13, value); }
    }
    public static bool IsThisType(Packet p) {
        return p.ReadUshort(0) == 20 && p.ReadUshort(2) == 1016;
    }
    private Packet packet;
    public Weather(Packet packet) {
        this.packet = packet;
    }
}

public class EntityStatus : PacketInterface {
    public byte   ReadByte    (int pos) { return packet.ReadByte(pos); }
    public ushort ReadUshort  (int pos) { return packet.ReadUshort(pos); }
    public uint   ReadUint    (int pos) { return packet.ReadUint(pos); }
    public ulong  ReadUlong   (int pos) { return packet.ReadUlong(pos); }
    public string ReadBlstring(int pos) { return packet.ReadBlstring(pos); }
    public string ReadClstring(int len, int pos) { return packet.ReadClstring(len, pos); }
    public void WriteByte    (int pos, byte b)   { packet.WriteByte(pos, b); }
    public void WriteUshort  (int pos, ushort s) { packet.WriteUshort(pos, s); }
    public void WriteUint    (int pos, uint i)   { packet.WriteUint(pos, i); }
    public void WriteUlong   (int pos, ulong l)  { packet.WriteUlong(pos, l); }
    public void WriteBlstring(int pos, string s) { packet.WriteBlstring(pos, s); }
    public void WriteClstring(int len, int pos, string s) { packet.WriteClstring(len, pos, s); }
    public ushort Length {
        get { return ReadUshort(0); }
        set { WriteUshort(0, value); }
    }
    public uint EntityId {
        get { return ReadUint(4); }
        set { WriteUint(4, value); }
    }
    struct foo0 {
        const int ElementSize = 12;
        public uint Count {
            get { return parent.ReadUint(8); }
        }
        public struct foo0foo {
            PacketInterface parent;
            int index;
            public foo0foo(PacketInterface parent, int index) {
                this.parent = parent;
                this.index = index;
            }
            const int Size = 12;
            public uint Type {
                get { return parent.ReadUint(12 + index * Size); }
                set { parent.WriteUint(12 + index * Size, value); }
            }
            public ulong Value {
                get { return parent.ReadUlong(16 + index * Size); }
                set { parent.WriteUlong(16 + index * Size, value); }
            }
        }
        PacketInterface parent;
        public foo0(PacketInterface parent) {
            this.parent = parent;
        }
        public foo0foo this[int i] {
            get { return new foo0foo(parent, i); }
        }
    }
    foo0 Status;
    public static bool IsThisType(Packet p) {
        return p.ReadUshort(2) == 10017;
    }
    private Packet packet;
    public EntityStatus(Packet packet) {
        this.packet = packet;
        Status = new foo0(this);
    }
}

public class Friend : PacketInterface {
    public byte   ReadByte    (int pos) { return packet.ReadByte(pos); }
    public ushort ReadUshort  (int pos) { return packet.ReadUshort(pos); }
    public uint   ReadUint    (int pos) { return packet.ReadUint(pos); }
    public ulong  ReadUlong   (int pos) { return packet.ReadUlong(pos); }
    public string ReadBlstring(int pos) { return packet.ReadBlstring(pos); }
    public string ReadClstring(int len, int pos) { return packet.ReadClstring(len, pos); }
    public void WriteByte    (int pos, byte b)   { packet.WriteByte(pos, b); }
    public void WriteUshort  (int pos, ushort s) { packet.WriteUshort(pos, s); }
    public void WriteUint    (int pos, uint i)   { packet.WriteUint(pos, i); }
    public void WriteUlong   (int pos, ulong l)  { packet.WriteUlong(pos, l); }
    public void WriteBlstring(int pos, string s) { packet.WriteBlstring(pos, s); }
    public void WriteClstring(int len, int pos, string s) { packet.WriteClstring(len, pos, s); }
    public ushort Length {
        get { return ReadUshort(0); }
        set { WriteUshort(0, value); }
    }
    public uint Id {
        get { return ReadUint(4); }
        set { WriteUint(4, value); }
    }
    public byte option {
        get { return ReadByte(8); }
        set { WriteByte(8, value); }
    }
    public byte Online {
        get { return ReadByte(9); }
        set { WriteByte(9, value); }
    }
    public string Name {
        get { return ReadBlstring(10); }
        set { WriteBlstring(10, value); }
    }
    public static bool IsThisType(Packet p) {
        return p.ReadUshort(2) == 1019;
    }
    private Packet packet;
    public Friend(Packet packet) {
        this.packet = packet;
    }
}

public class Action : PacketInterface {
    public byte   ReadByte    (int pos) { return packet.ReadByte(pos); }
    public ushort ReadUshort  (int pos) { return packet.ReadUshort(pos); }
    public uint   ReadUint    (int pos) { return packet.ReadUint(pos); }
    public ulong  ReadUlong   (int pos) { return packet.ReadUlong(pos); }
    public string ReadBlstring(int pos) { return packet.ReadBlstring(pos); }
    public string ReadClstring(int len, int pos) { return packet.ReadClstring(len, pos); }
    public void WriteByte    (int pos, byte b)   { packet.WriteByte(pos, b); }
    public void WriteUshort  (int pos, ushort s) { packet.WriteUshort(pos, s); }
    public void WriteUint    (int pos, uint i)   { packet.WriteUint(pos, i); }
    public void WriteUlong   (int pos, ulong l)  { packet.WriteUlong(pos, l); }
    public void WriteBlstring(int pos, string s) { packet.WriteBlstring(pos, s); }
    public void WriteClstring(int len, int pos, string s) { packet.WriteClstring(len, pos, s); }
    public uint Timer {
        get { return ReadUint(4); }
        set { WriteUint(4, value); }
    }
    public uint CharId {
        get { return ReadUint(8); }
        set { WriteUint(8, value); }
    }
    public uint TargetId {
        get { return ReadUint(12); }
        set { WriteUint(12, value); }
    }
    public ushort CoordX {
        get { return ReadUshort(16); }
        set { WriteUshort(16, value); }
    }
    public ushort CoordY {
        get { return ReadUshort(18); }
        set { WriteUshort(18, value); }
    }
    public uint ActionType {
        get { return ReadUint(20); }
        set { WriteUint(20, value); }
    }
    public uint ActionValue {
        get { return ReadUint(24); }
        set { WriteUint(24, value); }
    }
    public static bool IsThisType(Packet p) {
        return p.ReadUshort(0) == 28 && p.ReadUshort(2) == 1022;
    }
    private Packet packet;
    public Action(Packet packet) {
        this.packet = packet;
    }
}

public class TeamAction : PacketInterface {
    public byte   ReadByte    (int pos) { return packet.ReadByte(pos); }
    public ushort ReadUshort  (int pos) { return packet.ReadUshort(pos); }
    public uint   ReadUint    (int pos) { return packet.ReadUint(pos); }
    public ulong  ReadUlong   (int pos) { return packet.ReadUlong(pos); }
    public string ReadBlstring(int pos) { return packet.ReadBlstring(pos); }
    public string ReadClstring(int len, int pos) { return packet.ReadClstring(len, pos); }
    public void WriteByte    (int pos, byte b)   { packet.WriteByte(pos, b); }
    public void WriteUshort  (int pos, ushort s) { packet.WriteUshort(pos, s); }
    public void WriteUint    (int pos, uint i)   { packet.WriteUint(pos, i); }
    public void WriteUlong   (int pos, ulong l)  { packet.WriteUlong(pos, l); }
    public void WriteBlstring(int pos, string s) { packet.WriteBlstring(pos, s); }
    public void WriteClstring(int len, int pos, string s) { packet.WriteClstring(len, pos, s); }
    public uint TeamOption {
        get { return ReadUint(4); }
        set { WriteUint(4, value); }
    }
    public uint Id {
        get { return ReadUint(8); }
        set { WriteUint(8, value); }
    }
    public static bool IsThisType(Packet p) {
        return p.ReadUshort(0) == 12 && p.ReadUshort(2) == 1023;
    }
    private Packet packet;
    public TeamAction(Packet packet) {
        this.packet = packet;
    }
}

public class StatusPoint : PacketInterface {
    public byte   ReadByte    (int pos) { return packet.ReadByte(pos); }
    public ushort ReadUshort  (int pos) { return packet.ReadUshort(pos); }
    public uint   ReadUint    (int pos) { return packet.ReadUint(pos); }
    public ulong  ReadUlong   (int pos) { return packet.ReadUlong(pos); }
    public string ReadBlstring(int pos) { return packet.ReadBlstring(pos); }
    public string ReadClstring(int len, int pos) { return packet.ReadClstring(len, pos); }
    public void WriteByte    (int pos, byte b)   { packet.WriteByte(pos, b); }
    public void WriteUshort  (int pos, ushort s) { packet.WriteUshort(pos, s); }
    public void WriteUint    (int pos, uint i)   { packet.WriteUint(pos, i); }
    public void WriteUlong   (int pos, ulong l)  { packet.WriteUlong(pos, l); }
    public void WriteBlstring(int pos, string s) { packet.WriteBlstring(pos, s); }
    public void WriteClstring(int len, int pos, string s) { packet.WriteClstring(len, pos, s); }
    public byte Strength {
        get { return ReadByte(4); }
        set { WriteByte(4, value); }
    }
    public byte Dexterity {
        get { return ReadByte(5); }
        set { WriteByte(5, value); }
    }
    public byte Vitiality {
        get { return ReadByte(6); }
        set { WriteByte(6, value); }
    }
    public byte Spirit {
        get { return ReadByte(7); }
        set { WriteByte(7, value); }
    }
    public static bool IsThisType(Packet p) {
        return p.ReadUshort(0) == 8 && p.ReadUshort(2) == 1024;
    }
    private Packet packet;
    public StatusPoint(Packet packet) {
        this.packet = packet;
    }
}

public class WeaponProficiency : PacketInterface {
    public byte   ReadByte    (int pos) { return packet.ReadByte(pos); }
    public ushort ReadUshort  (int pos) { return packet.ReadUshort(pos); }
    public uint   ReadUint    (int pos) { return packet.ReadUint(pos); }
    public ulong  ReadUlong   (int pos) { return packet.ReadUlong(pos); }
    public string ReadBlstring(int pos) { return packet.ReadBlstring(pos); }
    public string ReadClstring(int len, int pos) { return packet.ReadClstring(len, pos); }
    public void WriteByte    (int pos, byte b)   { packet.WriteByte(pos, b); }
    public void WriteUshort  (int pos, ushort s) { packet.WriteUshort(pos, s); }
    public void WriteUint    (int pos, uint i)   { packet.WriteUint(pos, i); }
    public void WriteUlong   (int pos, ulong l)  { packet.WriteUlong(pos, l); }
    public void WriteBlstring(int pos, string s) { packet.WriteBlstring(pos, s); }
    public void WriteClstring(int len, int pos, string s) { packet.WriteClstring(len, pos, s); }
    public uint SkillId {
        get { return ReadUint(4); }
        set { WriteUint(4, value); }
    }
    public uint SkillLevel {
        get { return ReadUint(8); }
        set { WriteUint(8, value); }
    }
    public uint SkillExperience {
        get { return ReadUint(12); }
        set { WriteUint(12, value); }
    }
    public static bool IsThisType(Packet p) {
        return p.ReadUshort(0) == 16 && p.ReadUshort(2) == 1025;
    }
    private Packet packet;
    public WeaponProficiency(Packet packet) {
        this.packet = packet;
    }
}

public class TeamMember : PacketInterface {
    public byte   ReadByte    (int pos) { return packet.ReadByte(pos); }
    public ushort ReadUshort  (int pos) { return packet.ReadUshort(pos); }
    public uint   ReadUint    (int pos) { return packet.ReadUint(pos); }
    public ulong  ReadUlong   (int pos) { return packet.ReadUlong(pos); }
    public string ReadBlstring(int pos) { return packet.ReadBlstring(pos); }
    public string ReadClstring(int len, int pos) { return packet.ReadClstring(len, pos); }
    public void WriteByte    (int pos, byte b)   { packet.WriteByte(pos, b); }
    public void WriteUshort  (int pos, ushort s) { packet.WriteUshort(pos, s); }
    public void WriteUint    (int pos, uint i)   { packet.WriteUint(pos, i); }
    public void WriteUlong   (int pos, ulong l)  { packet.WriteUlong(pos, l); }
    public void WriteBlstring(int pos, string s) { packet.WriteBlstring(pos, s); }
    public void WriteClstring(int len, int pos, string s) { packet.WriteClstring(len, pos, s); }
    public uint TeamFlags {
        get { return ReadUint(4); }
        set { WriteUint(4, value); }
    }
    public string CharName {
        get { return ReadClstring(16, 8); }
        set { WriteClstring(16, 8, value); }
    }
    public uint CharId {
        get { return ReadUint(24); }
        set { WriteUint(24, value); }
    }
    public uint CharAvatar {
        get { return ReadUint(28); }
        set { WriteUint(28, value); }
    }
    public ushort CharHp {
        get { return ReadUshort(32); }
        set { WriteUshort(32, value); }
    }
    public ushort CharMaxHp {
        get { return ReadUshort(34); }
        set { WriteUshort(34, value); }
    }
    public static bool IsThisType(Packet p) {
        return p.ReadUshort(0) == 36 && p.ReadUshort(2) == 1026;
    }
    private Packet packet;
    public TeamMember(Packet packet) {
        this.packet = packet;
    }
}

public class Gem : PacketInterface {
    public byte   ReadByte    (int pos) { return packet.ReadByte(pos); }
    public ushort ReadUshort  (int pos) { return packet.ReadUshort(pos); }
    public uint   ReadUint    (int pos) { return packet.ReadUint(pos); }
    public ulong  ReadUlong   (int pos) { return packet.ReadUlong(pos); }
    public string ReadBlstring(int pos) { return packet.ReadBlstring(pos); }
    public string ReadClstring(int len, int pos) { return packet.ReadClstring(len, pos); }
    public void WriteByte    (int pos, byte b)   { packet.WriteByte(pos, b); }
    public void WriteUshort  (int pos, ushort s) { packet.WriteUshort(pos, s); }
    public void WriteUint    (int pos, uint i)   { packet.WriteUint(pos, i); }
    public void WriteUlong   (int pos, ulong l)  { packet.WriteUlong(pos, l); }
    public void WriteBlstring(int pos, string s) { packet.WriteBlstring(pos, s); }
    public void WriteClstring(int len, int pos, string s) { packet.WriteClstring(len, pos, s); }
    public uint MainItemUid {
        get { return ReadUint(4); }
        set { WriteUint(4, value); }
    }
    public uint GemItemUid {
        get { return ReadUint(8); }
        set { WriteUint(8, value); }
    }
    public byte Socket {
        get { return ReadByte(12); }
        set { WriteByte(12, value); }
    }
    public byte SocketType {
        get { return ReadByte(13); }
        set { WriteByte(13, value); }
    }
    public static bool IsThisType(Packet p) {
        return p.ReadUshort(0) == 20 && p.ReadUshort(2) == 1027;
    }
    private Packet packet;
    public Gem(Packet packet) {
        this.packet = packet;
    }
}

public class Date : PacketInterface {
    public byte   ReadByte    (int pos) { return packet.ReadByte(pos); }
    public ushort ReadUshort  (int pos) { return packet.ReadUshort(pos); }
    public uint   ReadUint    (int pos) { return packet.ReadUint(pos); }
    public ulong  ReadUlong   (int pos) { return packet.ReadUlong(pos); }
    public string ReadBlstring(int pos) { return packet.ReadBlstring(pos); }
    public string ReadClstring(int len, int pos) { return packet.ReadClstring(len, pos); }
    public void WriteByte    (int pos, byte b)   { packet.WriteByte(pos, b); }
    public void WriteUshort  (int pos, ushort s) { packet.WriteUshort(pos, s); }
    public void WriteUint    (int pos, uint i)   { packet.WriteUint(pos, i); }
    public void WriteUlong   (int pos, ulong l)  { packet.WriteUlong(pos, l); }
    public void WriteBlstring(int pos, string s) { packet.WriteBlstring(pos, s); }
    public void WriteClstring(int len, int pos, string s) { packet.WriteClstring(len, pos, s); }
    public uint Year {
        get { return ReadUint(4); }
        set { WriteUint(4, value); }
    }
    public uint Month {
        get { return ReadUint(8); }
        set { WriteUint(8, value); }
    }
    public uint DayOfYear {
        get { return ReadUint(12); }
        set { WriteUint(12, value); }
    }
    public uint DayOfWeek {
        get { return ReadUint(16); }
        set { WriteUint(16, value); }
    }
    public uint Hour {
        get { return ReadUint(20); }
        set { WriteUint(20, value); }
    }
    public uint Minute {
        get { return ReadUint(24); }
        set { WriteUint(24, value); }
    }
    public uint Second {
        get { return ReadUint(28); }
        set { WriteUint(28, value); }
    }
    public static bool IsThisType(Packet p) {
        return p.ReadUshort(0) == 36 && p.ReadUshort(2) == 1033;
    }
    private Packet packet;
    public Date(Packet packet) {
        this.packet = packet;
    }
}

public class AuthMessage : PacketInterface {
    public byte   ReadByte    (int pos) { return packet.ReadByte(pos); }
    public ushort ReadUshort  (int pos) { return packet.ReadUshort(pos); }
    public uint   ReadUint    (int pos) { return packet.ReadUint(pos); }
    public ulong  ReadUlong   (int pos) { return packet.ReadUlong(pos); }
    public string ReadBlstring(int pos) { return packet.ReadBlstring(pos); }
    public string ReadClstring(int len, int pos) { return packet.ReadClstring(len, pos); }
    public void WriteByte    (int pos, byte b)   { packet.WriteByte(pos, b); }
    public void WriteUshort  (int pos, ushort s) { packet.WriteUshort(pos, s); }
    public void WriteUint    (int pos, uint i)   { packet.WriteUint(pos, i); }
    public void WriteUlong   (int pos, ulong l)  { packet.WriteUlong(pos, l); }
    public void WriteBlstring(int pos, string s) { packet.WriteBlstring(pos, s); }
    public void WriteClstring(int len, int pos, string s) { packet.WriteClstring(len, pos, s); }
    public uint AccountId {
        get { return ReadUint(4); }
        set { WriteUint(4, value); }
    }
    public uint LoginToken {
        get { return ReadUint(8); }
        set { WriteUint(8, value); }
    }
    public string Message {
        get { return ReadClstring(16, 12); }
        set { WriteClstring(16, 12, value); }
    }
    public static bool IsThisType(Packet p) {
        return p.ReadUshort(0) == 28 && p.ReadUshort(2) == 1052;
    }
    private Packet packet;
    public AuthMessage(Packet packet) {
        this.packet = packet;
    }
}

public class AuthResponce : PacketInterface {
    public byte   ReadByte    (int pos) { return packet.ReadByte(pos); }
    public ushort ReadUshort  (int pos) { return packet.ReadUshort(pos); }
    public uint   ReadUint    (int pos) { return packet.ReadUint(pos); }
    public ulong  ReadUlong   (int pos) { return packet.ReadUlong(pos); }
    public string ReadBlstring(int pos) { return packet.ReadBlstring(pos); }
    public string ReadClstring(int len, int pos) { return packet.ReadClstring(len, pos); }
    public void WriteByte    (int pos, byte b)   { packet.WriteByte(pos, b); }
    public void WriteUshort  (int pos, ushort s) { packet.WriteUshort(pos, s); }
    public void WriteUint    (int pos, uint i)   { packet.WriteUint(pos, i); }
    public void WriteUlong   (int pos, ulong l)  { packet.WriteUlong(pos, l); }
    public void WriteBlstring(int pos, string s) { packet.WriteBlstring(pos, s); }
    public void WriteClstring(int len, int pos, string s) { packet.WriteClstring(len, pos, s); }
    public uint AccountId {
        get { return ReadUint(4); }
        set { WriteUint(4, value); }
    }
    public uint LoginToken {
        get { return ReadUint(8); }
        set { WriteUint(8, value); }
    }
    public string GameServerIp {
        get { return ReadClstring(16, 12); }
        set { WriteClstring(16, 12, value); }
    }
    public static bool IsThisType(Packet p) {
        return p.ReadUshort(0) == 32 && p.ReadUshort(2) == 1055;
    }
    private Packet packet;
    public AuthResponce(Packet packet) {
        this.packet = packet;
    }
}

public class Trade : PacketInterface {
    public byte   ReadByte    (int pos) { return packet.ReadByte(pos); }
    public ushort ReadUshort  (int pos) { return packet.ReadUshort(pos); }
    public uint   ReadUint    (int pos) { return packet.ReadUint(pos); }
    public ulong  ReadUlong   (int pos) { return packet.ReadUlong(pos); }
    public string ReadBlstring(int pos) { return packet.ReadBlstring(pos); }
    public string ReadClstring(int len, int pos) { return packet.ReadClstring(len, pos); }
    public void WriteByte    (int pos, byte b)   { packet.WriteByte(pos, b); }
    public void WriteUshort  (int pos, ushort s) { packet.WriteUshort(pos, s); }
    public void WriteUint    (int pos, uint i)   { packet.WriteUint(pos, i); }
    public void WriteUlong   (int pos, ulong l)  { packet.WriteUlong(pos, l); }
    public void WriteBlstring(int pos, string s) { packet.WriteBlstring(pos, s); }
    public void WriteClstring(int len, int pos, string s) { packet.WriteClstring(len, pos, s); }
    public uint UniqueId {
        get { return ReadUint(4); }
        set { WriteUint(4, value); }
    }
    public uint TradeType {
        get { return ReadUint(8); }
        set { WriteUint(8, value); }
    }
    public static bool IsThisType(Packet p) {
        return p.ReadUshort(0) == 12 && p.ReadUshort(2) == 1056;
    }
    private Packet packet;
    public Trade(Packet packet) {
        this.packet = packet;
    }
}

public class DropItem : PacketInterface {
    public byte   ReadByte    (int pos) { return packet.ReadByte(pos); }
    public ushort ReadUshort  (int pos) { return packet.ReadUshort(pos); }
    public uint   ReadUint    (int pos) { return packet.ReadUint(pos); }
    public ulong  ReadUlong   (int pos) { return packet.ReadUlong(pos); }
    public string ReadBlstring(int pos) { return packet.ReadBlstring(pos); }
    public string ReadClstring(int len, int pos) { return packet.ReadClstring(len, pos); }
    public void WriteByte    (int pos, byte b)   { packet.WriteByte(pos, b); }
    public void WriteUshort  (int pos, ushort s) { packet.WriteUshort(pos, s); }
    public void WriteUint    (int pos, uint i)   { packet.WriteUint(pos, i); }
    public void WriteUlong   (int pos, ulong l)  { packet.WriteUlong(pos, l); }
    public void WriteBlstring(int pos, string s) { packet.WriteBlstring(pos, s); }
    public void WriteClstring(int len, int pos, string s) { packet.WriteClstring(len, pos, s); }
    public uint ItemUid {
        get { return ReadUint(4); }
        set { WriteUint(4, value); }
    }
    public uint ItemId {
        get { return ReadUint(8); }
        set { WriteUint(8, value); }
    }
    public ushort XCoord {
        get { return ReadUshort(12); }
        set { WriteUshort(12, value); }
    }
    public ushort YCoord {
        get { return ReadUshort(14); }
        set { WriteUshort(14, value); }
    }
    public uint LootType {
        get { return ReadUint(16); }
        set { WriteUint(16, value); }
    }
    public static bool IsThisType(Packet p) {
        return p.ReadUshort(0) == 20 && p.ReadUshort(2) == 1101;
    }
    private Packet packet;
    public DropItem(Packet packet) {
        this.packet = packet;
    }
}

public class Warehouse : PacketInterface {
    public byte   ReadByte    (int pos) { return packet.ReadByte(pos); }
    public ushort ReadUshort  (int pos) { return packet.ReadUshort(pos); }
    public uint   ReadUint    (int pos) { return packet.ReadUint(pos); }
    public ulong  ReadUlong   (int pos) { return packet.ReadUlong(pos); }
    public string ReadBlstring(int pos) { return packet.ReadBlstring(pos); }
    public string ReadClstring(int len, int pos) { return packet.ReadClstring(len, pos); }
    public void WriteByte    (int pos, byte b)   { packet.WriteByte(pos, b); }
    public void WriteUshort  (int pos, ushort s) { packet.WriteUshort(pos, s); }
    public void WriteUint    (int pos, uint i)   { packet.WriteUint(pos, i); }
    public void WriteUlong   (int pos, ulong l)  { packet.WriteUlong(pos, l); }
    public void WriteBlstring(int pos, string s) { packet.WriteBlstring(pos, s); }
    public void WriteClstring(int len, int pos, string s) { packet.WriteClstring(len, pos, s); }
    public ushort Length {
        get { return ReadUshort(0); }
        set { WriteUshort(0, value); }
    }
    public uint WarehouseId {
        get { return ReadUint(4); }
        set { WriteUint(4, value); }
    }
    struct foo0 {
        const int ElementSize = 14;
        public uint Count {
            get { return parent.ReadUint(8); }
        }
        public struct foo0foo {
            PacketInterface parent;
            int index;
            public foo0foo(PacketInterface parent, int index) {
                this.parent = parent;
                this.index = index;
            }
            const int Size = 14;
            public uint ItemUid {
                get { return parent.ReadUint(12 + index * Size); }
                set { parent.WriteUint(12 + index * Size, value); }
            }
            public uint ItemId {
                get { return parent.ReadUint(16 + index * Size); }
                set { parent.WriteUint(16 + index * Size, value); }
            }
            public byte ItemFirstSocket {
                get { return parent.ReadByte(20 + index * Size); }
                set { parent.WriteByte(20 + index * Size, value); }
            }
            public byte ItemSecondSocket {
                get { return parent.ReadByte(21 + index * Size); }
                set { parent.WriteByte(21 + index * Size, value); }
            }
            public byte ItemPlus {
                get { return parent.ReadByte(22 + index * Size); }
                set { parent.WriteByte(22 + index * Size, value); }
            }
            public byte ItemMinus {
                get { return parent.ReadByte(23 + index * Size); }
                set { parent.WriteByte(23 + index * Size, value); }
            }
            public ushort ItemEnchant {
                get { return parent.ReadUshort(24 + index * Size); }
                set { parent.WriteUshort(24 + index * Size, value); }
            }
        }
        PacketInterface parent;
        public foo0(PacketInterface parent) {
            this.parent = parent;
        }
        public foo0foo this[int i] {
            get { return new foo0foo(parent, i); }
        }
    }
    foo0 Items;
    public static bool IsThisType(Packet p) {
        return p.ReadUshort(2) == 1102;
    }
    private Packet packet;
    public Warehouse(Packet packet) {
        this.packet = packet;
        Items = new foo0(this);
    }
}

public class Skill : PacketInterface {
    public byte   ReadByte    (int pos) { return packet.ReadByte(pos); }
    public ushort ReadUshort  (int pos) { return packet.ReadUshort(pos); }
    public uint   ReadUint    (int pos) { return packet.ReadUint(pos); }
    public ulong  ReadUlong   (int pos) { return packet.ReadUlong(pos); }
    public string ReadBlstring(int pos) { return packet.ReadBlstring(pos); }
    public string ReadClstring(int len, int pos) { return packet.ReadClstring(len, pos); }
    public void WriteByte    (int pos, byte b)   { packet.WriteByte(pos, b); }
    public void WriteUshort  (int pos, ushort s) { packet.WriteUshort(pos, s); }
    public void WriteUint    (int pos, uint i)   { packet.WriteUint(pos, i); }
    public void WriteUlong   (int pos, ulong l)  { packet.WriteUlong(pos, l); }
    public void WriteBlstring(int pos, string s) { packet.WriteBlstring(pos, s); }
    public void WriteClstring(int len, int pos, string s) { packet.WriteClstring(len, pos, s); }
    public uint SkillExp {
        get { return ReadUint(4); }
        set { WriteUint(4, value); }
    }
    public ushort SkillId {
        get { return ReadUshort(8); }
        set { WriteUshort(8, value); }
    }
    public ushort SkillLevel {
        get { return ReadUshort(10); }
        set { WriteUshort(10, value); }
    }
    public static bool IsThisType(Packet p) {
        return p.ReadUshort(0) == 12 && p.ReadUshort(2) == 1103;
    }
    private Packet packet;
    public Skill(Packet packet) {
        this.packet = packet;
    }
}

public class SkillExperience : PacketInterface {
    public byte   ReadByte    (int pos) { return packet.ReadByte(pos); }
    public ushort ReadUshort  (int pos) { return packet.ReadUshort(pos); }
    public uint   ReadUint    (int pos) { return packet.ReadUint(pos); }
    public ulong  ReadUlong   (int pos) { return packet.ReadUlong(pos); }
    public string ReadBlstring(int pos) { return packet.ReadBlstring(pos); }
    public string ReadClstring(int len, int pos) { return packet.ReadClstring(len, pos); }
    public void WriteByte    (int pos, byte b)   { packet.WriteByte(pos, b); }
    public void WriteUshort  (int pos, ushort s) { packet.WriteUshort(pos, s); }
    public void WriteUint    (int pos, uint i)   { packet.WriteUint(pos, i); }
    public void WriteUlong   (int pos, ulong l)  { packet.WriteUlong(pos, l); }
    public void WriteBlstring(int pos, string s) { packet.WriteBlstring(pos, s); }
    public void WriteClstring(int len, int pos, string s) { packet.WriteClstring(len, pos, s); }
    public uint SkillExp {
        get { return ReadUint(4); }
        set { WriteUint(4, value); }
    }
    public ushort SkillId {
        get { return ReadUshort(8); }
        set { WriteUshort(8, value); }
    }
    public ushort Type {
        get { return ReadUshort(10); }
        set { WriteUshort(10, value); }
    }
    public static bool IsThisType(Packet p) {
        return p.ReadUshort(0) == 12 && p.ReadUshort(2) == 1104;
    }
    private Packet packet;
    public SkillExperience(Packet packet) {
        this.packet = packet;
    }
}

public class Magic : PacketInterface {
    public byte   ReadByte    (int pos) { return packet.ReadByte(pos); }
    public ushort ReadUshort  (int pos) { return packet.ReadUshort(pos); }
    public uint   ReadUint    (int pos) { return packet.ReadUint(pos); }
    public ulong  ReadUlong   (int pos) { return packet.ReadUlong(pos); }
    public string ReadBlstring(int pos) { return packet.ReadBlstring(pos); }
    public string ReadClstring(int len, int pos) { return packet.ReadClstring(len, pos); }
    public void WriteByte    (int pos, byte b)   { packet.WriteByte(pos, b); }
    public void WriteUshort  (int pos, ushort s) { packet.WriteUshort(pos, s); }
    public void WriteUint    (int pos, uint i)   { packet.WriteUint(pos, i); }
    public void WriteUlong   (int pos, ulong l)  { packet.WriteUlong(pos, l); }
    public void WriteBlstring(int pos, string s) { packet.WriteBlstring(pos, s); }
    public void WriteClstring(int len, int pos, string s) { packet.WriteClstring(len, pos, s); }
    public ushort Length {
        get { return ReadUshort(0); }
        set { WriteUshort(0, value); }
    }
    public ushort TargetXCoord {
        get { return ReadUshort(4); }
        set { WriteUshort(4, value); }
    }
    public ushort TargetYCoord {
        get { return ReadUshort(6); }
        set { WriteUshort(6, value); }
    }
    public ushort SkillId {
        get { return ReadUshort(8); }
        set { WriteUshort(8, value); }
    }
    public ushort SkillLevel {
        get { return ReadUshort(10); }
        set { WriteUshort(10, value); }
    }
    struct foo0 {
        const int ElementSize = 12;
        public uint Count {
            get { return parent.ReadUint(12); }
        }
        public struct foo0foo {
            PacketInterface parent;
            int index;
            public foo0foo(PacketInterface parent, int index) {
                this.parent = parent;
                this.index = index;
            }
            const int Size = 12;
            public uint TargetId {
                get { return parent.ReadUint(16 + index * Size); }
                set { parent.WriteUint(16 + index * Size, value); }
            }
            public ulong TargetDamage {
                get { return parent.ReadUlong(20 + index * Size); }
                set { parent.WriteUlong(20 + index * Size, value); }
            }
        }
        PacketInterface parent;
        public foo0(PacketInterface parent) {
            this.parent = parent;
        }
        public foo0foo this[int i] {
            get { return new foo0foo(parent, i); }
        }
    }
    foo0 Targets;
    public static bool IsThisType(Packet p) {
        return p.ReadUshort(2) == 1105;
    }
    private Packet packet;
    public Magic(Packet packet) {
        this.packet = packet;
        Targets = new foo0(this);
    }
}

public class GuildInfo : PacketInterface {
    public byte   ReadByte    (int pos) { return packet.ReadByte(pos); }
    public ushort ReadUshort  (int pos) { return packet.ReadUshort(pos); }
    public uint   ReadUint    (int pos) { return packet.ReadUint(pos); }
    public ulong  ReadUlong   (int pos) { return packet.ReadUlong(pos); }
    public string ReadBlstring(int pos) { return packet.ReadBlstring(pos); }
    public string ReadClstring(int len, int pos) { return packet.ReadClstring(len, pos); }
    public void WriteByte    (int pos, byte b)   { packet.WriteByte(pos, b); }
    public void WriteUshort  (int pos, ushort s) { packet.WriteUshort(pos, s); }
    public void WriteUint    (int pos, uint i)   { packet.WriteUint(pos, i); }
    public void WriteUlong   (int pos, ulong l)  { packet.WriteUlong(pos, l); }
    public void WriteBlstring(int pos, string s) { packet.WriteBlstring(pos, s); }
    public void WriteClstring(int len, int pos, string s) { packet.WriteClstring(len, pos, s); }
    public ushort Length {
        get { return ReadUshort(0); }
        set { WriteUshort(0, value); }
    }
    public uint GuildId {
        get { return ReadUint(4); }
        set { WriteUint(4, value); }
    }
    public uint Donation {
        get { return ReadUint(8); }
        set { WriteUint(8, value); }
    }
    public uint Fund {
        get { return ReadUint(12); }
        set { WriteUint(12, value); }
    }
    public uint MemberCount {
        get { return ReadUint(16); }
        set { WriteUint(16, value); }
    }
    public byte Rank {
        get { return ReadByte(20); }
        set { WriteByte(20, value); }
    }
    public string GuildLeaderName {
        get { return ReadBlstring(21); }
        set { WriteBlstring(21, value); }
    }
    public static bool IsThisType(Packet p) {
        return p.ReadUshort(2) == 1106;
    }
    private Packet packet;
    public GuildInfo(Packet packet) {
        this.packet = packet;
    }
}

public class GuildCommand : PacketInterface {
    public byte   ReadByte    (int pos) { return packet.ReadByte(pos); }
    public ushort ReadUshort  (int pos) { return packet.ReadUshort(pos); }
    public uint   ReadUint    (int pos) { return packet.ReadUint(pos); }
    public ulong  ReadUlong   (int pos) { return packet.ReadUlong(pos); }
    public string ReadBlstring(int pos) { return packet.ReadBlstring(pos); }
    public string ReadClstring(int len, int pos) { return packet.ReadClstring(len, pos); }
    public void WriteByte    (int pos, byte b)   { packet.WriteByte(pos, b); }
    public void WriteUshort  (int pos, ushort s) { packet.WriteUshort(pos, s); }
    public void WriteUint    (int pos, uint i)   { packet.WriteUint(pos, i); }
    public void WriteUlong   (int pos, ulong l)  { packet.WriteUlong(pos, l); }
    public void WriteBlstring(int pos, string s) { packet.WriteBlstring(pos, s); }
    public void WriteClstring(int len, int pos, string s) { packet.WriteClstring(len, pos, s); }
    public uint GuildFunction {
        get { return ReadUint(4); }
        set { WriteUint(4, value); }
    }
    public uint Value {
        get { return ReadUint(8); }
        set { WriteUint(8, value); }
    }
    public static bool IsThisType(Packet p) {
        return p.ReadUshort(0) == 12 && p.ReadUshort(2) == 1107;
    }
    private Packet packet;
    public GuildCommand(Packet packet) {
        this.packet = packet;
    }
}

public class NpcSpawn : PacketInterface {
    public byte   ReadByte    (int pos) { return packet.ReadByte(pos); }
    public ushort ReadUshort  (int pos) { return packet.ReadUshort(pos); }
    public uint   ReadUint    (int pos) { return packet.ReadUint(pos); }
    public ulong  ReadUlong   (int pos) { return packet.ReadUlong(pos); }
    public string ReadBlstring(int pos) { return packet.ReadBlstring(pos); }
    public string ReadClstring(int len, int pos) { return packet.ReadClstring(len, pos); }
    public void WriteByte    (int pos, byte b)   { packet.WriteByte(pos, b); }
    public void WriteUshort  (int pos, ushort s) { packet.WriteUshort(pos, s); }
    public void WriteUint    (int pos, uint i)   { packet.WriteUint(pos, i); }
    public void WriteUlong   (int pos, ulong l)  { packet.WriteUlong(pos, l); }
    public void WriteBlstring(int pos, string s) { packet.WriteBlstring(pos, s); }
    public void WriteClstring(int len, int pos, string s) { packet.WriteClstring(len, pos, s); }
    public uint NpcId {
        get { return ReadUint(4); }
        set { WriteUint(4, value); }
    }
    public ushort XCoord {
        get { return ReadUshort(8); }
        set { WriteUshort(8, value); }
    }
    public ushort YCoord {
        get { return ReadUshort(10); }
        set { WriteUshort(10, value); }
    }
    public ushort TypeDirection {
        get { return ReadUshort(12); }
        set { WriteUshort(12, value); }
    }
    public ushort Interaction {
        get { return ReadUshort(14); }
        set { WriteUshort(14, value); }
    }
    public static bool IsThisType(Packet p) {
        return p.ReadUshort(0) == 20 && p.ReadUshort(2) == 2030;
    }
    private Packet packet;
    public NpcSpawn(Packet packet) {
        this.packet = packet;
    }
}

public class NpcInit : PacketInterface {
    public byte   ReadByte    (int pos) { return packet.ReadByte(pos); }
    public ushort ReadUshort  (int pos) { return packet.ReadUshort(pos); }
    public uint   ReadUint    (int pos) { return packet.ReadUint(pos); }
    public ulong  ReadUlong   (int pos) { return packet.ReadUlong(pos); }
    public string ReadBlstring(int pos) { return packet.ReadBlstring(pos); }
    public string ReadClstring(int len, int pos) { return packet.ReadClstring(len, pos); }
    public void WriteByte    (int pos, byte b)   { packet.WriteByte(pos, b); }
    public void WriteUshort  (int pos, ushort s) { packet.WriteUshort(pos, s); }
    public void WriteUint    (int pos, uint i)   { packet.WriteUint(pos, i); }
    public void WriteUlong   (int pos, ulong l)  { packet.WriteUlong(pos, l); }
    public void WriteBlstring(int pos, string s) { packet.WriteBlstring(pos, s); }
    public void WriteClstring(int len, int pos, string s) { packet.WriteClstring(len, pos, s); }
    public uint NpcId {
        get { return ReadUint(4); }
        set { WriteUint(4, value); }
    }
    public uint Unknown {
        get { return ReadUint(8); }
        set { WriteUint(8, value); }
    }
    public ushort Mode {
        get { return ReadUshort(12); }
        set { WriteUshort(12, value); }
    }
    public ushort TypeDirection {
        get { return ReadUshort(14); }
        set { WriteUshort(14, value); }
    }
    public static bool IsThisType(Packet p) {
        return p.ReadUshort(0) == 16 && p.ReadUshort(2) == 2031;
    }
    private Packet packet;
    public NpcInit(Packet packet) {
        this.packet = packet;
    }
}

public class NobilityIcon : PacketInterface {
    public byte   ReadByte    (int pos) { return packet.ReadByte(pos); }
    public ushort ReadUshort  (int pos) { return packet.ReadUshort(pos); }
    public uint   ReadUint    (int pos) { return packet.ReadUint(pos); }
    public ulong  ReadUlong   (int pos) { return packet.ReadUlong(pos); }
    public string ReadBlstring(int pos) { return packet.ReadBlstring(pos); }
    public string ReadClstring(int len, int pos) { return packet.ReadClstring(len, pos); }
    public void WriteByte    (int pos, byte b)   { packet.WriteByte(pos, b); }
    public void WriteUshort  (int pos, ushort s) { packet.WriteUshort(pos, s); }
    public void WriteUint    (int pos, uint i)   { packet.WriteUint(pos, i); }
    public void WriteUlong   (int pos, ulong l)  { packet.WriteUlong(pos, l); }
    public void WriteBlstring(int pos, string s) { packet.WriteBlstring(pos, s); }
    public void WriteClstring(int len, int pos, string s) { packet.WriteClstring(len, pos, s); }
    public ushort Length {
        get { return ReadUshort(0); }
        set { WriteUshort(0, value); }
    }
    public uint Type {
        get { return ReadUint(4); }
        set { WriteUint(4, value); }
    }
    public uint UniqueId {
        get { return ReadUint(8); }
        set { WriteUint(8, value); }
    }
    public byte StringCount {
        get { return ReadByte(12); }
        set { WriteByte(12, value); }
    }
    public string NobilityRank {
        get { return ReadBlstring(13); }
        set { WriteBlstring(13, value); }
    }
    public static bool IsThisType(Packet p) {
        return p.ReadUshort(2) == 2064;
    }
    private Packet packet;
    public NobilityIcon(Packet packet) {
        this.packet = packet;
    }
}

public class MentorInfo : PacketInterface {
    public byte   ReadByte    (int pos) { return packet.ReadByte(pos); }
    public ushort ReadUshort  (int pos) { return packet.ReadUshort(pos); }
    public uint   ReadUint    (int pos) { return packet.ReadUint(pos); }
    public ulong  ReadUlong   (int pos) { return packet.ReadUlong(pos); }
    public string ReadBlstring(int pos) { return packet.ReadBlstring(pos); }
    public string ReadClstring(int len, int pos) { return packet.ReadClstring(len, pos); }
    public void WriteByte    (int pos, byte b)   { packet.WriteByte(pos, b); }
    public void WriteUshort  (int pos, ushort s) { packet.WriteUshort(pos, s); }
    public void WriteUint    (int pos, uint i)   { packet.WriteUint(pos, i); }
    public void WriteUlong   (int pos, ulong l)  { packet.WriteUlong(pos, l); }
    public void WriteBlstring(int pos, string s) { packet.WriteBlstring(pos, s); }
    public void WriteClstring(int len, int pos, string s) { packet.WriteClstring(len, pos, s); }
    public ushort Length {
        get { return ReadUshort(0); }
        set { WriteUshort(0, value); }
    }
    public byte Type {
        get { return ReadByte(4); }
        set { WriteByte(4, value); }
    }
    public uint MentorUid {
        get { return ReadUint(5); }
        set { WriteUint(5, value); }
    }
    public uint ApprenticeUid {
        get { return ReadUint(9); }
        set { WriteUint(9, value); }
    }
    public byte Online {
        get { return ReadByte(13); }
        set { WriteByte(13, value); }
    }
    public byte StringCount {
        get { return ReadByte(14); }
        set { WriteByte(14, value); }
    }
    public string CharacterName {
        get { return ReadBlstring(15); }
        set { WriteBlstring(15, value); }
    }
    public static bool IsThisType(Packet p) {
        return p.ReadUshort(2) == 2065;
    }
    private Packet packet;
    public MentorInfo(Packet packet) {
        this.packet = packet;
    }
}

public class Mentor : PacketInterface {
    public byte   ReadByte    (int pos) { return packet.ReadByte(pos); }
    public ushort ReadUshort  (int pos) { return packet.ReadUshort(pos); }
    public uint   ReadUint    (int pos) { return packet.ReadUint(pos); }
    public ulong  ReadUlong   (int pos) { return packet.ReadUlong(pos); }
    public string ReadBlstring(int pos) { return packet.ReadBlstring(pos); }
    public string ReadClstring(int len, int pos) { return packet.ReadClstring(len, pos); }
    public void WriteByte    (int pos, byte b)   { packet.WriteByte(pos, b); }
    public void WriteUshort  (int pos, ushort s) { packet.WriteUshort(pos, s); }
    public void WriteUint    (int pos, uint i)   { packet.WriteUint(pos, i); }
    public void WriteUlong   (int pos, ulong l)  { packet.WriteUlong(pos, l); }
    public void WriteBlstring(int pos, string s) { packet.WriteBlstring(pos, s); }
    public void WriteClstring(int len, int pos, string s) { packet.WriteClstring(len, pos, s); }
    public ushort Length {
        get { return ReadUshort(0); }
        set { WriteUshort(0, value); }
    }
    public uint Type {
        get { return ReadUint(4); }
        set { WriteUint(4, value); }
    }
    public uint MentorUid {
        get { return ReadUint(8); }
        set { WriteUint(8, value); }
    }
    public uint ApprenticeUid {
        get { return ReadUint(12); }
        set { WriteUint(12, value); }
    }
    public uint MentorModel {
        get { return ReadUint(16); }
        set { WriteUint(16, value); }
    }
    public uint SharedBattlePower {
        get { return ReadUint(20); }
        set { WriteUint(20, value); }
    }
    public uint EnroleDate {
        get { return ReadUint(24); }
        set { WriteUint(24, value); }
    }
    public byte MentorLevel {
        get { return ReadByte(28); }
        set { WriteByte(28, value); }
    }
    public byte MentorClass {
        get { return ReadByte(29); }
        set { WriteByte(29, value); }
    }
    public byte MentorPkPoints {
        get { return ReadByte(30); }
        set { WriteByte(30, value); }
    }
    public byte MentorOnline {
        get { return ReadByte(31); }
        set { WriteByte(31, value); }
    }
    public uint ApprenticeExp {
        get { return ReadUint(32); }
        set { WriteUint(32, value); }
    }
    public ushort ApprenticeBlessing {
        get { return ReadUshort(36); }
        set { WriteUshort(36, value); }
    }
    public ushort ApprenticeComposing {
        get { return ReadUshort(38); }
        set { WriteUshort(38, value); }
    }
    public byte StringCount {
        get { return ReadByte(40); }
        set { WriteByte(40, value); }
    }
    public string MentoName {
        get { return ReadBlstring(41); }
        set { WriteBlstring(41, value); }
    }
    public string ApprenticeName {
        get { return ReadBlstring(41 + ReadByte(41)); }
        set { WriteBlstring(41 + ReadByte(41), value); }
    }
    public static bool IsThisType(Packet p) {
        return p.ReadUshort(2) == 2066;
    }
    private Packet packet;
    public Mentor(Packet packet) {
        this.packet = packet;
    }
}

} // namespace cofreedom.CO
clintonselke is offline  
Thanks
9 Users
Old 06/29/2010, 20:43   #2
 
TomasLT's Avatar
 
elite*gold: 0
Join Date: Nov 2006
Posts: 286
Received Thanks: 38
Nice. Becouse now i am making my own proxy
TomasLT is offline  
Old 06/29/2010, 20:54   #3
 
clintonselke's Avatar
 
elite*gold: 0
Join Date: Feb 2007
Posts: 348
Received Thanks: 2,175
<-- D compilers from here! (i'm trying to promote the D programming language xD)
clintonselke is offline  
Old 07/01/2010, 06:12   #4
 
elite*gold: 0
Join Date: Jan 2007
Posts: 118
Received Thanks: 20
Thanks
xmen01235 is offline  
Reply


Similar Threads Similar Threads
Surviving As A Trojan [Re-written]
11/11/2011 - CO2 Guides & Templates - 61 Replies
Making it to the finish line - As a Trojan I had some time on my hands and re-wrote my entire old guide on elitepvpers. First of all: Get a leveling bot! Comimic is my favourite. SirHooks is also good. Level 1-40: The best thing to do is to just do the monster hunter quest by yourselves and level by that, and when you finished all the jars for the day you should just get someone to powerlevel you, I would suggest going to Bird Island. Something you also can do is to find monsters...
how to change expneed.dat???its written with questionmarks :S!lol!
01/22/2010 - CO2 Private Server - 2 Replies
' 8 {F lT DX } h չ  3 ( }  < L O 9 H   <  m\  1  I g  Y   D <ߋ H^8|DPrԈ\hh"a *)0*O:S")=2UI<?? what is this language????? Old greek? :eek::eek::eek:
Well written script tutorial
11/26/2008 - Lineage 2 - 3 Replies
Hey guys its been awhile is now anyone out there who can show me how to script? I mean i know the basics but im still not able to write an scrippt which makes my char doing what i want him to all n8 long .... I really would welcome all help to that!! (and youll 100% get and thanks from me ;) EDIT: I mean eL2walker scrippting ^^
do any one no any cheats real ones to be written
02/11/2007 - Conquer Online 2 - 12 Replies
if any on know any thing about the real CHEATS for conquer online its to be written and not a prog. its for lvl 130 money DBs fullsuper two sock vote for better discution to gain info.



All times are GMT +2. The time now is 05:04.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.