Beispiel #1
0
        /// <summary>Sends the client the list of talents</summary>
        /// <param name="hasTalents">The IHasTalents to send the list from</param>
        public static void SendTalentGroupList(TalentCollection talents, int talentGroupId)
        {
            using (RealmPacketOut packet = new RealmPacketOut(RealmServerOpCode.SMSG_TALENTS_INFO))
            {
                Unit owner = talents.Owner;
                bool flag  = owner is Character;
                packet.Write(flag ? (byte)0 : (byte)1);
                if (flag)
                {
                    TalentHandler.WritePlayerTalentList((BinaryWriter)packet, (Character)owner, talentGroupId);
                }
                else
                {
                    packet.Write(talents.FreeTalentPoints);
                    packet.Write((byte)talents.Count);
                    foreach (Talent talent in talents)
                    {
                        packet.Write((int)talent.Entry.Id);
                        packet.Write((byte)talent.Rank);
                    }
                }

                talents.OwnerCharacter.Send(packet, false);
            }
        }
Beispiel #2
0
 public static void SendInspectTalents(Character chr)
 {
     using (RealmPacketOut packet = new RealmPacketOut(RealmServerOpCode.SMSG_INSPECT_TALENT))
     {
         chr.EntityId.WritePacked((BinaryWriter)packet);
         TalentHandler.WritePlayerTalentList((BinaryWriter)packet, chr, chr.Talents.CurrentSpecIndex);
         chr.Client.Send(packet, false);
     }
 }