WriteBool() public method

public WriteBool ( bool pValue ) : void
pValue bool
return void
Exemplo n.º 1
0
 public static void SendQuickbarState(WorldClient client)
 {
     using (var packet = new Packet(SH28Type.LoadQuickBarState))
     {
         byte[] data = client.Character.Character.QuickBarState;
         bool hasData = data != null;
         packet.WriteBool(hasData);
         packet.WriteBytes(hasData ? data : new byte[] { 0 });
         client.SendPacket(packet);
     }
 }
Exemplo n.º 2
0
 public static void SendShortcuts(WorldClient client)
 {
     using (var packet = new Packet(SH28Type.LoadShortCuts))
     {
         byte[] data = client.Character.Character.Shortcuts;
         bool hasData = data != null;
         packet.WriteBool(hasData);
         packet.WriteBytes(hasData ? data : new byte[] { 0 });
         client.SendPacket(packet);
     }
 }
Exemplo n.º 3
0
 public static void SendStatsUpdate(MapObject pObject, ZoneClient to, bool selectedby)
 {
     using (var packet = new Packet(SH9Type.StatUpdate))
     {
         packet.WriteBool(selectedby);
         packet.WriteUShort(pObject.MapObjectID);
         if (pObject is ZoneCharacter)
         {
             ((ZoneCharacter)pObject).WriteUpdateStats(packet);
         }
         else
         {
             ((Mob)pObject).WriteUpdateStats(packet);
         }
         to.SendPacket(packet);
     }
 }
Exemplo n.º 4
0
        public static void SendAttackDamage(MapObject from, ushort objectID, ushort damage, bool crit, uint hpleft, ushort counter)
        {
            using (var packet = new Packet(SH9Type.AttackDamage))
            {
                packet.WriteUShort(from.MapObjectID);
                packet.WriteUShort(objectID);
                packet.WriteBool(crit);
                packet.WriteUShort(damage);
                packet.WriteUInt(hpleft);
                packet.WriteUShort(counter);
                packet.WriteByte(4);
                packet.WriteByte(100);

                from.MapSector.Broadcast(packet);
            }
        }
Exemplo n.º 5
0
 public static void SendSkill(MapObject user, ushort animid, ushort victimid, uint damage, uint newhp, ushort counter, byte special1 = (byte) 0x10, byte special2 = (byte) 0x00)
 {
     // 9 82 | [E5 3F] [8A 27] [01] [8A 27] [10 00] [09 00 00 00] [5E 00 00 00] [A7 4C]
     // 9 82 | [9A 35] [8A 27] [01] [C2 05] [10 00] [0A 00 00 00] [1D 01 00 00] [73 37]
     // 9 82 | [43 3C] [42 15] [01] [AC 4C] [01 01] [7A 02 00 00] [00 00 00 00] [35 09]
     // 9 82 | [0E 39] [42 15] [01] [00 4A] [21 01] [1C 03 00 00] [00 00 00 00] [8C 0E]
     using (var packet = new Packet(SH9Type.SkillAnimationTarget))
     {
         packet.WriteUShort(animid);
         packet.WriteUShort(user.MapObjectID);
         packet.WriteBool(true);
         packet.WriteUShort(victimid);
         packet.WriteByte(special1);
         packet.WriteByte(special2);
         packet.WriteUInt(damage);
         packet.WriteUInt(newhp);
         packet.WriteUShort(counter);
         user.MapSector.Broadcast(packet);
     }
 }
Exemplo n.º 6
0
 public static void SendSkillNoVictim(MapObject user, ushort animid)
 {
     // 9 82 | [75 70] [32 29] [00]
     using (var packet = new Packet(SH9Type.SkillAnimationTarget))
     {
         packet.WriteUShort(animid);
         packet.WriteUShort(user.MapObjectID);
         packet.WriteBool(false);
         user.MapSector.Broadcast(packet);
     }
 }
Exemplo n.º 7
0
 public void WriteInfo(Packet packet)
 {
     packet.WriteString(Character.Character.Name, 16);
     packet.Fill(65, 0x00);//unk
     packet.WriteBool(Character.IsIngame);
     packet.Fill(3, 0x00);//unk
     packet.WriteByte(Character.Character.Job);//job
     packet.WriteByte(Character.Character.CharLevel);//level
     packet.WriteByte(0);// unk
     packet.WriteString(DataProvider.GetMapname(Character.Character.PositionInfo.Map), 12);//mapName
     packet.WriteByte((byte)RegisterDate.Month);//month
     packet.WriteByte(184);//year fortmat unkown
     packet.WriteByte((byte)RegisterDate.Day);//day
     packet.WriteByte(0);//unk
     packet.WriteByte(0);  //unk
 }
Exemplo n.º 8
0
        public void WriteCharacterDisplay(Packet packet)
        {
            packet.WriteUShort(MapObjectID);
            packet.WriteString(Name, 16);
            packet.WriteInt(Position.X);
            packet.WriteInt(Position.Y);
            packet.WriteByte(Rotation);                // Rotation
            packet.WriteByte((byte)State);          // Player State (1,2 - Player, 3 - Dead, 4 - Resting, 5 - Vendor, 6 - On Mount)
            packet.WriteByte((byte)Job);
            if (State != PlayerState.Resting && State != PlayerState.Vendor && this.House == null)
            {
                WriteLook(packet);
                WriteEquipment(packet);
            }
            else
            {
                this.House.WritePacket(packet);
            }
            WriteRefinement(packet);

            packet.WriteUShort(0);  // Mount Handle
            packet.WriteUShort(0xffff);
            packet.WriteByte(0xff);          // Emote (0xff = nothing)
            packet.WriteUShort(0xffff);
            packet.WriteShort(0);
            packet.WriteUShort(0);             // Mob ID (title = 10)

            packet.Fill(81, 0);                // Buff Bits? Something like that
            packet.WriteInt(character.GuildID.HasValue ? character.GuildID.Value : 0);      // Guild ID
            packet.WriteByte(0x02);            // UNK (0x02)
            packet.WriteBool(false);            // In Guild Academy (0 - No, 1 - Yes)
            packet.WriteBool(true);            // Pet AutoPickup   (0 - Off, 1 - On)
            packet.WriteByte(this.Level);
            packet.Fill(32, 0);
            packet.Fill(2, 0xFF);
            packet.WriteUShort(522);
        }
Exemplo n.º 9
0
 private static void AllowFiles(LoginClient pClient, bool pIsOk)
 {
     using (Packet pack = new Packet(SH3Type.FilecheckAllow))
     {
         pack.WriteBool(pIsOk);
         pClient.SendPacket(pack);
     }
 }
Exemplo n.º 10
0
        public void AnnouncePartyList()
        {
            using (var packet = new Packet(SH14Type.PartyList))
            {
                packet.WriteByte((byte)Members.Count);
                foreach (var groupMember in Members)
                {
                    packet.WriteString(groupMember.Name, 16);
                    packet.WriteBool(groupMember.IsOnline);
                }

                AnnouncePacket(packet);
            }
        }
Exemplo n.º 11
0
 public void WritePacket(Packet pPacket)
 {
     pPacket.WriteBool(IsOnline);	// Logged In
     pPacket.WriteByte(this.Month);	// Last connect Month << 4 (TODO)
     pPacket.WriteByte(this.Day);	// Last connect Day (TODO)
     pPacket.WriteByte(0);	// Unknown (TODO)
     pPacket.WriteString(this.Name, 16);
     pPacket.WriteByte(this.Job);
     pPacket.WriteByte(this.Level);
     pPacket.WriteByte(0);	// In Party (TODO)
     pPacket.WriteByte(0);	// Unkown (TODO)
     pPacket.WriteString(this.Map, 12);
     pPacket.Fill(32, 0);
 }
Exemplo n.º 12
0
        private static void SendGuildCreateResponse(WorldClient Client, string Name, string Password, bool AllowGuildWar, GuildCreateResponse Response)
        {
            using (var packet = new Packet(SH29Type.CreateGuildResponse))
            {

                packet.WriteUShort((ushort)Response);
                packet.WriteInt((Response == GuildCreateResponse.Success ? 32 : 0));

                packet.WriteString(Name, 16);
                packet.WriteString(Password, 8);
                packet.WriteBool(AllowGuildWar);
                Client.SendPacket(packet);
            }
        }
Exemplo n.º 13
0
        public void WriteCharacterDisplay(Packet packet)
        {
            packet.WriteUShort(MapObjectID);
            packet.WriteString(Name, 16);
            packet.WriteInt(Position.X);
            packet.WriteInt(Position.Y);
            packet.WriteByte(Rotation);                // Rotation
            packet.WriteByte((byte)State);          // Player State (1,2 - Player, 3 - Dead, 4 - Resting, 5 - Vendor, 6 - On Mount)
            packet.WriteByte((byte)Job);
            if (State != PlayerState.Resting && State != PlayerState.Vendor && this.House == null)
            {
                WriteLook(packet);
                WriteEquipment(packet);
            }
            else
            {
                this.House.WritePacket(packet);
            }
            WriteRefinement(packet);
            //(IsMale ? 1 : 0)
            int mount = (this.Mount != null) ? (int) this.Mount.Handle : (int)0xffff;
            packet.WriteUShort((ushort)mount);  // Mount Handle
            packet.WriteUShort(0xffff);
            packet.WriteByte(0xff);          // Emote (0xff = nothing)
            packet.WriteUShort(0xffff);
            packet.WriteShort(0);
            packet.WriteUShort(0);             // Mob ID (title = 10)

            packet.Fill(55, 0);                // Buff Bits? Something like that
            if (this.Character.GuildID > 1)
            {
                packet.WriteInt(this.Guild.ID);
            }
            else if (this.Character.AcademyID > 0)
            {
                packet.WriteInt(this.Character.AcademyID);
            }
            else
            {
                packet.WriteInt(0);
            }
            packet.WriteByte(0x02);            // UNK (0x02)

            packet.WriteBool(this.IsInaAcademy);            // In Guild Academy (0 - No, 1 - Yes)
            packet.WriteBool(true);            // Pet AutoPickup   (0 - Off, 1 - On)
            packet.WriteByte(this.Level);
        }