Ejemplo n.º 1
0
        public static void AddSkillPoints(PacketReader packet, PacketBuilder builder, ClientHandler client, EventHandler events)
        {
            var       sync      = client.Metadata["syncServer"] as SyncReceiver;
            var       server    = (int)client.Metadata["server"];
            Character character = client.Metadata["fullchar"] as Character;

            var skill    = packet.ReadUShort();
            var slot     = packet.ReadByte();
            var oldlevel = packet.ReadUShort();
            var newlevel = packet.ReadUShort();

            if ((newlevel == oldlevel + 1) || (newlevel == oldlevel - 1))
            {
                CharacterManagement.UpdateSkillPoints(sync, server, character.id, skill, newlevel, slot);
                builder.New(0x0A56);
                client.Send(builder, "AddSkillPoints");
            }
            else //Punishment for hackers :D
            {
                var map = client.Metadata["map"] as IMap;
                CharacterManagement.UpdatePosition(sync, server, client.AccountID, character.slot, character.map, character.x, character.y);
                client.Disconnect();
            }
        }