示例#1
0
        public override void Detonate(Mobile m)
        {
            int dam = Utility.RandomMinMax(MinDamage, MaxDamage);

            if (DeploymentType == DeploymentType.Tripwire)
            {
                dam *= 2;
            }

            AOS.Damage(m, Owner, dam, 100, 0, 0, 0, 0);
            Effects.SendLocationEffect(m.Location, m.Map, 0x11AD, 25, 10);
            Effects.PlaySound(m.Location, m.Map, 0x218);

            TransformContext context = TransformationSpellHelper.GetContext(m);

            if (context != null && (context.Type == typeof(LichFormSpell) || context.Type == typeof(WraithFormSpell)) || m is BaseCreature bc && bc.BleedImmune)
            {
                return;
            }

            m.SendLocalizedMessage(1060160); // You are bleeding!
            BleedAttack.BeginBleed(m, Owner, false);

            base.Detonate(m);
        }
示例#2
0
        public void WoundingShot(Mobile attacker, Mobile defender)
        {
            if (Level >= PerkLevel.Fifth)
            {
                int distance = 0;

                for (int x = 0; x <= 12; x++)
                {
                    if (attacker.InRange(defender, x))
                    {
                        distance = x;
                    }
                }

                int woundChance = (int)((attacker.Skills.Anatomy.Value / 8) - (distance / 2));

                if (woundChance >= Utility.RandomMinMax(0, 100))
                {
                    BleedAttack.BeginBleed(defender, attacker);

                    attacker.SendMessage("You wound your opponent, causing them to bleed!");
                    defender.SendMessage("You've been wounded!");
                }
            }
        }
示例#3
0
        public static void OnHit(Mobile attacker, Mobile defender)
        {
            CheckTable();

            int damage;

            if (!HasBleedMod(attacker, out damage) || (_Table != null && _Table.ContainsKey(attacker)))
            {
                return;
            }

            double bleedchance = (attacker.Skills.Ninjitsu.Value + attacker.Skills.Stealth.Value + (MasteryInfo.GetMasteryLevel(attacker, SkillName.Ninjitsu) * 40)) / 3.0 / 15.0;

            if (bleedchance > Utility.RandomDouble())
            {
                BleedAttack.BeginBleed(defender, attacker, false);

                if (_Table == null)
                {
                    _Table = new Dictionary <Mobile, DateTime>();
                }

                _Table[attacker] = DateTime.UtcNow + TimeSpan.FromMinutes(1);
            }
        }
示例#4
0
        public void Injure()
        {
            IsInjured = true;
            CantWalk  = true;

            Rider = null;
            BleedAttack.BeginBleed(this, this);
        }
示例#5
0
        public void RaiseRocks()
        {
            if (this.Map == null)
            {
                return;
            }

            IPooledEnumerable eable  = this.Map.GetMobilesInRange(this.Location, 12);
            List <Mobile>     random = new List <Mobile>();

            foreach (Mobile m in eable)
            {
                if (m.Alive && m is PlayerMobile && SpellHelper.ValidIndirectTarget(this, m) && this.CanBeHarmful(m, false))
                {
                    random.Add(m);
                }
            }

            eable.Free();
            Mobile target = null;

            if (random.Count > 0)
            {
                target = random[Utility.Random(random.Count)];
            }

            if (target != null)
            {
                Direction   d = Utility.GetDirection(this, target);
                Rectangle2D r = new Rectangle2D(target.X - 8, target.Y - 2, 17, 5);

                switch (d)
                {
                case Direction.West:
                    r = new Rectangle2D(this.X - 24, this.Y - 2, 20, 5); break;

                case Direction.North:
                    r = new Rectangle2D(this.X - 2, this.Y - 24, 5, 20); break;

                case Direction.East:
                    r = new Rectangle2D(this.X + 4, this.Y - 2, 20, 5); break;

                case Direction.South:
                    r = new Rectangle2D(this.X - 4, this.Y + 4, 20, 5); break;
                }

                for (int x = r.X; x <= r.X + r.Width; x++)
                {
                    for (int y = r.Y; y <= r.Y + r.Height; y++)
                    {
                        if (x > this.X - 4 && x < this.X + 4 && y > this.Y - 4 && y < this.Y + 4)
                        {
                            continue;
                        }

                        if (0.75 > Utility.RandomDouble())
                        {
                            int id = Utility.RandomList <int>(2282, 2273, 2277, 40106, 40107, 40108, 40106, 40107, 40108, 40106, 40107, 40108);
                            Effects.SendLocationEffect(new Point3D(x, y, this.Map.GetAverageZ(x, y)), this.Map, id, 60);
                        }
                    }
                }

                IPooledEnumerable eable2 = this.Map.GetMobilesInBounds(r);

                foreach (Mobile m in eable2)
                {
                    if (m.Alive && m is PlayerMobile && SpellHelper.ValidIndirectTarget(this, m) && this.CanBeHarmful(m, false))
                    {
                        if (m.X > this.X - 4 && m.X < this.X + 4 && m.Y > this.Y - 4 && m.Y < this.Y + 4)
                        {
                            continue;
                        }

                        m.Freeze(TimeSpan.FromSeconds(2));
                        BleedAttack.BeginBleed(m, this, false);

                        AOS.Damage(target, this, Utility.RandomMinMax(100, 110), 100, 0, 0, 0, 0);
                        m.PrivateOverheadMessage(MessageType.Regular, 0x21, 1156849, m.NetState); // *Rising columns of rock rip through your flesh and concuss you!*
                    }
                }

                eable2.Free();
            }
        }
示例#6
0
        public static void MageAOEEffect(TeiravonMobile from)
        {
            TeiravonMobile player = from;
            int            EffectID;
            int            PhysDam;
            int            FireDam;
            int            ColdDam;
            int            PoisDam;
            int            EnerDam;
            int            Dmg;
            int            MageClass;
            ArrayList      TargList = new ArrayList();

            player.Mana -= 125;

            if (from.IsGeomancer())
            {
                MageClass = 1;
                EffectID  = 0x37FA;
                PhysDam   = 100;
                FireDam   = ColdDam = PoisDam = EnerDam = 0;
            }
            else if (from.IsPyromancer())
            {
                MageClass = 2;
                EffectID  = 0x3709;
                FireDam   = 100;
                PhysDam   = ColdDam = PoisDam = EnerDam = 0;
            }
            else if (from.IsAeromancer())
            {
                MageClass = 3;
                EffectID  = 0x375A;
                EnerDam   = 100;
                FireDam   = ColdDam = PoisDam = PhysDam = 0;
            }
            else             // Aquamancer
            {
                MageClass = 4;
                EffectID  = 0x372B;
                ColdDam   = 100;
                FireDam   = PhysDam = PoisDam = EnerDam = 0;
            }

            for (int xx = -5; xx <= 5; ++xx)
            {
                for (int yy = -5; yy <= 5; ++yy)
                {
                    if (!((xx == 0) && (yy == 0)))
                    {
                        Effects.SendLocationEffect(new Point3D(player.X + xx, player.Y + yy, player.Z), player.Map, EffectID, 13);
                    }
                }
            }

            Dmg = 10 * player.PlayerLevel;

            foreach (Mobile m in player.GetMobilesInRange(5))
            {
                if (m != player)
                {
                    TargList.Add(m);
                }
            }

            if (TargList.Count != 0)
            {
                for (int i = 0; i < TargList.Count; ++i)
                {
                    Mobile m = (Mobile)TargList[i];
                    AOS.Damage(m, player, Dmg, PhysDam, FireDam, ColdDam, PoisDam, EnerDam);

                    switch (MageClass)
                    {
                    case 1:
                        BleedAttack.BeginBleed(m, player);
                        m.SendMessage("The piercing spikes cause you to begin bleeding");
                        break;

                    case 2:
                        m.Stam = (int)(m.Stam / 10);
                        m.SendMessage("The scorching heats drains you of your stamina");
                        break;

                    case 3:
                        m.Mana = (int)(m.Mana / 10);
                        m.SendMessage("The electrifying experience robs your of your ability to concentrate mana");
                        break;

                    case 4:
                        m.Paralyze(m.Player ? TimeSpan.FromSeconds(6.0) : TimeSpan.FromSeconds(6.0));
                        m.SendMessage("The intence cold paralyzes you");
                        break;
                    }
                }
            }
        }
示例#7
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckBSequence(m))
            {
                if (Caster is TeiravonMobile && (((TeiravonMobile)Caster).IsCleric() || ((TeiravonMobile)Caster).IsDarkCleric() || ((TeiravonMobile)Caster).IsStrider() || ((TeiravonMobile)Caster).IsPaladin()) && ((TeiravonMobile)Caster).Faith != TeiravonMobile.Deity.None)
                {
                    TeiravonMobile Cleric = Caster as TeiravonMobile;

                    SpellHelper.Turn(Caster, m);

                    switch (Cleric.Faith)
                    {
                    case TeiravonMobile.Deity.Adalia:
                    {
                        if (!adalia.Contains(m))
                        {
                            adalia.Add(m, DateTime.Now);
                        }
                        if (m_Timer != null)
                        {
                            m_Timer.Stop();
                        }
                        m_Timer = new BlessHelper(m, adalia);
                        m_Timer.Start();

                        m.FixedParticles(0x375A, 10, 15, 5018, EffectLayer.Waist);
                        m.PlaySound(0x30C);
                        m.PlaySound(0x5CB);
                    }
                    break;

                    case TeiravonMobile.Deity.Cultist:
                    {
                        SpellHelper.AddStatBonus(Caster, m, StatType.Str); SpellHelper.DisableSkillCheck = true;
                        SpellHelper.AddStatBonus(Caster, m, StatType.Dex);
                        SpellHelper.AddStatBonus(Caster, m, StatType.Int); SpellHelper.DisableSkillCheck = false;

                        int      mod      = SpellHelper.GetOffset(Caster, m, StatType.Str, false);
                        TimeSpan duration = SpellHelper.GetDuration(Caster, m);

                        if (m is TeiravonMobile)
                        {
                            TeiravonMobile tav = m as TeiravonMobile;
                            tav.HitsMod = mod;
                            BlessTimer timer = new BlessTimer(Caster, (TeiravonMobile)m, duration, mod);
                            timer.Start();
                        }

                        m.FixedParticles(0x373A, 10, 15, 5018, EffectLayer.Waist);
                        m.PlaySound(0x1EA);

                        Caster.Damage(Utility.Random(6));
                    }
                    break;

                    case TeiravonMobile.Deity.Gruumsh:
                    {
                        if (!gruumsh.Contains(m))
                        {
                            gruumsh.Add(m, DateTime.Now);
                        }
                        if (m_Timer != null)
                        {
                            m_Timer.Stop();
                        }
                        m_Timer = new BlessHelper(m, gruumsh);
                        m_Timer.Start();

                        m.FixedParticles(0x375A, 10, 15, 5018, 157, 4, EffectLayer.Waist);
                        BleedAttack.BeginBleed(m, m);
                        m.PlaySound(0x50F);
                        m.PlaySound(0x02B);
                    }
                    break;

                    case TeiravonMobile.Deity.Kamalini:
                    {
                        if (!kamalini.Contains(m))
                        {
                            kamalini.Add(m, DateTime.Now);
                        }
                        if (m_Timer != null)
                        {
                            m_Timer.Stop();
                        }
                        m_Timer = new BlessHelper(m, kamalini);
                        m_Timer.Start();

                        m.FixedParticles(0x375A, 10, 15, 5018, 157, 4, EffectLayer.Waist);
                        m.PlaySound(0x4B7);
                    }
                    break;

                    case TeiravonMobile.Deity.Kinarugi:
                    {
                        if (!kinarugi.Contains(m))
                        {
                            kinarugi.Add(m, DateTime.Now);
                        }
                        if (m_Timer != null)
                        {
                            m_Timer.Stop();
                        }
                        m_Timer = new BlessHelper(m, kinarugi);
                        m_Timer.Start();

                        m.FixedParticles(0x36FE, 10, 15, 5018, 2020, 4, EffectLayer.Waist);
                        m.PlaySound(0x09F);
                        m.PlaySound(0x5C4);
                    }
                    break;

                    case TeiravonMobile.Deity.Lloth:
                    {
                        if (m is TeiravonMobile)
                        {
                            if (!lloth.Contains(m))
                            {
                                lloth.Add(m, DateTime.Now);
                            }
                            if (m_Timer != null)
                            {
                                m_Timer.Stop();
                            }
                            m_Timer = new BlessHelper(m, lloth);
                            m_Timer.Start();

                            Effects.SendLocationParticles(EffectItem.Create(m.Location, m.Map, EffectItem.DefaultDuration), 0x3728, 1, 13, 2869, 1, 5023, 0);
                            m.PlaySound(0x381);
                            m.PlaySound(0x4B0);
                        }
                        else
                        {
                            Caster.SendMessage("You are unable to bless this target.");
                        }
                    }
                    break;

                    case TeiravonMobile.Deity.Narindun:
                    {
                        if (!narindun.Contains(m))
                        {
                            narindun.Add(m, DateTime.Now);
                        }
                        if (m_Timer != null)
                        {
                            m_Timer.Stop();
                        }
                        m_Timer = new BlessHelper(m, narindun);
                        m_Timer.Start();

                        m.FixedParticles(0x3789, 1, 40, 0x3F, 906, 3, EffectLayer.Waist);
                        m.PlaySound(0x029);
                        m.PlaySound(0x5C6);
                    }
                    break;

                    case TeiravonMobile.Deity.Occido:
                    {
                        if (!occido.Contains(m))
                        {
                            occido.Add(m, DateTime.Now);
                        }
                        if (m_Timer != null)
                        {
                            m_Timer.Stop();
                        }
                        m_Timer = new BlessHelper(m, occido);
                        m_Timer.Start();

                        m.FixedParticles(0x3728, 1, 40, 0x3F, 0, 3, EffectLayer.Waist);
                        m.PlaySound(0x5C8);
                    }
                    break;

                    case TeiravonMobile.Deity.Saerin:
                    {
                        if (!saerin.Contains(m))
                        {
                            saerin.Add(m, DateTime.Now);
                        }
                        if (m_Timer != null)
                        {
                            m_Timer.Stop();
                        }
                        m_Timer = new BlessHelper(m, saerin);
                        m_Timer.Start();

                        m.FixedParticles(0x36FE, 10, 15, 5018, 2020, 4, EffectLayer.Waist);
                        m.PlaySound(0x100);
                        m.PlaySound(0x5BE);
                    }
                    break;

                    case TeiravonMobile.Deity.Talathas:
                    {
                        if (!talathas.Contains(m))
                        {
                            talathas.Add(m, DateTime.Now);
                        }
                        if (m_Timer != null)
                        {
                            m_Timer.Stop();
                        }
                        m_Timer = new BlessHelper(m, talathas);
                        m_Timer.Start();

                        m.FixedParticles(0x36FE, 10, 15, 5018, 2020, 4, EffectLayer.Waist);
                        m.PlaySound(0x100);
                        m.PlaySound(0x5C4);
                    }
                    break;

                    case TeiravonMobile.Deity.Valar:
                    {
                        if (!valar.Contains(m))
                        {
                            valar.Add(m, DateTime.Now);
                        }
                        if (m_Timer != null)
                        {
                            m_Timer.Stop();
                        }
                        m_Timer = new BlessHelper(m, valar);
                        m_Timer.Start();

                        m.FixedParticles(0x36FE, 10, 15, 5018, 2020, 4, EffectLayer.Waist);
                        m.PlaySound(0x100);
                        m.PlaySound(0x5C4);
                    }
                    break;

                    case TeiravonMobile.Deity.Jareth:
                    {
                        if (m is TeiravonMobile)
                        {
                            TeiravonMobile tav = m as TeiravonMobile;
                            if (!tav.IsGoblin())
                            {
                                Caster.SendMessage("The Goblin King would never bless that!");
                                return;
                            }
                            if (!jareth.Contains(m))
                            {
                                jareth.Add(m, DateTime.Now);
                            }
                            if (m_Timer != null)
                            {
                                m_Timer.Stop();
                            }
                            m_Timer = new BlessHelper(m, jareth);
                            m_Timer.Start();

                            m.FixedParticles(0x2D92, 10, 15, 5018, 2829, 4, EffectLayer.Waist);
                            m.PlaySound(0x547);
                        }
                        else
                        {
                            Caster.SendMessage("The Goblin King would never bless that!");
                        }
                    }
                    break;
                    }
                }
                else
                {
                    SpellHelper.AddStatBonus(Caster, m, StatType.Str); SpellHelper.DisableSkillCheck = true;
                    SpellHelper.AddStatBonus(Caster, m, StatType.Dex);
                    SpellHelper.AddStatBonus(Caster, m, StatType.Int); SpellHelper.DisableSkillCheck = false;

                    int      mod      = SpellHelper.GetOffset(Caster, m, StatType.Str, false);
                    TimeSpan duration = SpellHelper.GetDuration(Caster, m);

                    if (m is TeiravonMobile)
                    {
                        TeiravonMobile tav = m as TeiravonMobile;
                        tav.HitsMod = mod;
                        BlessTimer timer = new BlessTimer(Caster, (TeiravonMobile)m, duration, mod);
                        timer.Start();
                    }

                    m.FixedParticles(0x373A, 10, 15, 5018, EffectLayer.Waist);
                    m.PlaySound(0x1EA);
                }
            }

            FinishSequence();
        }