void initialSpells()
        {
            if ((Character.Spells == null) || (Character.Spells.Length == 0))
            {
                return;
            }
            int       slotNum = 1;
            BinWriter w       = LoginClient.NewPacket(SMSG.INITIAL_SPELLS);

            // Unknow byte
            w.Write((byte)0);
            // Number of abilites/spells
            w.Write((ushort)this.Character.Spells.Length);
            foreach (DBKnownSpell knownSpell in this.Character.Spells)
            {
                try
                {
                    // Spell ID : Defensive Stance
                    w.Write((ushort)knownSpell.Spell_Id);
                    // Slot Number
                    w.Write((short)knownSpell.Slot);
                    slotNum++;
                }
                catch (Exception) {}               //{Chat.System(client, e.InnerException.Message);}
            }
            w.Write((byte)0x00);
            w.Write((byte)0x00);
            Send(w);
        }
Exemple #2
0
 internal static void RemoveCharacter(LoginClient client)
 {
     if (client.Character != null)
     {
         m_loginCharacters.Remove(client.Character.ObjectId);
         if (client.Character.OnFriends != null)
         {
             BinWriter   flist        = null;
             LoginClient FriendOnline = null;
             foreach (DBFriendList Friend in client.Character.OnFriends)
             {
                 flist        = LoginClient.NewPacket(SMSG.FRIEND_STATUS);
                 FriendOnline = LoginServer.GetLoginClientByCharacterID(Friend.Owner_ID);
                 if (FriendOnline != null)
                 {
                     //							Chat.System(FriendOnline, client.Character.Name+" has Gone Offline");
                     flist.Write((char)0x03);
                     flist.Write((ulong)client.Character.ObjectId);
                     FriendOnline.Send(flist);
                 }
                 FriendOnline = null;
                 flist        = null;
             }
         }
         client.Character = null;
     }
 }
Exemple #3
0
        public static void FriendIsOnline(LoginClient client)
        {
            LoginClient FriendOnline = null;
            BinWriter   flist        = null;

            if (client.Character.OnFriends != null)
            {
                foreach (DBFriendList Friend in client.Character.OnFriends)
                {
                    FriendOnline = LoginServer.GetLoginClientByCharacterID(Friend.Owner_ID);
                    if (FriendOnline != null)
                    {
                        flist = LoginClient.NewPacket(SMSG.FRIEND_STATUS);
                        //						Chat.System(FriendOnline, client.Character.Name+" is Online");
                        flist.Write((char)0x02);
                        flist.Write((ulong)client.Character.ObjectId);

                        flist.Write((int)client.Character.Zone);
                        flist.Write((int)client.Character.Level);
                        flist.Write((int)client.Character.Class);
                        FriendOnline.Send(flist);
                    }
                    FriendOnline = null;
                    flist        = null;
                }
            }
        }
Exemple #4
0
        public static void SendWhoList(LoginClient whoClient)
        {
            BinWriter pkg = LoginClient.NewPacket(SMSG.WHO);

            pkg.Write((int)Instance.ClientCount);
            pkg.Write((int)Instance.ClientCount);
            IEnumerator e = Instance.Clients.GetEnumerator();

            //			int Group = 0; // 0 = No, 1 = Yes
            while (e.MoveNext())
            {
                try
                {
                    pkg.Write((string)((LoginClient)e.Current).Character.Name);
                    pkg.Write((string)((LoginClient)e.Current).Character.GuildName);
                    pkg.Write((int)((LoginClient)e.Current).Character.Level);
                    pkg.Write((int)((LoginClient)e.Current).Character.Class);
                    pkg.Write((int)((LoginClient)e.Current).Character.Race);
                    pkg.Write((int)((LoginClient)e.Current).Character.Zone);
                    pkg.Write((int)((LoginClient)e.Current).Character.GroupLook);
                }
                catch (Exception)
                {
                }
            }
            whoClient.Send(pkg);
        }
Exemple #5
0
        public static void System(string msg)
        {
            BinWriter pkg = LoginClient.NewPacket(SMSG.MESSAGECHAT);

            pkg.Write((byte)CHATMESSAGETYPE.SYSTEM);
            pkg.Write((int)0);
            pkg.Write((ulong)0);
            pkg.Write(msg);
            pkg.Write((byte)0);
            LoginServer.BroadcastPacket(pkg);
        }
Exemple #6
0
        public static void System(LoginClient client, string msg)
        {
            BinWriter pkg = LoginClient.NewPacket(SMSG.MESSAGECHAT);

            pkg.Write((byte)CHATMESSAGETYPE.SYSTEM);
            pkg.Write((int)0);
            pkg.Write((ulong)0);
            pkg.Write(msg);
            pkg.Write((byte)0);
            client.Send(pkg);
        }
        public static void GuildSay(uint from, LoginClient client, string msg, CHATMESSAGETYPE mtype)
        {
            BinWriter pkg = LoginClient.NewPacket(SMSG.MESSAGECHAT);

            pkg.Write((byte)mtype);
            pkg.Write((int)0);
            pkg.Write((ulong)from);
            pkg.Write((int)msg.Length + 1);
            pkg.Write(msg);
            pkg.Write((byte)0);
            client.Send(pkg);
        }
        static bool OnPlayerLogoutCancel(LoginClient client, CMSG msgID, BinReader data)
        {
            BinWriter pkg = LoginClient.NewPacket(SMSG.LOGOUT_CANCEL_ACK);

            client.Send(pkg);
            client.Send(pkg);
            client.IsLoggingOut = false;
            if (logOutEvent != null)
            {
                EventManager.RemoveEvent(logOutEvent);
                logOutEvent = null;
            }
            return(true);
        }
Exemple #9
0
        void SendConfigCRC()
        {
            BinWriter w = LoginClient.NewPacket(SMSG.UI_CONFIG_MD5);

            if (m_character.UIConfig0 == string.Empty)
            {
                w.Write(new byte[0x10]);
            }
            else
            {
                w.Write(HashConfig(m_character.UIConfig0));
            }
            if (m_character.UIConfig1 == string.Empty)
            {
                w.Write(new byte[0x10]);
            }
            else
            {
                w.Write(HashConfig(m_character.UIConfig1));
            }
            if (m_character.UIConfig2 == string.Empty)
            {
                w.Write(new byte[0x10]);
            }
            else
            {
                w.Write(HashConfig(m_character.UIConfig2));
            }
            if (m_character.UIConfig3 == string.Empty)
            {
                w.Write(new byte[0x10]);
            }
            else
            {
                w.Write(HashConfig(m_character.UIConfig3));
            }
            if (m_character.UIConfig4 == string.Empty)
            {
                w.Write(new byte[0x10]);
            }
            else
            {
                w.Write(HashConfig(m_character.UIConfig4));
            }
            Send(w);
        }
Exemple #10
0
        public void SendConfig(int type)
        {
            string config = string.Empty;

            switch (type)
            {
            case 0:
                config = m_character.UIConfig0;
                break;

            case 1:
                config = m_character.UIConfig1;
                break;

            case 2:
                config = m_character.UIConfig2;
                break;

            case 3:
                config = m_character.UIConfig3;
                break;

            case 4:
                config = m_character.UIConfig4;
                break;

            default:
                return;
            }
            BinWriter w = LoginClient.NewPacket(SMSG.UI_CONFIG);

            w.Write(type);
            if (config == string.Empty)
            {
                w.Write(0);
                Send(w);
                return;
            }
            byte[] data = System.Text.ASCIIEncoding.ASCII.GetBytes(config);
            w.Write(data.Length);
            w.Write(ZLib.Compress(data));
            Send(w);
        }
Exemple #11
0
        public static void Whisper(LoginClient from, LoginClient to, string msg)
        {
            BinWriter pkg = LoginClient.NewPacket(SMSG.MESSAGECHAT);

            pkg.Write((byte)CHATMESSAGETYPE.WHISPER);
            pkg.Write((int)0);                         // language
            pkg.Write((ulong)from.Character.ObjectId); // guid
            pkg.Write(msg);
            pkg.Write((byte)0);                        // status flags 1: afk, 2: dnd, 3: gm
            to.Send(pkg);

            pkg = LoginClient.NewPacket(SMSG.MESSAGECHAT);
            pkg.Write((byte)CHATMESSAGETYPE.WHISPER_INFORM);
            pkg.Write((int)0);
            pkg.Write((ulong)to.Character.ObjectId);
            pkg.Write(msg);
            pkg.Write((byte)0);
            from.Send(pkg);
        }
        static bool OnItemQuerySingle(LoginClient client, CMSG msgID, BinReader data)
        {
            uint           id       = data.ReadUInt32();
            DBItemTemplate template = (DBItemTemplate)DataServer.Database.FindObjectByKey(typeof(DBItemTemplate), id);

            if (template == null)
            {
                Console.WriteLine("Client requested an item template that didn't exist:" + id);
                return(true);
            }
            BinWriter w = LoginClient.NewPacket(SMSG.ITEM_QUERY_SINGLE_RESPONSE);

            w.Write(id);
            foreach (SerializeValue value in itemTemplateValues)
            {
                value.Serialize(template, w);
            }
            client.Send(w);
            return(true);
        }
        static bool OnNameQuery(LoginClient client, CMSG msgID, BinReader data)
        {
            uint        id    = data.ReadUInt32();
            LoginClient other = LoginServer.GetLoginClientByCharacterID(id);

            if (other == null)
            {
                client.Close("Tried to query a char that wasn't online.");
                return(true);
            }
            BinWriter pkg = LoginClient.NewPacket(SMSG.NAME_QUERY_RESPONSE);

            pkg.Write(other.Character.ObjectId);
            pkg.Write(0);             // high id
            pkg.Write(other.Character.Name);
            pkg.Write((int)other.Character.Race);
            pkg.Write((int)other.Character.Gender);
            pkg.Write((int)other.Character.Class);
            client.Send(pkg);
            return(true);
        }
        /*
         * internal bool processWorldServerData()
         * {
         *      if(m_client.PendingSendData)
         *              m_client.SendWork();
         *      if(m_client.Connected == false)
         *              return false;
         *      byte[] data;
         *      while((data = m_client.GetNextPacketData()) != null)
         *              OnWorldServerData(data);
         *      return m_client.Connected;
         * }*/

        private void OnWorldServerData(ClientBase c, byte[] data)
        {
            BinReader read = new BinReader(data);

            read.BaseStream.Position += 4;             // skip len
            WORLDMSG msgID = (WORLDMSG)read.ReadInt32();

            if (msgID == WORLDMSG.SERVER_MESSAGE)
            {
                SMSG smsg = (SMSG)read.ReadInt32();
                Console.WriteLine("WorldServer sent: " + smsg);
                int       len = read.ReadInt32();
                BinWriter pkg = LoginClient.NewPacket(smsg);
                if (len > 0)
                {
                    pkg.Write(read.ReadBytes(len));
                }
                while (read.BaseStream.Position < read.BaseStream.Length)
                {
                    uint        plrID  = read.ReadUInt32();
                    LoginClient client = LoginServer.GetLoginClientByCharacterID(plrID);
                    if (client == null)
                    {
                        Console.WriteLine("client missing for plrID " + plrID + " while sending " + smsg.ToString());
                    }
                    else
                    {
                        client.Send(pkg);
                    }
                }
            }
            else if (msgID == WORLDMSG.SCRIPT_MESSAGE)
            {
                LoginServer.Scripts.OnScriptMessage(read.ReadInt32(), read);
            }
            else
            {
                LoginPacketManager.HandlePacket(this, msgID, read);
            }
        }
        internal static void ChangeMap(LoginClient client)
        {
            client.WorldConnection = (WorldConnection)m_worldMapServer[client.Character.WorldMapID];
            if (client.WorldConnection == null)
            {
                client.Close("(ChangeMap) Missing worldserver for world map id " + client.Character.WorldMapID);
                return;
            }

            DBWorldMap map = (DBWorldMap)DataServer.Database.FindObjectByKey(typeof(DBWorldMap), client.Character.WorldMapID);

            client.Character.Continent = (uint)map.Continent;

            BinWriter pkg = LoginClient.NewPacket(SMSG.NEW_WORLD);

            pkg.Write((byte)client.Character.Continent);
            pkg.WriteVector(client.Character.Position);
            pkg.Write(client.Character.Facing);
            client.Send(pkg);
            FriendIsOnline(client);
            client.WorldConnection.OnEnterWorld(client.Character, client.Account.AccessLvl);
        }
Exemple #16
0
        internal void OnEnterWorld()
        {
            BinWriter w = LoginClient.NewPacket(SMSG.TUTORIAL_FLAGS);

            for (int i = 0; i < 8; i++)
            {
                w.Write(-1);
            }
            Send(w);

            SendConfigCRC();
            // Send initial spells
            initialSpells();
            w = LoginClient.NewPacket(SMSG.ACTION_BUTTONS);
            w.Write(new byte[0x1E0]);
            Send(w);
            Chat.System(this, "Connected to " + LoginServer.ServerName);
            Chat.System(this, "This server is running WoWDaemon 0.1");
            Chat.System(this, "Users Online: " + LoginServer.CurrentUsers +
                        " Total Users Online This Session: " + LoginServer.TopUsers);
            m_worldServer.OnEnterWorld(m_character);
        }
        static bool OnNameQuery(LoginClient client, CMSG msgID, BinReader data)
        {
            ulong       uid   = data.ReadUInt32();
            BinWriter   pkg   = LoginClient.NewPacket(SMSG.NAME_QUERY_RESPONSE);
            uint        id    = (uint)uid;
            LoginClient other = LoginServer.GetLoginClientByCharacterID(id);

            if (other == null)
            {
                DataObject[] objTemp = DataServer.Database.SelectObjects(typeof(DBCharacter), "Character_ID = '" + id + "'");
                if (objTemp.Length == 0)
                {
                    Console.WriteLine("Character not found");
                }
                else
                {
                    DBCharacter objCharacter = (DBCharacter)objTemp[0];
                    pkg.Write((ulong)objCharacter.ObjectId);
//					pkg.Write((uint)0); // high id
                    pkg.Write(objCharacter.Name);
                    pkg.Write((int)objCharacter.Race);
                    pkg.Write((int)objCharacter.Gender);
                    pkg.Write((int)objCharacter.Class);
                    client.Send(pkg);
                }
                return(true);
            }
            pkg.Write((ulong)other.Character.ObjectId);
//			pkg.Write((uint)0); // high id
//			pkg.Write(0);
            pkg.Write(other.Character.Name);
            pkg.Write((int)other.Character.Race);
            pkg.Write((int)other.Character.Gender);
            pkg.Write((int)other.Character.Class);
            client.Send(pkg);
            return(true);
        }
        static void OnPlayerLeaveWorld(WorldConnection connection, WORLDMSG msgID, BinReader data)
        {
            LoginClient client = LoginServer.GetLoginClientByCharacterID(data.ReadUInt32());

            if (client == null)
            {
                return;
            }
            if (client.IsLoggingOut)
            {
                LoginServer.RemoveCharacter(client);
                BinWriter pkg = LoginClient.NewPacket(SMSG.LOGOUT_COMPLETE);
                client.Send(pkg);
                client.IsLoggingOut    = false;
                client.WorldConnection = null;
            }
            else if (client.IsChangingMap)
            {
            }
            else
            {
                client.Close("Kicked from worldserver.");
            }
        }
Exemple #19
0
        internal void OnEnterWorld()
        {
//			MyOnEnterWorld();
            return;

            Console.WriteLine("WORLD: Player entering world.");
            Console.WriteLine("WORLD: SMSG.ACCOUNT_DATA_MD5");
            // Handle SMSG.ACCOUNT_DATA_MD5. Send out 80 nulls.
            BinWriter w = LoginClient.NewPacket(SMSG.ACCOUNT_DATA_MD5);

            for (int i = 0; i < 80; i++)
            {
                w.Write((uint)0);
            }
            Send(w);

            // Handle MOTD
            Console.WriteLine("WORLD: MOTD");
            Chat.System(this, "Welcome to " + LoginServer.ServerName);
            Chat.System(this, "This server is running off of iWoW SVN.");

            // Handle Action Buttons
            Console.WriteLine("WORLD: SMSG.ACTION_BUTTONS");
            w = LoginClient.NewPacket(SMSG.ACTION_BUTTONS);

            /*w.Write((byte)1);
            *  w.Write((uint)0);
            *  w.Write((byte)0);*/
            w.Write((new byte[0x1E0]));
            Send(w);

            // Handle Rest State
            Console.WriteLine("WORLD: SMSG.SET_REST_START");
            w = LoginClient.NewPacket(SMSG.SET_REST_START);

            /*w.Write((byte)1);
            *  w.Write((uint)0);
            *  w.Write((byte)0);*/
            w.Write((long)0x466);
            Send(w);

            // Handle Initial Spells
            Console.WriteLine("WORLD: Initial Spells sent.");
            if ((Character.Spells == null) || (Character.Spells.Length == 0))
            {
                return;
            }
            int slotNum = 1;

            w = LoginClient.NewPacket(SMSG.INITIAL_SPELLS);

            /*w.Write((byte)1);
            *  w.Write((uint)0);
            *  w.Write((byte)0);*/
            w.Write((char)0); // ?
            w.Write((ushort)this.Character.Spells.Length);
            foreach (DBKnownSpell knownSpell in this.Character.Spells)
            {
                try
                {
                    // Spell ID
                    w.Write((ushort)knownSpell.Spell_Id);
                    // Slot number
                    w.Write((short)knownSpell.Slot);
                    slotNum++;
                }
                catch (Exception) { }
            }
            w.Write((short)0x00);
            Send(w);

            // Handle CMSG.UPDATE_ACCOUNT_DATA. Send out 50 nulls.
            w = LoginClient.NewPacket(SMSG.UPDATE_ACCOUNT_DATA);
            for (int i = 0; i < 50; i++)
            {
                w.Write((uint)0);
            }
            Send(w);

            w = LoginClient.NewPacket(SMSG.SET_REST_START);
            w.Write((uint)123);
            Send(w);

            // Data stolen from WowwoW. I don't know what it means.
            w = LoginClient.NewPacket(SMSG.TUTORIAL_FLAGS);
            byte[] tutorial_flag_data =
            {
                0,    0x22,    0,    0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
                0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
                0xff, 0xff, 0xff, 0xff
            };
            w.Write(tutorial_flag_data);
            Send(w);
        }
Exemple #20
0
        internal void MyOnEnterWorld()
        {
            Console.WriteLine("WORLD: Player entering world... sephs code");

            BinWriter packet = LoginClient.NewPacket(SMSG.RWHOIS);

            byte[] buffer = new byte[84];             // I don't know what this is for
            packet.Write(buffer);
            Send(packet);

            packet = LoginClient.NewPacket(SMSG.IGNORE_LIST);
            buffer = new byte[6];
            packet.Write(buffer);
            Send(packet);

            packet = LoginClient.NewPacket(SMSG.FRIEND_LIST);
            packet.Write((int)0);
            Send(packet);

            packet = LoginClient.NewPacket(SMSG.BINDPOINTUPDATE);
            packet.Write(Character.Position.X);
            packet.Write(Character.Position.Y);
            packet.Write(Character.Position.Z);
            packet.Write(Character.WorldMapID);
            packet.Write(Character.Zone);
            Console.WriteLine("Binding character at {0} {1} {2}", Character.Position, Character.WorldMapID, Character.Zone);
//			packet.Write((float)9859.089844);
//			packet.Write((float)588.760986);
//			packet.Write((float)1300.609985);
//			packet.Write((ushort)1);
//			packet.Write((uint)1); // Change me (zoneid!)
            Send(packet);
//			this.Character.Position.X, Y, z instead? :)


            packet = LoginClient.NewPacket(SMSG.SET_REST_START);
            packet.Write((uint)17);             // in seconds...
            Send(packet);

            packet = LoginClient.NewPacket(SMSG.SET_FLAT_SPELL_MODIFIER);
            packet.Write(new byte[] { 0, 0, 0, 0, 6, 10, 0x38, 0xff, 0xff, 0xff });
            Send(packet);

            packet = LoginClient.NewPacket(SMSG.TUTORIAL_FLAGS);
            packet.Write(new byte[] {
                0, 0x22, 0, 0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
                0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
                0xff, 0xff, 0xff, 0xff
            });
            Send(packet);

            packet = LoginClient.NewPacket(SMSG.INITIAL_SPELLS);
            packet.Write((char)0);
            packet.Write((ushort)this.Character.Spells.Length);
            int slotNum = 1;

            foreach (DBKnownSpell knownSpell in this.Character.Spells)
            {
                // Spell ID
                packet.Write((ushort)knownSpell.Spell_Id);
                // Slot number
                packet.Write((short)knownSpell.Slot);
                slotNum++;
            }
            packet.Write((short)0x00);
            Send(packet);

            packet = LoginClient.NewPacket(SMSG.ACTION_BUTTONS);
            packet.Write(new byte[0x1E0]);             // ?????
            Send(packet);

            packet = LoginClient.NewPacket(SMSG.LOGIN_SETTIMESPEED);
            packet.Write(new byte[] { 0, 10, 0, 0, 12, 0xc9, 0x16, 5, 0x89, 0x88, 0x88, 60 });
            Send(packet);

            packet = LoginClient.NewPacket(SMSG.CORPSE_RECLAIM_DELAY);
            packet.Write(new byte[] { 1, 70, 0x22, 1, 0, 0, 0, 0 });
            Send(packet);

//			packet = LoginClient.NewPacket(SMSG.LOGIN_SETTIMESPEED);
//			packet.Write(GetActualTime());
//			packet.Write(0.017f);
//			Send(packet);
        }
Exemple #21
0
/*
 *              void initialSpells()
 *              {
 *                      if((Character.Spells == null) || (Character.Spells.Length == 0))
 *                      {
 *                              return;
 *                      }
 *                      int slotNum = 1;
 *                      BinWriter w = LoginClient.NewPacket(SMSG.INITIAL_SPELLS);
 *                      // Unknow byte
 *                      w.Write((byte)0);
 *                      // Number of abilites/spells
 *                      w.Write((ushort)this.Character.Spells.Length);
 *                      foreach(DBKnownSpell knownSpell in this.Character.Spells)
 *                      {
 *                              try
 *                              {
 *                                      // Spell ID : Defensive Stance
 *                                      w.Write((ushort) knownSpell.Spell_Id);
 *                                      // Slot Number
 *                                      w.Write((short)knownSpell.Slot);
 *                                      slotNum++;
 *                              }
 *                              catch (Exception){}//{Chat.System(client, e.InnerException.Message);}
 *                      }
 *                      w.Write((byte)0x00);
 *                      w.Write((byte)0x00);
 *                      Send(w);
 *              }
 */
        void initialSpells()
        {
            Console.WriteLine(Character.Class.ToString());
            BinWriter w = null;

            switch (this.Character.Class)
            {
            case CLASS.WARRIOR:
                w = LoginClient.NewPacket(SMSG.INITIAL_SPELLS);
                // Unknow byte
                w.Write((byte)0);
                // Number of abilites/spells
                w.Write((ushort)3);
                // Spell ID : Defensive Stance
                w.Write((ushort)71);
                // Slot Number
                w.Write((short)1);
                // Spell ID : Berserker Stance
                w.Write((ushort)2458);
                // Slot Number
                w.Write((short)2);
                // Spell ID : WhirlWind
                w.Write((ushort)1680);
                // Slot Number
                w.Write((short)3);
                w.Write((byte)0x00);
                w.Write((byte)0x00);
                Send(w);
                break;

            case CLASS.PALADIN:
                w = LoginClient.NewPacket(SMSG.INITIAL_SPELLS);
                // Unknow byte
                w.Write((byte)0);
                // Number of abilites/spells
                w.Write((ushort)3);
                // Spell ID : Divine Shield
                w.Write((ushort)642);
                // Slot Number
                w.Write((short)1);
                // Spell ID : Devotion Aura
                w.Write((ushort)465);
                // Slot Number
                w.Write((short)2);
                // Spell ID : Holy Light
                w.Write((ushort)635);
                // Slot Number
                w.Write((short)3);
                w.Write((byte)0x00);
                w.Write((byte)0x00);
                Send(w);
                break;

            case CLASS.HUNTER:
                w = LoginClient.NewPacket(SMSG.INITIAL_SPELLS);
                // Unknow byte
                w.Write((byte)0);
                // Number of abilites/spells
                w.Write((ushort)3);
                // Spell ID : Beast Tracking
                w.Write((ushort)1494);
                // Slot Number
                w.Write((short)1);
                // Spell ID : Beast Soothe
                w.Write((ushort)1513);
                // Slot Number
                w.Write((short)2);
                // Spell ID : Beast Taming
                w.Write((ushort)1515);
                // Slot Number
                w.Write((short)3);
                w.Write((byte)0x00);
                w.Write((byte)0x00);
                Send(w);
                break;

            case CLASS.ROGUE:
                w = LoginClient.NewPacket(SMSG.INITIAL_SPELLS);
                // Unknow byte
                w.Write((byte)0);
                // Number of abilites/spells
                w.Write((ushort)3);
                // Spell ID : Backstab
                w.Write((ushort)53);
                // Slot Number
                w.Write((short)1);
                // Spell ID : Stealth
                w.Write((ushort)1784);
                // Slot Number
                w.Write((short)2);
                // Spell ID : Dual Wield
                w.Write((ushort)674);
                // Slot Number
                w.Write((short)3);
                w.Write((byte)0x00);
                w.Write((byte)0x00);
                Send(w);
                break;

            case CLASS.PRIEST:
                w = LoginClient.NewPacket(SMSG.INITIAL_SPELLS);
                // Unknow byte
                w.Write((byte)0);
                // Number of abilites/spells
                w.Write((ushort)3);
                // Spell ID : Sleep
                w.Write((ushort)700);
                // Slot Number
                w.Write((short)1);
                // Spell ID : Lesser Heal
                w.Write((ushort)2050);
                // Slot Number
                w.Write((short)2);
                // Spell ID : Shadow Word: Pain
                w.Write((ushort)589);
                // Slot Number
                w.Write((short)3);
                w.Write((byte)0x00);
                w.Write((byte)0x00);
                Send(w);
                break;

            case CLASS.SHAMAN:
                w = LoginClient.NewPacket(SMSG.INITIAL_SPELLS);
                // Unknow byte
                w.Write((byte)0);
                // Number of abilites/spells
                w.Write((ushort)3);
                // Spell ID : Lightning Bolt
                w.Write((ushort)403);
                // Slot Number
                w.Write((short)1);

                // Spell ID : Lightning SHield
                w.Write((ushort)324);
                // Slot Number
                w.Write((short)2);

                // Spell ID : Healing Wave
                w.Write((ushort)331);
                // Slot Number
                w.Write((short)3);
                w.Write((byte)0x00);
                w.Write((byte)0x00);
                Send(w);
                break;

            case CLASS.MAGE:
                w = LoginClient.NewPacket(SMSG.INITIAL_SPELLS);
                // Unknow byte
                w.Write((byte)0);
                // Number of abilites/spells
                w.Write((ushort)3);
                // Spell ID : Invisibility
                w.Write((ushort)885);
                // Slot Number
                w.Write((short)1);

                // Spell ID : Frost Armor
                w.Write((ushort)168);
                // Slot Number
                w.Write((short)2);

                // Spell ID : FireBall
                w.Write((ushort)133);
                // Slot Number
                w.Write((short)3);
                w.Write((byte)0x00);
                w.Write((byte)0x00);
                Send(w);
                break;

            case CLASS.WARLOCK:
                w = LoginClient.NewPacket(SMSG.INITIAL_SPELLS);
                // Unknow byte
                w.Write((byte)0);
                // Number of abilites/spells
                w.Write((ushort)3);
                // Spell ID : Immolate
                w.Write((ushort)348);
                // Slot Number
                w.Write((short)1);

                // Spell ID : Anti-Magic
                w.Write((ushort)1399);
                // Slot Number
                w.Write((short)2);

                // Spell ID : Infernal
                w.Write((ushort)1413);
                // Slot Number
                w.Write((short)3);
                w.Write((byte)0x00);
                w.Write((byte)0x00);
                Send(w);
                break;

            case CLASS.DRUID:
                w = LoginClient.NewPacket(SMSG.INITIAL_SPELLS);
                // Unknow byte
                w.Write((byte)0);
                // Number of abilites/spells
                w.Write((ushort)3);
                // Spell ID : Polymorph : Pig
                w.Write((ushort)118);
                // Slot Number
                w.Write((short)1);

                // Spell ID : Rejuvenation
                w.Write((ushort)774);
                // Slot Number
                w.Write((short)2);

                // Spell ID : Faerie Fire
                w.Write((ushort)770);
                // Slot Number
                w.Write((short)3);
                w.Write((byte)0x00);
                w.Write((byte)0x00);
                Send(w);
                break;
            }
        }