コード例 #1
0
ファイル: Player.cs プロジェクト: pahpa/PerpetuumServer
        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);
            }
        }
コード例 #2
0
ファイル: Player.cs プロジェクト: pahpa/PerpetuumServer
        public ErrorCodes CheckPvp()
        {
            var zone = Zone;

            Debug.Assert(zone != null);

            if (!HasPvpEffect && (zone.Configuration.Protected || EffectHandler.ContainsEffect(EffectType.effect_syndicate_area)))
            {
                return(ErrorCodes.PvpIsNotAllowed);
            }

            return(ErrorCodes.NoError);
        }
コード例 #3
0
        public void ApplyCurrentEffect()
        {
            if (EffectHandler.ContainsEffect(CurrentEffectType))
            {
                return;
            }

            var builder = NewEffectBuilder().SetType(CurrentEffectType)
                          .SetOwnerToSource()
                          .EnableModifiers(false)
                          .WithTargetSelector(zone => GetTargetUnits());

            OnApplyEffect(builder);
            ApplyEffect(builder);
        }