Esempio n. 1
0
        public static void HandleSendKnownSpells(ref WorldClass session)
        {
            Character pChar = session.Character;

            var specializationSpells     = SpecializationMgr.GetSpecializationSpells(pChar);
            var specializationSpellCount = ((specializationSpells != null) ? specializationSpells.Count : 0);

            var talentSpells     = SpecializationMgr.GetTalentSpells(pChar, pChar.ActiveSpecGroup);
            var talentSpellCount = ((talentSpells != null) ? talentSpells.Count : 0);

            int count = pChar.SpellList.Count + specializationSpellCount + talentSpellCount;

            PacketWriter writer  = new PacketWriter(ServerMessage.SendKnownSpells);
            BitPack      BitPack = new BitPack(writer);

            BitPack.Write(count, 22);
            BitPack.Write(1);

            BitPack.Flush();

            pChar.SpellList.ForEach(spell =>
                                    writer.WriteUInt32(spell.SpellId));

            if (specializationSpells != null)
            {
                specializationSpells.ForEach(spell => writer.WriteUInt32(spell.Spell));
            }

            if (talentSpells != null)
            {
                talentSpells.ForEach(spell => writer.WriteUInt32(spell));
            }

            session.Send(ref writer);
        }
Esempio n. 2
0
        public static void SendSpecializationSpells(ref WorldClass session)
        {
            var specSpells = SpecializationMgr.GetSpecializationSpells(session.Character);
            var newSpells  = specSpells.Select(specializationSpell => specializationSpell.Spell).ToList();

            if (newSpells.Count > 0)
            {
                SpellHandler.HandleLearnedSpells(ref session, newSpells);
            }
        }