Esempio n. 1
0
        protected override void OnLockStateChanged(Lock @lock)
        {
            base.OnLockStateChanged(@lock);

            if (@lock is UnitLock u)
            {
                var player = u.Target as Player;
                player?.Session.CancelLogout();

                if (@lock.State == LockState.Locked)
                {
                    //  !!
                    //  this will enqueue primary, secondary, and will also fire if a primary is converted to secondary
                    //  !!

                    var npc = u.Target as Npc;

                    if (npc != null)
                    {
                        MissionHandler.EnqueueMissionEventInfo(new LockUnitEventInfo(this, npc, npc.CurrentPosition));
                        MissionHandler.SignalParticipationByLocking(npc.GetMissionGuid());
                    }
                }
            }

            if (@lock.State == LockState.Inprogress && EffectHandler.ContainsEffect(EffectType.effect_invulnerable))
            {
                EffectHandler.RemoveEffectsByType(EffectType.effect_invulnerable);
            }
        }
Esempio n. 2
0
 private void ApplySyndicateAreaEffect(bool apply)
 {
     if (apply)
     {
         var effectBuilder = NewEffectBuilder().SetType(EffectType.effect_syndicate_area);
         ApplyEffect(effectBuilder);
     }
     else
     {
         EffectHandler.RemoveEffectsByType(EffectType.effect_syndicate_area);
     }
 }
Esempio n. 3
0
 private void ApplyHighwayEffect(bool apply)
 {
     if (apply)
     {
         var effectBuilder = NewEffectBuilder().SetType(EffectType.effect_highway)
                             .WithPropertyModifier(ItemPropertyModifier.Create(AggregateField.effect_speed_highway_modifier, 1.0));
         ApplyEffect(effectBuilder);
     }
     else
     {
         EffectHandler.RemoveEffectsByType(EffectType.effect_highway);
     }
 }
 public void RemoveCurrentEffect()
 {
     EffectHandler.RemoveEffectsByType(CurrentEffectType);
     OnEffectRemoved();
 }
Esempio n. 5
0
 public void RemoveSelfTeleportEnablerEffect()
 {
     EffectHandler.RemoveEffectsByType(EffectType.effect_teleport_self_enabler);
 }
Esempio n. 6
0
 public void RemoveInvulnerableEffect()
 {
     EffectHandler.RemoveEffectsByType(EffectType.effect_invulnerable);
 }