示例#1
0
 public void On_CMSG_MOUNTSPECIAL_ANIM(ref Packets.PacketClass packet, ref WS_Network.ClientClass client)
 {
     WorldServiceLocator._WorldServer.Log.WriteLine(LogType.DEBUG, "[{0}:{1}] CMSG_MOUNTSPECIAL_ANIM", client.IP, client.Port);
     Packets.PacketClass response = new Packets.PacketClass(Opcodes.SMSG_MOUNTSPECIAL_ANIM);
     try
     {
         response.AddPackGUID(client.Character.GUID);
         client.Character.SendToNearPlayers(ref response);
     }
     finally
     {
         response.Dispose();
     }
 }
示例#2
0
        public Packets.PacketClass BuildPartyMemberStats(ref WS_PlayerData.CharacterObject objCharacter, uint flag)
        {
            Opcodes opCode = Opcodes.SMSG_PARTY_MEMBER_STATS;

            if (flag == 1015 || flag == 524279)
            {
                opCode = Opcodes.SMSG_PARTY_MEMBER_STATS_FULL;
                if (objCharacter.ManaType != 0)
                {
                    flag |= 8u;
                }
            }
            Packets.PacketClass packet = new Packets.PacketClass(opCode);
            packet.AddPackGUID(objCharacter.GUID);
            packet.AddUInt32(flag);
            if ((flag & (true ? 1u : 0u)) != 0)
            {
                byte memberFlags = 1;
                if (objCharacter.isPvP)
                {
                    memberFlags = (byte)(memberFlags | 2);
                }
                if (objCharacter.DEAD)
                {
                    memberFlags = (byte)(memberFlags | 0x10);
                }
                packet.AddInt8(memberFlags);
            }
            checked
            {
                if ((flag & 2u) != 0)
                {
                    packet.AddUInt16((ushort)objCharacter.Life.Current);
                }
                if ((flag & 4u) != 0)
                {
                    packet.AddUInt16((ushort)objCharacter.Life.Maximum);
                }
                if ((flag & 8u) != 0)
                {
                    packet.AddInt8((byte)objCharacter.ManaType);
                }
                if ((flag & 0x10u) != 0)
                {
                    if (objCharacter.ManaType == ManaTypes.TYPE_RAGE)
                    {
                        packet.AddUInt16((ushort)objCharacter.Rage.Current);
                    }
                    else if (objCharacter.ManaType == ManaTypes.TYPE_ENERGY)
                    {
                        packet.AddUInt16((ushort)objCharacter.Energy.Current);
                    }
                    else
                    {
                        packet.AddUInt16((ushort)objCharacter.Mana.Current);
                    }
                }
                if ((flag & 0x20u) != 0)
                {
                    if (objCharacter.ManaType == ManaTypes.TYPE_RAGE)
                    {
                        packet.AddUInt16((ushort)objCharacter.Rage.Maximum);
                    }
                    else if (objCharacter.ManaType == ManaTypes.TYPE_ENERGY)
                    {
                        packet.AddUInt16((ushort)objCharacter.Energy.Maximum);
                    }
                    else
                    {
                        packet.AddUInt16((ushort)objCharacter.Mana.Maximum);
                    }
                }
                if ((flag & 0x40u) != 0)
                {
                    packet.AddUInt16(objCharacter.Level);
                }
                if ((flag & 0x80u) != 0)
                {
                    packet.AddUInt16((ushort)objCharacter.ZoneID);
                }
                if ((flag & 0x100u) != 0)
                {
                    packet.AddInt16((short)objCharacter.positionX);
                    packet.AddInt16((short)objCharacter.positionY);
                }
                if ((flag & 0x200u) != 0)
                {
                    ulong auraMask2 = 0uL;
                    int   auraPos2  = packet.Data.Length;
                    packet.AddUInt64(0uL);
                    int num = WorldServiceLocator._Global_Constants.MAX_AURA_EFFECTs_VISIBLE - 1;
                    for (int j = 0; j <= num; j++)
                    {
                        if (objCharacter.ActiveSpells[j] != null)
                        {
                            unchecked
                            {
                                auraMask2 |= (ulong)(1L << checked ((int)(ulong)j));
                            }
                            packet.AddUInt16((ushort)objCharacter.ActiveSpells[j].SpellID);
                            packet.AddInt8(1);
                        }
                    }
                    packet.AddUInt64(auraMask2, auraPos2);
                }
                if ((flag & 0x400u) != 0)
                {
                    if (objCharacter.Pet != null)
                    {
                        packet.AddUInt64(objCharacter.Pet.GUID);
                    }
                    else
                    {
                        packet.AddInt64(0L);
                    }
                }
                if ((flag & 0x800u) != 0)
                {
                    if (objCharacter.Pet != null)
                    {
                        packet.AddString(objCharacter.Pet.PetName);
                    }
                    else
                    {
                        packet.AddString("");
                    }
                }
                if ((flag & 0x1000u) != 0)
                {
                    if (objCharacter.Pet != null)
                    {
                        packet.AddUInt16((ushort)objCharacter.Pet.Model);
                    }
                    else
                    {
                        packet.AddInt16(0);
                    }
                }
                if ((flag & 0x2000u) != 0)
                {
                    if (objCharacter.Pet != null)
                    {
                        packet.AddUInt16((ushort)objCharacter.Pet.Life.Current);
                    }
                    else
                    {
                        packet.AddInt16(0);
                    }
                }
                if ((flag & 0x4000u) != 0)
                {
                    if (objCharacter.Pet != null)
                    {
                        packet.AddUInt16((ushort)objCharacter.Pet.Life.Maximum);
                    }
                    else
                    {
                        packet.AddInt16(0);
                    }
                }
                if ((flag & 0x8000u) != 0)
                {
                    if (objCharacter.Pet != null)
                    {
                        packet.AddInt8(2);
                    }
                    else
                    {
                        packet.AddInt8(0);
                    }
                }
                if ((flag & 0x10000u) != 0)
                {
                    if (objCharacter.Pet != null)
                    {
                        packet.AddUInt16((ushort)objCharacter.Pet.Mana.Current);
                    }
                    else
                    {
                        packet.AddInt16(0);
                    }
                }
                if ((flag & 0x20000u) != 0)
                {
                    if (objCharacter.Pet != null)
                    {
                        packet.AddUInt16((ushort)objCharacter.Pet.Mana.Maximum);
                    }
                    else
                    {
                        packet.AddInt16(0);
                    }
                }
                if ((flag & 0x40000u) != 0)
                {
                    if (objCharacter.Pet != null)
                    {
                        ulong auraMask = 0uL;
                        int   auraPos  = packet.Data.Length;
                        packet.AddUInt64(0uL);
                        int num2 = WorldServiceLocator._Global_Constants.MAX_AURA_EFFECTs_VISIBLE - 1;
                        for (int i = 0; i <= num2; i++)
                        {
                            if (objCharacter.Pet.ActiveSpells[i] != null)
                            {
                                unchecked
                                {
                                    auraMask |= (ulong)(1L << checked ((int)(ulong)i));
                                }
                                packet.AddUInt16((ushort)objCharacter.Pet.ActiveSpells[i].SpellID);
                                packet.AddInt8(1);
                            }
                        }
                        packet.AddUInt64(auraMask, auraPos);
                    }
                    else
                    {
                        packet.AddInt64(0L);
                    }
                }
                return(packet);
            }
        }