PlaySound() public static méthode

public static PlaySound ( IPoint3D p, Server.Map map, int soundID ) : void
p IPoint3D
map Server.Map
soundID int
Résultat void
Exemple #1
0
        public void CorpseExplosion(Mobile from)
        {
            if (this == null)
            {
                return;
            }
            if (from == null)
            {
                return;
            }

            int bodyParts = 20;

            int minRadius = 1;
            int maxRadius = 8;

            List <Point3D> m_ValidLocations = SpecialAbilities.GetSpawnableTiles(Location, true, false, Location, Map, bodyParts, 20, minRadius, maxRadius, false);

            if (m_ValidLocations.Count == 0)
            {
                return;
            }

            m_NextUseAllowed = DateTime.UtcNow + UsageCooldown;

            for (int a = 0; a < bodyParts; a++)
            {
                Timer.DelayCall(TimeSpan.FromSeconds(a * .025), delegate
                {
                    if (this == null)
                    {
                        return;
                    }
                    if (this.Deleted)
                    {
                        return;
                    }

                    Point3D newLocation = m_ValidLocations[Utility.RandomMinMax(0, m_ValidLocations.Count - 1)];

                    Effects.PlaySound(newLocation, Map, 0x4F1);

                    IEntity effectStartLocation = new Entity(Serial.Zero, Location, Map);
                    IEntity effectEndLocation   = new Entity(Serial.Zero, new Point3D(newLocation.X, newLocation.Y, newLocation.Z + 2), Map);

                    int itemId = Utility.RandomList
                                 (
                        7389, 7397, 7398, 7395, 7402, 7408, 7407, 7393, 7584, 7405, 7585, 7600, 7587, 7602, 7394,
                        7404, 7391, 7396, 7399, 7403, 7406, 7586, 7599, 7588, 7601, 7392, 7392, 7583, 7597, 7390
                                 );

                    Effects.SendMovingEffect(effectStartLocation, effectEndLocation, itemId, 5, 0, false, false, 0, 0);

                    double distance = Utility.GetDistanceToSqrt(Location, newLocation);

                    double destinationDelay = (double)distance * .16;
                    double explosionDelay   = ((double)distance * .16) + 1;

                    Timer.DelayCall(TimeSpan.FromSeconds(destinationDelay), delegate
                    {
                        new Blood().MoveToWorld(new Point3D(newLocation.X + Utility.RandomMinMax(-1, 1), newLocation.Y + Utility.RandomMinMax(-1, 1), newLocation.Z + 2), Map);
                        Effects.SendLocationParticles(EffectItem.Create(newLocation, Map, TimeSpan.FromSeconds(2.0)), itemId, 0, 50, 0, 0, 5029, 0);
                    });

                    Timer.DelayCall(TimeSpan.FromSeconds(explosionDelay), delegate
                    {
                        DetonateCorpse(newLocation, Map);
                    });
                });
            }
        }
Exemple #2
0
        public override bool Use(Mobile user)
        {
            if (this.Movable)
            {
                user.BeginTarget(12, true, Server.Targeting.TargetFlags.None, delegate(Mobile from, object obj) {
                    if (this.Movable && !this.Deleted)
                    {
                        IPoint3D pt = obj as IPoint3D;

                        if (pt != null)
                        {
                            SpellHelper.GetSurfaceTop(ref pt);

                            Point3D origin = new Point3D(pt);
                            Map facet      = from.Map;

                            if (facet != null && facet.CanFit(pt.X, pt.Y, pt.Z, 16, false, false, true))
                            {
                                this.Movable = false;

                                Effects.SendMovingEffect(
                                    from, new Entity(Serial.Zero, origin, facet),
                                    this.ItemID & 0x3FFF, 7, 0, false, false, this.Hue - 1, 0
                                    );

                                Timer.DelayCall(TimeSpan.FromSeconds(0.5), delegate() {
                                    this.Delete();

                                    Effects.PlaySound(origin, facet, 530);
                                    Effects.PlaySound(origin, facet, 263);

                                    Effects.SendLocationEffect(
                                        origin, facet,
                                        14284, 96, 1, 0, 2
                                        );

                                    Timer.DelayCall(TimeSpan.FromSeconds(1.0), delegate() {
                                        List <Mobile> targets = new List <Mobile>();

                                        foreach (Mobile mob in facet.GetMobilesInRange(origin, 12))
                                        {
                                            if (from.CanBeHarmful(mob, false) && mob.InLOS(new Point3D(origin, origin.Z + 1)))
                                            {
                                                if (Faction.Find(mob) != null)
                                                {
                                                    targets.Add(mob);
                                                }
                                            }
                                        }

                                        foreach (Mobile mob in targets)
                                        {
                                            int damage = (mob.Hits * 6) / 10;

                                            if (!mob.Player && damage < 10)
                                            {
                                                damage = 10;
                                            }
                                            else if (damage > 75)
                                            {
                                                damage = 75;
                                            }

                                            Effects.SendMovingEffect(
                                                new Entity(Serial.Zero, new Point3D(origin, origin.Z + 4), facet), mob,
                                                14068, 1, 32, false, false, 1111, 2
                                                );

                                            from.DoHarmful(mob);

                                            SpellHelper.Damage(TimeSpan.FromSeconds(0.50), mob, from, damage / 3, 0, 0, 0, 0, 100);
                                            SpellHelper.Damage(TimeSpan.FromSeconds(0.70), mob, from, damage / 3, 0, 0, 0, 0, 100);
                                            SpellHelper.Damage(TimeSpan.FromSeconds(1.00), mob, from, damage / 3, 0, 0, 0, 0, 100);

                                            Timer.DelayCall(TimeSpan.FromSeconds(0.50), delegate() {
                                                mob.PlaySound(0x1FB);
                                            });
                                        }
                                    });
                                });
                            }
                        }
                    }
                });
            }

            return(false);
        }
            protected override void OnTick()
            {
                if (m_ForebiddenLoreStatue == null)
                {
                    Stop();
                    return;
                }

                if (m_ForebiddenLoreStatue.Deleted)
                {
                    Stop();
                    return;
                }

                if (m_ForebiddenLoreStatue.EffectCount >= m_ForebiddenLoreStatue.EffectMaxCount)
                {
                    m_ForebiddenLoreStatue.Delete();
                    Stop();

                    return;
                }

                m_ForebiddenLoreStatue.EffectCount++;

                Point3D location = m_ForebiddenLoreStatue.Location;
                Map     map      = m_ForebiddenLoreStatue.Map;

                int effectHue = m_ForebiddenLoreStatue.Hue - 1;

                int minDamage = m_ForebiddenLoreStatue.MinDamage;
                int maxDamage = m_ForebiddenLoreStatue.MaxDamage;

                List <Mobile> m_ValidMobiles = new List <Mobile>();

                IPooledEnumerable mobileInRange = m_ForebiddenLoreStatue.Map.GetMobilesInRange(location, m_ForebiddenLoreStatue.Range);

                foreach (Mobile mobile in mobileInRange)
                {
                    if (UOACZRegion.ContainsItem(m_ForebiddenLoreStatue))
                    {
                        if (!UOACZSystem.IsUOACZValidMobile(mobile))
                        {
                            continue;
                        }
                        if (!map.InLOS(location, mobile.Location))
                        {
                            continue;
                        }
                        if (mobile.Hidden)
                        {
                            continue;
                        }
                        if (mobile is UOACZBaseUndead)
                        {
                            continue;
                        }
                        if (mobile is PlayerMobile)
                        {
                            PlayerMobile player = mobile as PlayerMobile;

                            if (player.IsUOACZUndead)
                            {
                                continue;
                            }
                        }

                        m_ValidMobiles.Add(mobile);
                    }

                    else
                    {
                        if (!SpecialAbilities.MonsterCanDamage(null, mobile))
                        {
                            continue;
                        }
                    }
                }

                mobileInRange.Free();

                if (m_ValidMobiles.Count == 0)
                {
                    return;
                }

                Mobile  target         = m_ValidMobiles[Utility.RandomMinMax(0, m_ValidMobiles.Count - 1)];
                Point3D targetLocation = target.Location;

                IEntity startLocation = new Entity(Serial.Zero, new Point3D(location.X, location.Y, location.Z + 14), map);
                IEntity endLocation   = new Entity(Serial.Zero, new Point3D(targetLocation.X, targetLocation.Y, targetLocation.Z + 5), map);

                int particleSpeed = 5;

                Effects.PlaySound(location, map, 0x227);
                Effects.SendMovingParticles(startLocation, endLocation, 0x36D4, particleSpeed, 0, false, false, effectHue, 0, 9501, 0, 0, 0x100);

                Point3D newLocation = new Point3D(location.X, location.Y, location.Z + 14);

                TimedStatic timedStatic = new TimedStatic(0x3779, .5);

                timedStatic.Hue  = effectHue;
                timedStatic.Name = "dissipated energy";
                timedStatic.MoveToWorld(newLocation, map);

                double distance         = Utility.GetDistanceToSqrt(location, targetLocation);
                double destinationDelay = (double)distance * .08;

                Timer.DelayCall(TimeSpan.FromSeconds(destinationDelay), delegate
                {
                    if (m_ForebiddenLoreStatue.Deleted)
                    {
                        return;
                    }
                    if (target == null)
                    {
                        return;
                    }
                    if (target.Deleted || !target.Alive)
                    {
                        return;
                    }
                    if (Utility.GetDistanceToSqrt(m_ForebiddenLoreStatue.Location, targetLocation) >= 30)
                    {
                        return;
                    }

                    int damage = Utility.RandomMinMax(minDamage, maxDamage);

                    if (target is BaseCreature)
                    {
                        damage *= 2;
                    }

                    Effects.PlaySound(location, map, 0x208);

                    target.FixedParticles(0x36BD, 20, 20, 5044, effectHue, 0, EffectLayer.Head);
                    //Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, TimeSpan.FromSeconds(0.5)), 0x3996, 10, 20, effectHue, 0, 5029, 0);

                    new Blood().MoveToWorld(targetLocation, map);
                    AOS.Damage(target, damage, 0, 100, 0, 0, 0);
                });
            }
Exemple #4
0
        public void ShootWebs(Mobile from)
        {
            if (this == null)
            {
                return;
            }
            if (this.Deleted)
            {
                return;
            }
            if (from == null)
            {
                return;
            }

            int websToAdd = 20;

            int minRadius = 1;
            int maxRadius = 8;

            int websValid = 0;

            for (int a = 0; a < websToAdd; a++)
            {
                List <Point3D> m_ValidLocations = SpecialAbilities.GetSpawnableTiles(Location, true, false, Location, Map, 1, 20, minRadius, maxRadius, false);

                if (m_ValidLocations.Count > 0)
                {
                    websValid++;

                    Point3D newLocation = m_ValidLocations[Utility.RandomMinMax(0, m_ValidLocations.Count - 1)];

                    int webId = Utility.RandomList(3811, 3812, 3813, 3814, 4306, 4307, 4308, 4308);

                    IEntity startLocation = new Entity(Serial.Zero, new Point3D(Location.X, Location.Y, Location.Z), Map);
                    IEntity endLocation   = new Entity(Serial.Zero, new Point3D(newLocation.X, newLocation.Y, newLocation.Z), Map);

                    Effects.PlaySound(newLocation, Map, 0x4F1);
                    Effects.SendMovingEffect(startLocation, endLocation, webId, 5, 0, false, false, 0, 0);

                    double distance         = Utility.GetDistanceToSqrt(Location, newLocation);
                    double destinationDelay = (double)distance * .08;

                    Timer.DelayCall(TimeSpan.FromSeconds(destinationDelay), delegate
                    {
                        if (this == null)
                        {
                            return;
                        }
                        if (this.Deleted)
                        {
                            return;
                        }

                        Effects.SendLocationParticles(EffectItem.Create(newLocation, Map, TimeSpan.FromSeconds(15)), webId, 5, 4000, 0, 0, 5029, 0);
                    });
                }
            }

            if (websValid > 0)
            {
                m_NextUseAllowed = DateTime.UtcNow + UsageCooldown;
            }
        }
        public static void FlameCross(Mobile from)
        {
            if (!CanUse(from))
            {
                return;
            }

            Point3D   point  = from.Location;
            Direction d      = Direction.North;
            int       itemid = 0x3996;
            Map       map    = from.Map;

            for (int i = 0; i < 8; i++)
            {
                switch (i)
                {
                case 1:
                {
                    d      = Direction.Right;
                    itemid = 0;
                }
                break;

                case 2:
                {
                    d      = Direction.East;
                    itemid = 0x398C;
                }
                break;

                case 3:
                {
                    d      = Direction.Down;
                    itemid = 0;
                }
                break;

                case 4:
                {
                    d      = Direction.South;
                    itemid = 0x3996;
                }
                break;

                case 5:
                {
                    d      = Direction.Left;
                    itemid = 0;
                }
                break;

                case 6:
                {
                    d      = Direction.West;
                    itemid = 0x398C;
                }
                break;

                case 7:
                {
                    d      = Direction.Up;
                    itemid = 0;
                }
                break;
                }

                for (int j = 0; j < 16; j++)
                {
                    Ability.IncreaseByDirection(ref point, d);

                    if (from.CanSee(point))
                    {
                        // Damage was 2 on the nightmare which has 30~40% fire res. 4 - 35% = 2.6, close enough for me.
                        if (itemid != 0)
                        {
                            new FireFieldSpell.FireFieldItem(itemid, point, from, from.Map, TimeSpan.FromSeconds(30), 1, 100);
                        }
                        else
                        {
                            new OtherFireFieldItem(0x3996, point, from, from.Map, TimeSpan.FromSeconds(30), 1, 80);
                            new OtherFireFieldItem(0x398C, point, from, from.Map, TimeSpan.FromSeconds(30), 1, 80);
                        }
                    }
                }

                point = from.Location;
            }

            Effects.PlaySound(point, map, 0x44B);
        }
Exemple #6
0
        public static void DoMoves(BaseCreature from, Mobile target)
        {
            switch (Utility.Random(3))
            {
            case 0:

                if (Utility.Random(500) <= from.RoarAttack)
                {
                    int power;
                    int mindam;
                    int maxdam;

                    if (from.RoarAttack > 3)
                    {
                        mindam = from.RoarAttack / 3;
                        maxdam = from.RoarAttack / 2;
                    }
                    else
                    {
                        mindam = 1;
                        maxdam = 3;
                    }

                    if (from.RoarAttack > 10)
                    {
                        power = from.RoarAttack / 10;
                    }
                    else
                    {
                        power = 1;
                    }

                    ArrayList targets = new ArrayList();

                    foreach (Mobile m in from.GetMobilesInRange(power))
                    {
                        if (m != from)
                        {
                            targets.Add(m);
                        }
                    }

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

                        if (m is BaseCreature)
                        {
                            BaseCreature bc = (BaseCreature)m;

                            bc.BeginFlee(TimeSpan.FromSeconds(30.0));
                            AOS.Damage(target, from, Utility.RandomMinMax(mindam, maxdam), 20, 20, 20, 20, 20);
                        }
                    }
                }

                break;

            case 1:

                if (Utility.Random(500) <= from.PetPoisonAttack)
                {
                    Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, EffectItem.DefaultDuration), 0x36B0, 1, 14, 63, 7, 9915, 0);
                    Effects.PlaySound(target.Location, target.Map, 0x229);

                    int mindam;
                    int maxdam;

                    if (from.PetPoisonAttack > 3)
                    {
                        mindam = from.PetPoisonAttack / 3;
                        maxdam = from.PetPoisonAttack / 2;
                    }
                    else
                    {
                        mindam = 1;
                        maxdam = 3;
                    }

                    int level = from.PetPoisonAttack / 20;

                    if (level > 5)
                    {
                        level = 5;
                    }

                    target.ApplyPoison(from.ControlMaster, Poison.GetPoison(level));
                    AOS.Damage(target, from, Utility.RandomMinMax(mindam, maxdam), 0, 0, 0, 0, 100);
                }

                break;

            case 2:

                if (Utility.Random(500) <= from.FireBreathAttack)
                {
                    int mindam;
                    int maxdam;

                    if (from.PetPoisonAttack > 3)
                    {
                        mindam = from.PetPoisonAttack / 3;
                        maxdam = from.PetPoisonAttack / 2;
                    }
                    else
                    {
                        mindam = 1;
                        maxdam = 3;
                    }

                    from.MovingParticles(target, 0x36D4, 7, 0, false, true, 9502, 4019, 0x160);
                    from.PlaySound(Core.AOS ? 0x15E : 0x44B);
                    target.FixedParticles(0x3709, 10, 30, 5052, EffectLayer.LeftFoot);
                    target.PlaySound(0x208);

                    AOS.Damage(target, from, Utility.RandomMinMax(mindam, maxdam), 0, 0, 0, 0, 100);

                    Timer t = new FireBreathDOT(target, from, from.FireBreathAttack);
                    t.Start();
                }

                break;
            }
        }