예제 #1
0
            public override void OnAfterDelete()
            {
                base.OnAfterDelete();

                if (_Aura != null)
                {
                    _Aura.Clear();
                    _Aura = null;
                }
            }
예제 #2
0
        protected override void OnThrownAt(Mobile from, Mobile target)
        {
            if (from == null || from.Deleted || target == null || target.Deleted)
            {
                return;
            }

            var fx = new EnergyExplodeEffect(target, target.Map, ExplosionRange)
            {
                EffectHandler = e =>
                {
                    if (e.ProcessIndex != 0)
                    {
                        ExplosionMana(e);
                    }
                }
            };

            fx.Send();

            base.OnThrownAt(from, target);
        }
예제 #3
0
            public override void OnThink()
            {
                base.OnThink();

                if (Deleted || !Alive || !Aspect.InCombat())
                {
                    return;
                }

                if (!this.InCombat() && Utility.RandomDouble() < 0.01)
                {
                    var t = Aspect.AcquireRandomTarget(Aspect.RangePerception);

                    if (t != null)
                    {
                        if (this.PlayAttackAnimation())
                        {
                            this.PlayAttackSound();
                        }

                        MoveToWorld(t.Location, t.Map);
                    }
                }

                if (_Aura == null)
                {
                    _Aura = new EnergyExplodeEffect(Location, Map, 2)
                    {
                        AverageZ      = false,
                        Reversed      = true,
                        Interval      = TimeSpan.FromMilliseconds(500.0),
                        EffectMutator = e =>
                        {
                            if (e.ProcessIndex == 0 && Utility.RandomDouble() < 0.33)
                            {
                                e.SoundID = 252;
                            }

                            e.Hue = Hue;
                        },
                        EffectHandler = HandleAura,
                        Callback      = () =>
                        {
                            if (this.PlayAttackAnimation())
                            {
                                this.PlayAttackSound();
                            }
                        }
                    };
                }

                if (_Aura.Sending || Core.TickCount < _NextAura)
                {
                    return;
                }

                _NextAura = Core.TickCount + 5000;

                _Aura.Start = Location;
                _Aura.Map   = Map;
                _Aura.Send();
            }
예제 #4
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            SkillStudyBook   book   = null;
            ScrollCharCreate scroll = null;
            StatCodex        codex  = null;

            //REMOVE STARTING ITEMS
            foreach (Item item in from.Backpack.Items)
            {
                if (item.GetType() == typeof(SkillStudyBook))
                {
                    book = (SkillStudyBook)item;
                }
                else if (item.GetType() == typeof(ScrollCharCreate))
                {
                    scroll = (ScrollCharCreate)item;
                }
                else if (item.GetType() == typeof(StatCodex))
                {
                    codex = (StatCodex)item;
                }
            }

            if (book != null)
            {
                from.Backpack.RemoveItem(book);
            }

            if (scroll != null)
            {
                from.Backpack.RemoveItem(scroll);
            }

            if (codex != null)
            {
                from.Backpack.RemoveItem(codex);
            }

            //PROCESS
            switch (info.ButtonID)
            {
            case (int)Buttons.Button1:
            {
                var effect = new EnergyExplodeEffect(caller.ToPoint3D(), caller.Map, 7)
                {
                    Reversed = true
                };
                effect.Send();
                caller.SendSound(0x5C9);
                Timer.DelayCall(TimeSpan.FromSeconds(2.2), new TimerCallback(SendToSerpentIsle));
                break;
            }

            case (int)Buttons.Button2:
            {
                caller.CantWalk = false;
                break;
            }
            }
        }