コード例 #1
0
ファイル: NatureFury.cs プロジェクト: theinfamousrj/ModernUO
        public void Target(IPoint3D point)
        {
            var p   = new Point3D(point);
            var map = Caster.Map;

            if (map == null)
            {
                return;
            }

            if (Region.Find(p, map).GetRegion <HouseRegion>()?.House?.IsFriend(Caster) == false)
            {
                return;
            }

            if (!map.CanSpawnMobile(p.X, p.Y, p.Z))
            {
                Caster.SendLocalizedMessage(501942); // That location is blocked.
            }
            else if (SpellHelper.CheckTown(p, Caster) && CheckSequence())
            {
                var duration = TimeSpan.FromSeconds(Caster.Skills.Spellweaving.Value / 24 + 25 + FocusLevel * 2);

                var nf = new NatureFury();
                BaseCreature.Summon(nf, false, Caster, p, 0x5CB, duration);

                new InternalTimer(nf).Start();
            }

            FinishSequence();
        }
コード例 #2
0
ファイル: NatureFury.cs プロジェクト: pallop/Servuo
        public void Target(IPoint3D point)
        {
            Point3D p   = new Point3D(point);
            Map     map = this.Caster.Map;

            if (map == null)
            {
                return;
            }

            HouseRegion r = Region.Find(p, map).GetRegion(typeof(HouseRegion)) as HouseRegion;

            if (r != null && r.House != null && !r.House.IsFriend(this.Caster))
            {
                return;
            }

            if (!map.CanSpawnMobile(p.X, p.Y, p.Z))
            {
                this.Caster.SendLocalizedMessage(501942); // That location is blocked.
            }
            else if (SpellHelper.CheckTown(p, this.Caster) && this.CheckSequence())
            {
                TimeSpan duration = TimeSpan.FromSeconds(this.Caster.Skills.Spellweaving.Value / 24 + 25 + this.FocusLevel * 2);

                NatureFury nf = new NatureFury();
                BaseCreature.Summon(nf, false, this.Caster, p, 0x5CB, duration);

                new InternalTimer(nf).Start();
            }

            this.FinishSequence();
        }
コード例 #3
0
        public void Target(IPoint3D point)
        {
            //What happens if you cast it on yourself?	OSI ANSWER: You're an idiot for wasting the mana, and it'll just look for another target.
            Mobile  m   = point as Mobile;
            Point3D p   = new Point3D(point);
            Map     map = Caster.Map;

            m_MobileTarg = (m != null);

            BaseHouse house = BaseHouse.FindHouseAt(p, map, 0);

            if (house != null)
            {
                if (!house.IsFriend(Caster))
                {
                    return;
                }
            }
            if (m != null)                           //say "Target can not be seen" if you target directly a mobile, like in OSI
            {
                Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }
            else if (map == null || !map.CanSpawnMobile(p.X, p.Y, p.Z))
            {
                Caster.SendLocalizedMessage(501942);                   // That location is blocked.
            }
            else if (SpellHelper.CheckTown(p, Caster) && (m_MobileTarg ? CheckHSequence(m) : CheckSequence()))
            {
                TimeSpan duration = TimeSpan.FromSeconds(Caster.Skills.Magery.Value / 24 + 25 + FocusLevel * 2);

                if (m == Caster)
                {
                    m = null;
                }

                NatureFury nf = new NatureFury(m);

                BaseCreature.Summon(nf, false, Caster, p, 0x5CB, duration);

                Timer t = null;

                t = Timer.DelayCall(TimeSpan.FromSeconds(5.0), TimeSpan.FromSeconds(5.0), delegate
                {
                    if (!nf.Alive || nf.Deleted || nf.DamageMin > 20)                           //sanity
                    {
                        t.Stop();
                    }

                    nf.DamageMin++;
                    nf.DamageMax++;
                });
            }

            FinishSequence();
        }
コード例 #4
0
        public void Target(IPoint3D point)
        {
            //What happens if you cast it on yourself?	OSI ANSWER: You're an idiot for wasting the mana, and it'll just look for another target.
            Mobile  m   = point as Mobile;
            Point3D p   = new Point3D(point);
            Map     map = Caster.Map;

            m_MobileTarg = (m != null);



            if (!SpellHelper.FindValidSpawnLocation(map, ref p, m_MobileTarg))
            {
                Caster.SendLocalizedMessage(501942);                   // That location is blocked.
            }
            else if (SpellHelper.CheckTown(p, Caster) && (m_MobileTarg ? CheckHSequence(m) : CheckSequence()))
            {
                TimeSpan duration = TimeSpan.FromSeconds(Caster.Skills.Spellweaving.Value / 24 + 25 + FocusLevel * 2);

                if (m == Caster)
                {
                    m = null;
                }

                NatureFury nf = new NatureFury(m);
                BaseCreature.Summon(nf, false, Caster, p, 0x5CB, duration);

                Timer t = null;

                t = Timer.DelayCall(TimeSpan.FromSeconds(5.0), TimeSpan.FromSeconds(5.0), delegate
                {
                    if (!nf.Alive || nf.Deleted || nf.DamageMin > 20)                           //sanity
                    {
                        t.Stop();
                    }

                    nf.DamageMin++;
                    nf.DamageMax++;
                });
            }

            FinishSequence();
        }
コード例 #5
0
ファイル: NatureFury.cs プロジェクト: theinfamousrj/ModernUO
 public InternalTimer(NatureFury nf)
     : base(TimeSpan.FromSeconds(5.0), TimeSpan.FromSeconds(5.0)) =>
コード例 #6
0
ファイル: NatureFury.cs プロジェクト: pallop/Servuo
 public InternalTimer(NatureFury nf)
     : base(TimeSpan.FromSeconds(5.0), TimeSpan.FromSeconds(5.0))
 {
     this.m_NatureFury = nf;
 }