Example #1
0
        internal static void send_EntityAck(ref PacketStream stream)
        {
            StringBuilder str = new StringBuilder();
            str.AppendLine("struct " + GetPacketName(stream.GetId()) + " [" + stream.GetId() + "]");
            stream.ReadByte();

            str.AppendLine("{");
            byte mainType = stream.ReadByte();
            str.Append("	Byte main_type = (" + mainType + ") ");
            switch (mainType)
            {
                case 0: str.Append("Player\r\n"); break;
                case 1: str.Append("NPC\r\n"); break;
                case 2: str.Append("Static Object\r\n"); break;
            }
            str.AppendLine("	UInt32 handle = " + stream.ReadUInt32());
            str.AppendLine("	Single x = " + stream.ReadFloat());
            str.AppendLine("	Single y = " + stream.ReadFloat());
            str.AppendLine("	Single z = " + stream.ReadFloat());
            str.AppendLine("	Byte layer = " + stream.ReadByte());
            byte subType = stream.ReadByte();
            str.Append("	Byte sub_type = (" + subType +") ");
            switch (subType)
            {
                case 0: str.Append("Player\r\n"); break;
                case 1: str.Append("NPC\r\n"); break;
                case 2: str.Append("Item\r\n"); break;
                case 3: str.Append("Mob\r\n"); break;
                case 4: str.Append("Summon\r\n"); break;
                case 5: str.Append("SkillProp\r\n"); break;
                case 6: str.Append("FieldProp\r\n"); break;
                case 7: str.Append("Pet\r\n"); break;
            }
            str.AppendLine("	");
            if (mainType == 0)
            { // Player
                str.AppendLine("	[Extra Info]");
            }
            else if (mainType == 1)
            { // NPC
                str.AppendLine("	uint status = " + stream.ReadUInt32());
                str.AppendLine("	float face_dir = " + stream.ReadFloat());
                str.AppendLine("	int hp = " + stream.ReadInt32());
                str.AppendLine("	int max_hp = " + stream.ReadInt32());
                str.AppendLine("	int mp = " + stream.ReadInt32());
                str.AppendLine("	int max_mp = " + stream.ReadInt32());
                str.AppendLine("	int level = " + stream.ReadInt32());

                str.AppendLine("	byte race = " + stream.ReadByte());
                str.AppendLine("	uint skin_color = " + stream.ReadUInt32());
                str.AppendLine("	bool is_first_enter = " + stream.ReadBool());
                str.AppendLine("	int energy = " + stream.ReadInt32());

                if (subType == 0)
                { // Player

                }
                else if (subType == 1)
                {// NPC
                    long encId = stream.ReadInt64();
                    str.AppendLine("	Int64 encrypted_id = (" + encId  + ") " + EncryptedInt.Revert(encId));
                }
                else if (subType == 3)
                {// Mob
                    long encId = stream.ReadInt64();
                    str.AppendLine("	Int64 encrypted_id = (" + encId + ") " + EncryptedInt.Revert(encId));
                }
                else if (subType == 4)
                {// Summon
                    str.AppendLine("	uint master_handle = " + stream.ReadUInt32());
                    long encId = stream.ReadInt64();
                    str.AppendLine("	Int64 encrypted_id = (" + encId + ") " + EncryptedInt.Revert(encId));
                    str.AppendLine("	char[19] name = " + stream.ReadString(0, 19));
                }
                else if (subType == 7)
                {// Pet
                    str.AppendLine("	uint master_handle = " + stream.ReadUInt32());
                    long encId = stream.ReadInt64();
                    str.AppendLine("	Int64 encrypted_id = (" + encId + ") " + EncryptedInt.Revert(encId));
                    str.AppendLine("	char[19] name = " + stream.ReadString(0, 19));
                }
                else
                {
                    str.AppendLine("	[Extra Info]");
                }
            }
            else if (mainType == 2)
            { // Static

                if (subType == 2)
                { // Item
                    long encId = stream.ReadInt64();
                    str.AppendLine("	Int64 encrypted_id = (" + encId + ") " + EncryptedInt.Revert(encId));
                    str.AppendLine("	Int64 count = " + stream.ReadInt64());
                    str.AppendLine("	uint drop_time = " + stream.ReadUInt32());
                    str.AppendLine("	uint player1 = " + stream.ReadUInt32());
                    str.AppendLine("	uint player2 = " + stream.ReadUInt32());
                    str.AppendLine("	uint player3 = " + stream.ReadUInt32());
                    str.AppendLine("	int party1 = " + stream.ReadInt32());
                    str.AppendLine("	int party2 = " + stream.ReadInt32());
                    str.AppendLine("	int party3 = " + stream.ReadInt32());
                }
                else if (subType == 5)
                { //SkillProp
                    str.AppendLine("	uint caster = " + stream.ReadUInt32());
                    str.AppendLine("	uint start_time = " + stream.ReadUInt32());
                    str.AppendLine("	int skill_id = " + stream.ReadInt32());
                }
                else if (subType == 6)
                { // FieldProp
                    str.AppendLine("	int prop_id = " + stream.ReadInt32());
                    str.AppendLine("	float fZOffset = " + stream.ReadFloat());
                    str.AppendLine("	float fRotateX = " + stream.ReadFloat());
                    str.AppendLine("	float fRotateY = " + stream.ReadFloat());
                    str.AppendLine("	float fRotateZ = " + stream.ReadFloat());
                    str.AppendLine("	float fScaleX = " + stream.ReadFloat());
                    str.AppendLine("	float fScaleY = " + stream.ReadFloat());
                    str.AppendLine("	float fScaleZ = " + stream.ReadFloat());
                    str.AppendLine("	bool bLockHeight = " + stream.ReadBool());
                    str.AppendLine("	float fLockHeight = " + stream.ReadFloat());
                }
                else
                {
                    str.AppendLine("	[Extra Info]");
                }
            }

            str.AppendLine("}");

            Form1.PacketRecv('G', GetPacketName(stream.GetId()), stream, str.ToString());
        }
Example #2
0
        internal static void send_UpdateGoldChaos(ref PacketStream stream)
        {
            StringBuilder str = new StringBuilder();
            str.AppendLine("struct " + GetPacketName(stream.GetId()) + " [" + stream.GetId() + "]");
            stream.ReadByte();

            str.AppendLine("{");
            str.AppendLine("	Int64 gold = " + stream.ReadInt64());
            str.AppendLine("	Int32 chaos = " + stream.ReadInt32());
            str.AppendLine("}");

            Form1.PacketRecv('G', GetPacketName(stream.GetId()), stream, str.ToString());
        }
Example #3
0
        internal static void send_InventoryList(ref PacketStream stream)
        {
            StringBuilder str = new StringBuilder();
            str.AppendLine("struct " + GetPacketName(stream.GetId()) + " [" + stream.GetId() + "]");
            stream.ReadByte();

            str.AppendLine("{");
            short count = stream.ReadInt16();
            str.AppendLine("	Int16 count = " + count);
            str.AppendLine("	struct Item[count]");
            str.AppendLine("	{");
            for (int i = 0; i < count; i++)
            {
                str.AppendLine("		{");
                str.AppendLine("			UInt32 item_handle = " + stream.ReadUInt32());
                str.AppendLine("			Int32 item_id = " + stream.ReadInt32());
                str.AppendLine("			Int64 item_uid = " + stream.ReadInt64());
                str.AppendLine("			Int64 count = " + stream.ReadInt64());
                str.AppendLine("			4B unknown = " + stream.ReadInt32());
                str.AppendLine("			4B unknown = " + stream.ReadInt32());
                str.AppendLine("			Byte enhance = " + stream.ReadByte());
                str.AppendLine("			Byte level = " + stream.ReadByte());
                str.AppendLine("			1B unknown = " + stream.ReadByte());
                for (int j = 0; j < 80; j+=4)
                    str.AppendLine("			4B unknown = " + stream.ReadInt32());
                str.AppendLine("			Int32 wear_info = " + stream.ReadInt32());
                str.AppendLine("			Int16 unknown // 0 = " + stream.ReadInt16());
                str.AppendLine("			Int32 idx = " + stream.ReadInt32());
                str.AppendLine("		}");
            }

            str.AppendLine("}");

            Form1.PacketRecv('G', GetPacketName(stream.GetId()), stream, str.ToString());
        }
Example #4
0
        internal static void send_UpdateExp(ref PacketStream stream)
        {
            StringBuilder str = new StringBuilder();
            str.AppendLine("struct " + GetPacketName(stream.GetId()) + " [" + stream.GetId() + "]");
            stream.ReadByte();

            str.AppendLine("{");
            str.AppendLine("	UInt32 handle = " + stream.ReadUInt32());
            str.AppendLine("	Int64 char_exp = " + stream.ReadInt64());
            str.AppendLine("	Int64 jp = " + stream.ReadInt64());
            str.AppendLine("}");

            Form1.PacketRecv('G', GetPacketName(stream.GetId()), stream, str.ToString());
        }
Example #5
0
        internal static void send_GameTime(ref PacketStream stream)
        {
            StringBuilder str = new StringBuilder();
            str.AppendLine("struct " + GetPacketName(stream.GetId()) + " [" + stream.GetId() + "]");
            stream.ReadByte();

            str.AppendLine("{");
            str.AppendLine("	Int32 start_time = " + stream.ReadInt32());
            str.AppendLine("	Int64 unix_timestamp = " + stream.ReadInt64());
            str.AppendLine("}");

            Form1.PacketRecv('G', GetPacketName(stream.GetId()), stream, str.ToString());
        }