Example #1
0
            public static PacketWriter UpdatePartyName(MapleParty party)
            {
                PacketWriter pw = new PacketWriter(SendHeader.PartyInfo);

                pw.WriteByte(0x4D);
                pw.WriteBool(!party.Private);
                pw.WriteMapleString(party.Name);
                return(pw);
            }
Example #2
0
            public static PacketWriter UpdateParty(MapleParty party)
            {
                PacketWriter pw = new PacketWriter();

                pw.WriteHeader(SendHeader.PartyInfo);
                pw.WriteByte(0x0F);
                pw.WriteInt(party.Id);
                AddPartyPlayersInfo(pw, party);
                return(pw);
            }
Example #3
0
            public static PacketWriter PlayerJoin(MapleParty party, MapleCharacter newChar)
            {
                PacketWriter pw = new PacketWriter();

                pw.WriteHeader(SendHeader.PartyInfo);
                pw.WriteByte(0x18); //0x15 +3
                pw.WriteInt(party.Id);
                pw.WriteMapleString(newChar.Name);
                AddPartyPlayersInfo(pw, party);
                return(pw);
            }
Example #4
0
        public static MapleParty CreateParty(MapleCharacter owner, string partyName, bool privateParty)
        {
            MapleParty party = new MapleParty(partyName);

            lock (Parties)
            {
                Parties.Add(party.Id, party);
            }
            party.LeaderId = owner.Id;
            party.Characters.Add(owner.Id);
            party.Private = privateParty;
            owner.Client.SendPacket(Packets.CreateParty(party));
            return(party);
        }
Example #5
0
            public static PacketWriter PlayerLeave(MapleParty party, MapleCharacter leaveChar, MapleCharacter recipient, bool disband, bool kicked = false)
            {
                PacketWriter pw = new PacketWriter();

                pw.WriteHeader(SendHeader.PartyInfo);
                pw.WriteByte(0x15); //0x12 + 3
                pw.WriteInt(party.Id);
                pw.WriteInt(leaveChar.Id);
                pw.WriteBool(!disband);
                if (!disband)
                {
                    pw.WriteBool(kicked);
                    pw.WriteMapleString(leaveChar.Name);
                    AddPartyPlayersInfo(pw, party);
                }
                return(pw);
            }
Example #6
0
            public static PacketWriter CreateParty(MapleParty party)
            {
                PacketWriter pw = new PacketWriter();

                pw.WriteHeader(SendHeader.PartyInfo);
                pw.WriteByte(0x10);
                pw.WriteInt(party.Id);
                pw.WriteInt(999999999); //telerock?
                pw.WriteInt(999999999); //telerock?
                pw.WriteInt(0);
                pw.WriteShort(0);
                pw.WriteShort(0);
                pw.WriteByte(0);

                pw.WriteBool(!party.Private);
                pw.WriteMapleString(party.Name);

                return(pw);
            }
Example #7
0
            private static void AddPartyPlayersInfo(PacketWriter pw, MapleParty party)
            {
                List <PartyCharacterInfo> chrs = new List <PartyCharacterInfo>();

                foreach (int i in party.Characters)
                {
                    chrs.Add(party.GetPartyCharacterInfo(i));
                }

                for (int i = 0; i < 6; i++)
                {
                    pw.WriteInt(i < chrs.Count ? chrs[i].Id : 0);
                }
                for (int i = 0; i < 6; i++)
                {
                    if (i < chrs.Count)
                    {
                        pw.WriteStaticString(chrs[i].Name, 13);
                    }
                    else
                    {
                        pw.WriteZeroBytes(13);
                    }
                }
                for (int i = 0; i < 6; i++)
                {
                    pw.WriteInt(i < chrs.Count ? chrs[i].Job : 0);
                }
                for (int i = 0; i < 6; i++)
                {
                    pw.WriteInt(0);
                }
                for (int i = 0; i < 6; i++)
                {
                    pw.WriteInt(i < chrs.Count ? chrs[i].Level : 0);
                }
                for (int i = 0; i < 6; i++)
                {
                    if (i < chrs.Count)
                    {
                        pw.WriteInt(chrs[i].Channel);
                    }
                    else
                    {
                        pw.WriteInt(-2);
                    }
                }
                for (int i = 0; i < 6; i++)
                {
                    pw.WriteInt(0);
                }
                pw.WriteInt(party.LeaderId); //leader
                for (int i = 0; i < 6; i++)
                {
                    pw.WriteInt(i < chrs.Count ? chrs[i].MapId : 0);
                }
                for (int i = 0; i < 6; i++)
                {
                    if (i < chrs.Count)
                    {
                        //todo: doors
                        //MapleCharacter chr = chrs[i];
                        pw.WriteInt(999999999);
                        pw.WriteInt(999999999);
                        pw.WriteInt(0);
                        pw.WriteInt(-1);
                        pw.WriteInt(-1);
                    }
                    else
                    {
                        pw.WriteZeroBytes(20);
                    }
                }
                pw.WriteBool(!party.Private);
                pw.WriteMapleString(party.Name);
            }