Esempio n. 1
0
        public void ApplySelfTeleportEnablerEffect(TimeSpan duration)
        {
            var effect = EffectHandler.GetEffectsByType(EffectType.effect_teleport_self_enabler).FirstOrDefault();

            if (effect != null)
            {
                EffectHandler.Remove(effect);
            }

            var builder = NewEffectBuilder().SetType(EffectType.effect_teleport_self_enabler).WithDuration(duration);

            ApplyEffect(builder);
        }
Esempio n. 2
0
        public override void OnUpdateToDb()
        {
            try
            {
                if (!IsRepackaged)
                {
                    DynamicProperties.Update(k.armor, Armor.Ratio(ArmorMax));
                    DynamicProperties.Update(k.currentCore, Core);
                }

                var zone = Zone;
                if (zone == null || States.Dead)
                {
                    return;
                }

                var character = Character;
                character.ZoneId       = zone.Id;
                character.ZonePosition = CurrentPosition;

                var p = DynamicProperties.GetProperty <int>(k.pvpRemaining);

                var pvpEffect = EffectHandler.GetEffectsByType(EffectType.effect_pvp).FirstOrDefault();
                if (pvpEffect == null)
                {
                    p.Clear();
                    return;
                }

                var effectTimer = pvpEffect.Timer;
                if (effectTimer != null)
                {
                    p.Value = (int)effectTimer.Remaining.TotalMilliseconds;
                }
            }
            finally
            {
                base.OnUpdateToDb();
            }
        }