private void DoSmash(object state)
        {
            object[] states = ((object[])state);
            Point3D  loc    = ((Point3D)states[0]);

            AbilityCollection.AreaEffect(TimeSpan.FromSeconds(0.1), TimeSpan.FromSeconds(0.1), 0.1, Map, loc, 14000, 13, 1102, 2, 1, 3, false, true, false);
            CantWalk = false;
            try
            {
                foreach (Mobile m in this.Map.GetMobilesInRange(loc, 2))
                {
                    if (m != null && m.Alive && m != this)
                    {
                        if (m is Gust)
                        {
                            continue;
                        }
                        m.NonlocalOverheadMessage(Server.Network.MessageType.Emote, 2217, true, "*Is sent flying by the massive strike*");
                        AOS.Damage(m, 75, 100, 0, 0, 0, 0);
                        Gust g = new Gust(this, m, 2.0);
                        g.MoveToWorld(m.Location, m.Map);
                    }
                }
            }
            catch { }
        }
        public override void OnDamage(int amount, Mobile from, bool willKill)
        {
            if (from != this)
            {
                if (willKill)
                {
                    Map     map = this.Map;
                    Point3D loc = this.Location;

                    Effects.PlaySound(loc, map, 0x4F4);
                    AbilityCollection.AreaEffect(TimeSpan.FromSeconds(0.1), TimeSpan.FromSeconds(0.2), .05, map, loc, 14000, 10, 0, 1, 3, 5, true, false, false);

                    ArrayList toExplode = new ArrayList();

                    foreach (Mobile m in this.GetMobilesInRange(3))
                    {
                        toExplode.Add(m);
                    }


                    for (int i = 0; i < toExplode.Count; ++i)
                    {
                        Mobile m = (Mobile)toExplode[i];

                        if (SpellHelper.ValidIndirectTarget(this, m) && this.CanBeHarmful(m, false))
                        {
                            if (this != null)
                            {
                                this.DoHarmful(m);
                            }
                            double distance = m.GetDistanceToSqrt(loc);
                            double falloff  = (100 - (10 * distance)) * .01;
                            int    damage   = (int)(150 * falloff);
                            AOS.Scale(damage, (100 - (int)(10 * distance)));

                            AOS.Damage(m, this, damage, 0, 100, 0, 0, 0);
                        }
                    }
                }
            }
            base.OnDamage(amount, from, willKill);
        }
Beispiel #3
0
 public void DoIceNova()
 {
     AbilityCollection.AreaEffect(TimeSpan.FromSeconds(0.1), TimeSpan.FromSeconds(0.1), 0.1, Map, Location, 14000, 13, 1151, 4, 12, 3, false, true, false);
     Timer.DelayCall(TimeSpan.FromSeconds(1.5), new TimerStateCallback <object>(IceNova_Callback), new object[] { this, Location });
 }
        public static void MeteorFallEffect_Callback(object state)
        {
            object[] states = ((object[])state);
            Mobile   ag     = states[0] as Mobile;
            Point3D  loc    = ((Point3D)states[1]);
            Element  e      = ((Element)states[2]);

            if (ag == null || !ag.Alive || ag.Map == Map.Internal)
            {
                return;
            }
            switch (e)
            {
            case Element.Air:
            {
                int height = 10 + (int)(15 * Utility.RandomDouble());
                //int shape = Utility.RandomList(14026, 14000, 14013);
                //int shape = 2331;
                int     shape = Utility.RandomList(0x0CDE, 0x0CD1, 0x0CDB);
                IEntity to    = new Entity(Serial.Zero, new Point3D(loc.X, loc.Y, loc.Z), ag.Map);
                IEntity from  = new Entity(Serial.Zero, new Point3D(loc.X - 3 + Utility.Random(4), loc.Y - 3 + Utility.Random(4), loc.Z + Utility.Random(4)), ag.Map);
                //Effects.SendMovingEffect(to, from, 14200, 2, 16, false, false, 2740, 3);
                AbilityCollection.AreaEffect(TimeSpan.FromSeconds(0.4), TimeSpan.FromSeconds(0.8), 0.0, to.Map, to.Location, shape, 32, 2988, 5, 3, height, true, true, false);
                Effects.PlaySound(loc, ag.Map, 0x5C6);
            }
            break;

            case Element.Water:
            {
                IEntity to   = new Entity(Serial.Zero, new Point3D(loc.X, loc.Y, loc.Z), ag.Map);
                IEntity from = new Entity(Serial.Zero, new Point3D(loc.X - 1 + Utility.Random(2), loc.Y - 1 + Utility.Random(2), loc.Z + 50), ag.Map);
                Effects.SendMovingEffect(from, to, 14200, 1, 120, true, false);
                Effects.SendLocationEffect(to.Location, to.Map, 10980, 26, 2643, 3);
                Effects.PlaySound(loc, ag.Map, 0x011);
            }
            break;

            case Element.Earth:
            {
                int shape = Utility.RandomMinMax(0x0923, 0x092A);

                IEntity to   = new Entity(Serial.Zero, new Point3D(loc.X + 1 + Utility.Random(2), loc.Y - 14, loc.Z + 3), ag.Map);
                IEntity from = new Entity(Serial.Zero, new Point3D(loc.X - 1 + Utility.Random(2), loc.Y + 14, loc.Z + 6), ag.Map);
                Effects.SendMovingEffect(from, to, shape, 10, 16, true, false);
                //Effects.SendLocationEffect(to.Location, to.Map, 0x2AE4, 16, 1051, 3);
                Effects.PlaySound(loc, ag.Map, 0x015);
            }
            break;

            case Element.Fire:
            {
                int     sound = Utility.RandomMinMax(0x11B, 0x120);
                IEntity to    = new Entity(Serial.Zero, new Point3D(loc.X, loc.Y, loc.Z), ag.Map);
                IEntity from  = new Entity(Serial.Zero, new Point3D(loc.X - 1 + Utility.Random(2), loc.Y - 1 + Utility.Random(2), loc.Z + 50), ag.Map);
                Effects.SendMovingEffect(from, to, 0x36D4, 2, 26, false, false);
                AbilityCollection.AreaEffect(TimeSpan.FromSeconds(0.8), TimeSpan.FromSeconds(0.8), 0.4, to.Map, to.Location, 0x36CB, 16, 0, 0, 2, 0, true, false, false);
                Effects.PlaySound(loc, ag.Map, sound);
            }
            break;
            }
        }
        public override void OnDamage(int amount, Mobile from, bool willKill)
        {
            if (from != this)
            {
                if (willKill)
                {
                    Map     map = this.Map;
                    Point3D loc = this.Location;

                    Effects.PlaySound(loc, map, 0x4F4);
                    AbilityCollection.AreaEffect(TimeSpan.FromSeconds(0.1), TimeSpan.FromSeconds(0.2), .05, map, loc, 14000, 10, 2848, 1, 3, 5, true, false, false);

                    ArrayList toExplode = new ArrayList();

                    foreach (Mobile m in this.GetMobilesInRange(3))
                    {
                        toExplode.Add(m);
                    }


                    for (int i = 0; i < toExplode.Count; ++i)
                    {
                        Mobile m = (Mobile)toExplode[i];

                        if (SpellHelper.ValidIndirectTarget(this, m) && this.CanBeHarmful(m, false))
                        {
                            if (this != null)
                            {
                                this.DoHarmful(m);
                            }
                            double distance = m.GetDistanceToSqrt(loc);
                            double falloff  = (100 - (10 * distance)) * .01;
                            int    damage   = (int)(200 * falloff);
                            AOS.Scale(damage, (100 - (int)(10 * distance)));

                            AOS.Damage(m, this, damage, 0, 0, 0, 100, 0);
                        }
                    }
                }
                else if (Utility.RandomDouble() < .20)
                {
                    Effects.SendTargetEffect(this, 14265, 10, 2848, 0);
                    this.PlaySound(308);


                    ArrayList list = new ArrayList();

                    foreach (Mobile m in this.GetMobilesInRange(1))
                    {
                        list.Add(m);
                    }

                    for (int i = 0; i < list.Count; ++i)
                    {
                        Mobile m = (Mobile)list[i];

                        if (m != this)
                        {
                            if (m == null || m.Deleted || m.Map != this.Map || !m.Alive || !this.Alive || !this.CanSee(m))
                            {
                                continue;
                            }

                            if (this.InLOS(m))
                            {
                                m.SendMessage("The virulent ichor burns your flesh");

                                AOS.Damage(m, this, 50, 0, 0, 0, 100, 0, false);
                            }
                        }
                    }
                }
            }
            base.OnDamage(amount, from, willKill);
        }
Beispiel #6
0
        public void Explode(Mobile from, bool direct, Point3D loc, Map map)
        {
            if (Deleted)
            {
                return;
            }

            Delete();

            if (map == null)
            {
                return;
            }

            Effects.PlaySound(loc, map, 0x207);
            Effects.SendLocationEffect(loc, map, 0x36BD, 20);
            AbilityCollection.AreaEffect(TimeSpan.FromSeconds(0.1), TimeSpan.FromSeconds(0.2), .05, map, loc, 0x36BD, 10, 0, 0);

            IPooledEnumerable eable     = map.GetObjectsInRange(loc, 8);
            ArrayList         toExplode = new ArrayList();

            int toDamage = 0;

            foreach (object o in eable)
            {
                if (o is Mobile)
                {
                    toExplode.Add(o);
                    ++toDamage;
                }
                else if (o is BreakableTile)
                {
                    toExplode.Add(o);
                }
            }

            eable.Free();

            for (int i = 0; i < toExplode.Count; ++i)
            {
                object o = toExplode[i];

                if (o is Mobile)
                {
                    Mobile m = (Mobile)o;

                    if (from == null || (SpellHelper.ValidIndirectTarget(from, m) && from.CanBeHarmful(m, false)))
                    {
                        if (from != null)
                        {
                            from.DoHarmful(m);
                        }
                        double distance = m.GetDistanceToSqrt(loc);
                        double falloff  = (100 - (10 * distance)) * .01;
                        int    damage   = (int)(200 * falloff);
                        AOS.Scale(damage, (100 - (int)(10 * distance)));

                        AOS.Damage(m, from, damage, 0, 100, 0, 0, 0);
                    }
                }
                else if (o is BreakableTile)
                {
                    // *** Modified by Valik for Breakable Wall/Floor tiles
                    BreakableTile bt = (BreakableTile)o;
                    bt.Damage(PotionEffect.ExplosionGreater);
                }
            }
        }
        public static void MoonGate_Callback(object state)
        {
            object[]        states  = ((object[])state);
            GateTravelSpell m_Spell = (GateTravelSpell)states[0];
            int             m_Step  = (int)states[1];
            Point3D         m_Loc   = (Point3D)states[2];
            Map             m_Map   = Map.Felucca;

            if (m_Spell.Runes != 0 && m_Spell.Runes != null && m_Loc.X == 0)
            {
                switch (m_Spell.Runes)
                {
                case 152:
                    m_Loc = new Point3D(3145, 3107, -4);
                    break;

                case 324:
                    m_Loc = new Point3D(3619, 2224, 1);
                    break;

                case 545:
                    m_Loc = new Point3D(3159, 1498, 31);
                    break;

                case 135:
                    m_Loc = new Point3D(4097, 1979, 1);
                    break;

                case 412:
                    m_Loc = new Point3D(3149, 405, 1);
                    break;

                case 345:
                    m_Loc = new Point3D(1083, 2989, -4);
                    break;

                case 213:
                    m_Loc = new Point3D(4582, 282, 1);
                    break;
                }
            }

            if (!m_Spell.Caster.Mounted && m_Spell.Caster.Body.IsHuman)
            {
                m_Spell.Caster.Animate(263, 7, 1, true, false, 0);
            }
            if (m_Step < 3)
            {
                m_Step++;
                Timer.DelayCall(TimeSpan.FromSeconds(1.5), new TimerStateCallback(MoonGate_Callback), new object[] { m_Spell, m_Step, m_Loc });
                AbilityCollection.AreaEffect(TimeSpan.FromSeconds(0.1), TimeSpan.FromSeconds(0.1), 0.1, m_Spell.Caster.Map, (Point3D)m_Spell.Caster.Location, 0x377A, 15, 0, 2, 8, 10, true, false, false);
                if (m_Loc.X != 0)
                {
                    AbilityCollection.AreaEffect(TimeSpan.FromSeconds(0.1), TimeSpan.FromSeconds(0.1), 0.1, m_Map, new Point3D(m_Loc.X, m_Loc.Y, m_Loc.Z + 5), 0x377A, 4, 0, 2, 8, 10, true, false, false);
                }
            }
            else if (m_Loc.X != 0)
            {
                m_Spell.Effect(m_Loc, m_Map, false);
                m_Spell.FinishSequence();
            }
            else
            {
                m_Spell.Caster.SendMessage("You have failed to open a gate to anywhere");
                m_Spell.DoFizzle();
                m_Spell.FinishSequence();
            }
        }
Beispiel #8
0
        public void PyroTarget(IPoint3D p)
        {
            if (!Caster.CanSee(p))
            {
                Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }
            else if (SpellHelper.CheckTown(p, Caster) && CheckSequence())
            {
                SpellHelper.Turn(Caster, p);

                if (p is Item)
                {
                    p = ((Item)p).GetWorldLocation();
                }

                ArrayList targets = new ArrayList();

                Map map = Caster.Map;

                bool    playerVsPlayer = false;
                Point3D loc            = new Point3D(p);
                if (map != null)
                {
                    Effects.SendLocationEffect(loc, map, 0x3709, 30);

                    AbilityCollection.AreaEffect(TimeSpan.FromSeconds(0.3), TimeSpan.FromSeconds(0.6), 0.4, map, loc, 0x36CB, 16, 0, 0, 2, 0, true, false, false);
                    try
                    {
                        IPooledEnumerable eable = map.GetMobilesInRange(new Point3D(p), 2);

                        foreach (Mobile m in eable)
                        {
                            if (Core.AOS && m == Caster)
                            {
                                continue;
                            }
                            if (!map.LineOfSight(m, loc))
                            {
                                continue;
                            }

                            if (SpellHelper.ValidIndirectTarget(Caster, m) && Caster.CanBeHarmful(m, false))
                            {
                                targets.Add(m);

                                if (m.Player)
                                {
                                    playerVsPlayer = true;
                                }
                            }
                        }

                        eable.Free();
                    }
                    catch { }
                }

                double damage = GetNewAosDamage(45, 1, 5, Caster.Player && playerVsPlayer);
                if (targets.Count > 0)
                {
                    for (int i = 0; i < targets.Count; ++i)
                    {
                        Mobile m = (Mobile)targets[i];

                        double toDeal = damage;
                        if (m.GetDistanceToSqrt(loc) > 0)
                        {
                            toDeal = damage / m.GetDistanceToSqrt(loc);
                        }
                        if (!Core.AOS && CheckResisted(m))
                        {
                            toDeal *= 0.5;

                            m.SendLocalizedMessage(501783); // You feel yourself resisting magical energy.
                        }

                        Caster.DoHarmful(m);

                        SpellHelper.Damage(this, m, toDeal, 0, 100, 0, 0, 0);
                    }
                }
            }

            FinishSequence();
        }
Beispiel #9
0
 public void DoIceNova(int damage, Mobile caster, ArrayList targets)
 {
     AbilityCollection.AreaEffect(TimeSpan.FromSeconds(0.1), TimeSpan.FromSeconds(0.1), 0.1, caster.Map, caster.Location, 14000, 13, 2457, 4, 12, 2, true, true, true);
     Timer.DelayCall(TimeSpan.FromSeconds(1.5), new TimerStateCallback(IceNova_Callback), new object[] { caster, caster.Location, damage, targets });
 }