コード例 #1
0
        protected virtual void WeatherImpactHandler(MovingEffectInfo info)
        {
            if (info == null || Deleted || !Options.Weather.Impacts || Options.Weather.ImpactEffectID <= 0 ||
                Options.Weather.ImpactEffectSpeed <= 0 || Options.Weather.ImpactEffectDuration <= 0)
            {
                return;
            }

            OnWeatherImpact(info);

            if (Options.Weather.ImpactEffectID <= 0)
            {
                return;
            }

            var effect = new EffectInfo(
                info.Target,
                info.Map,
                Options.Weather.ImpactEffectID,
                Options.Weather.ImpactEffectHue,
                Options.Weather.ImpactEffectSpeed,
                Options.Weather.ImpactEffectDuration,
                Options.Weather.ImpactEffectRender);

            effect.Send();

            OnWeatherImpact(effect);
        }
コード例 #2
0
        private void DropFloor(int index, bool any)
        {
            var i = Floors[index].Count;

            if (!any && i <= 75)
            {
                return;
            }

            Static o;

            do
            {
                o = Floors[index].GetRandom();
            }while (!any && !CanDropFloor(o) && --i >= 0);

            if (!any && !CanDropFloor(o))
            {
                return;
            }

            if (Floors[index].Remove(o))
            {
                var fx = new MovingEffectInfo(
                    o.Location,
                    o.Location.ToPoint3D(-20),
                    Map,
                    o.ItemID,
                    o.Hue,
                    7,
                    EffectRender.SemiTransparent);

                o.Delete();

                fx.Send();

                foreach (var m in fx.Source.FindMobilesAt(fx.Map).OfType <PlayerMobile>().Where(ActiveGroup.Contains))
                {
                    m.Z = -20;
                }
            }
        }
コード例 #3
0
 protected virtual void OnWeatherImpact(MovingEffectInfo info)
 {
 }
コード例 #4
0
            public override void OnThink()
            {
                base.OnThink();

                if (Deleted || !Alive || Aspect == null || !Aspect.InCombat() || Core.TickCount < _NextHeal)
                {
                    return;
                }

                if (ControlMaster != Aspect)
                {
                    ControlMaster = Aspect;
                }

                if (ControlTarget != Aspect)
                {
                    ControlTarget = Aspect;
                }

                if (ControlOrder != OrderType.Follow)
                {
                    ControlOrder = OrderType.Follow;
                }

                if (!InRange(Aspect, Aspect.RangePerception))
                {
                    AIObject.MoveTo(Aspect, true, Aspect.RangePerception);

                    return;
                }

                _NextHeal = Core.TickCount + 5000;

                var q = new MovingEffectQueue();

                q.Callback = q.Dispose;

                for (var i = 0; i < 5; i++)
                {
                    var fx = new MovingEffectInfo(
                        this,
                        Aspect,
                        Map,
                        0x36F4,
                        1150,
                        10,
                        EffectRender.LightenMore,
                        TimeSpan.FromMilliseconds(200));

                    fx.ImpactCallback += HealAspect;

                    q.Add(fx);
                }

                if (this.PlayAttackAnimation())
                {
                    this.PlayAttackSound();

                    this.TryParalyze(
                        TimeSpan.FromSeconds(1.5),
                        m =>
                    {
                        SpellHelper.Turn(m, Aspect);

                        q.Process();
                    });
                }
                else
                {
                    SpellHelper.Turn(this, Aspect);

                    q.Process();
                }
            }