Beispiel #1
0
        public void AddPoint(uint id, int point)
        {
            if (!Actabilities.ContainsKey(id))
            {
                return;
            }

            var actability = Actabilities[id];

            actability.Point += point;

            var template = CharacterManager.Instance.GetExpertLimit(actability.Step);

            if (actability.Point > template.UpLimit)
            {
                actability.Point = template.UpLimit;
            }
        }
Beispiel #2
0
        public void Load(MySqlConnection connection)
        {
            using (var command = connection.CreateCommand())
            {
                command.CommandText = "SELECT * FROM actabilities WHERE `owner` = @owner";
                command.Parameters.AddWithValue("@owner", Owner.Id);
                using (var reader = command.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        var id       = reader.GetUInt32("id");
                        var template = CharacterManager.Instance.GetActability(id);

                        var actability = new Actability(template)
                        {
                            Id    = id,
                            Point = reader.GetInt32("point"),
                            Step  = reader.GetByte("step")
                        };
                        Actabilities.Add(actability.Id, actability);
                    }
                }
            }
        }