SendMovingEffect() public static method

public static SendMovingEffect ( IEntity from, IEntity to, int itemID, int speed, int duration, bool fixedDirection, bool explodes ) : void
from IEntity
to IEntity
itemID int
speed int
duration int
fixedDirection bool
explodes bool
return void
Ejemplo n.º 1
0
        public static void Vanish(Mobile mobile)
        {
            if (mobile == null)
            {
                return;
            }

            mobile.PlaySound(0x657);

            int projectiles   = 6;
            int particleSpeed = 4;

            for (int a = 0; a < projectiles; a++)
            {
                Point3D newLocation = new Point3D(mobile.X + Utility.RandomList(-5, -4, -3, -2, -1, 1, 2, 3, 4, 5), mobile.Y + Utility.RandomList(-5, -4, -3, -2, -1, 1, 2, 3, 4, 5), mobile.Z);
                SpellHelper.AdjustField(ref newLocation, mobile.Map, 12, false);

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

                Effects.SendMovingEffect(effectStartLocation, effectEndLocation, Utility.RandomList(0x3728), particleSpeed, 0, false, false, 0, 0);
            }
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
0
        public void FireCannon(ShipCannon shipCannon, Mobile from, Point3D targetLocation, Map map, bool hit, bool showSmoke)
        {
            if (shipCannon == null)
            {
                return;
            }

            int cannonballItemID = 0xE73;
            int cannonballHue    = 0;
            int smokeHue         = 0;

            bool fixedDirection = false;

            double shotDelay = .04;
            int    shotSpeed = 6;

            Point3D smokeLocation = shipCannon.Location;

            switch (shipCannon.Facing)
            {
            case Direction.North: { } break;

            case Direction.East: { smokeLocation.X++; } break;

            case Direction.South: { smokeLocation.Y++; } break;

            case Direction.West: { smokeLocation.X--; } break;
            }

            if (m_Boat != null)
            {
                double gunsPercent   = (double)((float)m_Boat.GunPoints / (float)m_Boat.MaxGunPoints);
                double misfireChance = BaseBoat.CannonMaxMisfireChance * (1 - gunsPercent);

                double chance = Utility.RandomDouble();

                double distance     = Utility.GetDistanceToSqrt(shipCannon.Location, targetLocation);
                double flatDistance = Utility.GetDistance(shipCannon.Location, targetLocation);

                //Misfire
                if (chance < misfireChance)
                {
                    List <Mobile> m_MobilesOnBoat = m_Boat.GetMobilesOnBoat(true, true);

                    foreach (Mobile mobile in m_MobilesOnBoat)
                    {
                        if (m_Boat.IsOwner(mobile) || m_Boat.IsCoOwner(mobile) || m_Boat.IsFriend(mobile))
                        {
                            mobile.SendMessage("Misfire!");
                        }
                    }

                    Effects.SendLocationEffect(shipCannon.Location, map, 0x3735, 10);
                    Effects.PlaySound(shipCannon.Location, map, 0x475);

                    return;
                }

                if (m_Boat.MobileFactionType == MobileFactionType.Undead)
                {
                    cannonballItemID = Utility.RandomList(6880, 6881, 6882, 6883, 6884);
                    smokeHue         = 2630;
                }

                //Hit
                if (hit)
                {
                    m_Boat.LastCombatTime = DateTime.UtcNow;

                    Effects.PlaySound(shipCannon.Location, map, 0x664);

                    if (showSmoke)
                    {
                        Effects.SendLocationEffect(smokeLocation, map, 0x36CB, 10, smokeHue, 0);
                    }

                    SpellHelper.AdjustField(ref targetLocation, map, 12, false);

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

                    Effects.SendMovingEffect(startLocation, endLocation, cannonballItemID, shotSpeed, 0, fixedDirection, false, cannonballHue, 0);
                    double effectDelay = distance * shotDelay;

                    Timer.DelayCall(TimeSpan.FromSeconds(effectDelay), delegate
                    {
                        ResolveCannon(shipCannon, from, targetLocation, map, hit);
                    });
                }

                //Miss
                else
                {
                    int xOffset = 0;
                    int yOffset = 0;

                    double effectiveDistance = distance;

                    int distanceOffset = (int)(Math.Floor(effectiveDistance / 2));

                    if (distance >= 2)
                    {
                        xOffset = Utility.RandomMinMax(0, distanceOffset);

                        if (Utility.RandomDouble() > .5)
                        {
                            xOffset *= -1;
                        }

                        yOffset = Utility.RandomMinMax(0, distanceOffset);

                        if (Utility.RandomDouble() > .5)
                        {
                            yOffset *= -1;
                        }
                    }

                    Effects.PlaySound(shipCannon.Location, map, 0x664);
                    Effects.SendLocationEffect(smokeLocation, map, 0x36CB, 10, smokeHue, 0);

                    IEntity startLocation = new Entity(Serial.Zero, new Point3D(shipCannon.Location.X, shipCannon.Location.Y, shipCannon.Location.Z + 10), map);
                    IEntity endLocation   = new Entity(Serial.Zero, new Point3D(targetLocation.X + xOffset, targetLocation.Y + yOffset, targetLocation.Z + 5), map);

                    Effects.SendMovingEffect(startLocation, endLocation, cannonballItemID, shotSpeed, 0, fixedDirection, false, cannonballHue, 0);

                    Point3D splashLocation = new Point3D(targetLocation.X + xOffset, targetLocation.Y + yOffset, +targetLocation.Z);

                    double newDistance = from.GetDistanceToSqrt(splashLocation);
                    double effectDelay = newDistance * shotDelay;

                    Timer.DelayCall(TimeSpan.FromSeconds(effectDelay), delegate
                    {
                        ResolveCannon(shipCannon, from, splashLocation, map, hit);
                    });
                }
            }
        }
Ejemplo n.º 4
0
        public void Activate(Mobile from)
        {
            if (this == null)
            {
                return;
            }
            if (from == null)
            {
                return;
            }

            Point3D m_RuneLocation = from.Location;

            //Necromancer Rune
            m_RuneType = (RuneType)Utility.RandomMinMax(0, 5);

            int runeHue = fireHue;

            switch (m_RuneType)
            {
            case RuneType.Fire: runeHue = fireHue; break;

            case RuneType.Ice: runeHue = iceHue; break;

            case RuneType.Earth: runeHue = earthHue; break;

            case RuneType.Energy: runeHue = energyHue; break;

            case RuneType.Poison: runeHue = poisonHue; break;

            case RuneType.Curse: runeHue = curseHue; break;
            }

            Dictionary <Point3D, int> m_RunePieces = new Dictionary <Point3D, int>();

            m_RunePieces.Add(new Point3D(m_RuneLocation.X - 1, m_RuneLocation.Y - 1, m_RuneLocation.Z), 0x3083);
            m_RunePieces.Add(new Point3D(m_RuneLocation.X - 1, m_RuneLocation.Y, m_RuneLocation.Z), 0x3080);
            m_RunePieces.Add(new Point3D(m_RuneLocation.X, m_RuneLocation.Y - 1, m_RuneLocation.Z), 0x3082);
            m_RunePieces.Add(new Point3D(m_RuneLocation.X + 1, m_RuneLocation.Y - 1, m_RuneLocation.Z), 0x3081);

            m_RunePieces.Add(new Point3D(m_RuneLocation.X - 1, m_RuneLocation.Y + 1, m_RuneLocation.Z), 0x307D);
            m_RunePieces.Add(new Point3D(m_RuneLocation.X, m_RuneLocation.Y, m_RuneLocation.Z), 0x307F);
            m_RunePieces.Add(new Point3D(m_RuneLocation.X + 1, m_RuneLocation.Y, m_RuneLocation.Z), 0x307E);
            m_RunePieces.Add(new Point3D(m_RuneLocation.X, m_RuneLocation.Y + 1, m_RuneLocation.Z), 0x307C);
            m_RunePieces.Add(new Point3D(m_RuneLocation.X + 1, m_RuneLocation.Y + 1, m_RuneLocation.Z), 0x307B);

            foreach (KeyValuePair <Point3D, int> pair in m_RunePieces)
            {
                Blood runePiece = new Blood();
                runePiece.ItemID = pair.Value;
                runePiece.Name   = "a rune";
                runePiece.Hue    = runeHue;
                runePiece.MoveToWorld(pair.Key, Map);
            }

            Blood flame = new Blood();

            flame.ItemID = 0x19AB;
            flame.Name   = "a runeflame";
            flame.Hue    = runeHue;
            flame.MoveToWorld(new Point3D(m_RuneLocation.X, m_RuneLocation.Y, m_RuneLocation.Z), Map);

            Effects.SendLocationParticles(EffectItem.Create(m_RuneLocation, Map, TimeSpan.FromSeconds(0.25)), 0x3709, 10, 125, runeHue, 0, 5029, 0);

            int projectiles = 20;

            int minRadius = 1;
            int maxRadius = 8;

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

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

            m_NextUseAllowed = DateTime.UtcNow + UsageCooldown;

            int    particleSpeed         = 5;   //10
            double distanceDelayInterval = .12; //.08

            for (int a = 0; a < projectiles; a++)
            {
                double distance;
                double destinationDelay;

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

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

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

                    newLocation.Z += 5;

                    switch (m_RuneType)
                    {
                    case RuneType.Fire:
                        Effects.PlaySound(m_RuneLocation, Map, 0x359);
                        Effects.SendMovingEffect(effectStartLocation, effectEndLocation, 0x36D4, particleSpeed, 0, false, false, 0, 0);

                        distance         = Utility.GetDistanceToSqrt(m_RuneLocation, newLocation);
                        destinationDelay = (double)distance * distanceDelayInterval;

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

                            Effects.PlaySound(newLocation, Map, 0x591);
                            Effects.SendLocationParticles(EffectItem.Create(newLocation, Map, TimeSpan.FromSeconds(0.5)), 0x36BD, 20, 10, 5044);
                        });
                        break;

                    case RuneType.Ice:
                        Effects.PlaySound(m_RuneLocation, Map, 0x64F);
                        Effects.SendMovingEffect(effectStartLocation, effectEndLocation, 0x36D4, particleSpeed, 0, false, false, 1153, 0);

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

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

                            Effects.PlaySound(newLocation, Map, 0x208);
                            Effects.SendLocationParticles(EffectItem.Create(newLocation, Map, TimeSpan.FromSeconds(0.25)), 0x3779, 10, 20, 1153, 0, 5029, 0);
                        });
                        break;

                    case RuneType.Earth:
                        int itemId = Utility.RandomList(4963, 4964, 4965, 4966, 4968, 4969, 4971, 4972);

                        Effects.PlaySound(m_RuneLocation, Map, 0x5D3);
                        Effects.SendMovingEffect(effectStartLocation, effectEndLocation, itemId, particleSpeed, 0, false, false, 0, 0);

                        distance         = Utility.GetDistanceToSqrt(m_RuneLocation, newLocation);
                        destinationDelay = (double)distance * distanceDelayInterval;

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

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

                            int mudItems = Utility.RandomMinMax(1, 2);

                            //Rubble
                            Blood dirt  = new Blood();
                            dirt.Name   = "rubble";
                            dirt.ItemID = Utility.RandomList(7681, 7682);

                            Point3D dirtLocation = new Point3D(newLocation.X, newLocation.Y, newLocation.Z);

                            dirt.MoveToWorld(dirtLocation, Map);
                        });
                        break;

                    case RuneType.Energy:
                        Effects.PlaySound(m_RuneLocation, Map, 0x211);
                        Effects.SendMovingEffect(effectStartLocation, effectEndLocation, 0x3818, particleSpeed, 0, false, false, runeHue, 0);

                        distance         = Utility.GetDistanceToSqrt(m_RuneLocation, newLocation);
                        destinationDelay = (double)distance * distanceDelayInterval;

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

                            Effects.PlaySound(newLocation, Map, 0x211);
                            Effects.SendLocationParticles(EffectItem.Create(newLocation, Map, TimeSpan.FromSeconds(5)), 0x3973, 10, 125, 5029);
                        });
                        break;

                    case RuneType.Poison:
                        Effects.PlaySound(m_RuneLocation, Map, 0x22F);
                        Effects.SendMovingEffect(effectStartLocation, effectEndLocation, 0x372A, particleSpeed, 0, false, false, runeHue, 0);

                        distance         = Utility.GetDistanceToSqrt(m_RuneLocation, newLocation);
                        destinationDelay = (double)distance * distanceDelayInterval;

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

                            Effects.PlaySound(newLocation, Map, 0x22F);
                            Effects.SendLocationParticles(EffectItem.Create(newLocation, Map, TimeSpan.FromSeconds(0.25)), 0x372A, 10, 20, runeHue, 0, 5029, 0);
                        });
                        break;

                    case RuneType.Curse:
                        Effects.PlaySound(m_RuneLocation, Map, 0x56E);
                        Effects.SendMovingEffect(effectStartLocation, effectEndLocation, 0x573E, particleSpeed, 0, false, false, 0, 0);

                        distance         = Utility.GetDistanceToSqrt(m_RuneLocation, newLocation);
                        destinationDelay = (double)distance * distanceDelayInterval;

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

                            Effects.PlaySound(newLocation, Map, 0x56E);
                            Effects.SendLocationParticles(EffectItem.Create(newLocation, Map, TimeSpan.FromSeconds(0.25)), 0x376A, 10, 20, runeHue, 0, 5029, 0);
                        });
                        break;
                    }
                });
            }
        }
Ejemplo n.º 5
0
        public void PumpkinExplosion(Mobile from)
        {
            if (this == null)
            {
                return;
            }
            if (from == null)
            {
                return;
            }

            int pumpkins = 100;

            int minRadius = 1;
            int maxRadius = 8;

            List <Point3D> m_ValidLocations = SpecialAbilities.GetSpawnableTiles(from.Location, true, false, from.Location, Map, pumpkins, 50, minRadius, maxRadius, false);

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

            m_NextUseAllowed = DateTime.UtcNow + UsageCooldown;

            Effects.PlaySound(Location, Map, 0x246);

            for (int a = 0; a < pumpkins; 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, Utility.RandomList(0x5D3, 0x5D2, 0x5A2, 0x580));

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

                    int itemId = Utility.RandomList(3178, 3179, 3180);

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

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

                    double destinationDelay = (double)distance * .10;

                    Timer.DelayCall(TimeSpan.FromSeconds(destinationDelay), delegate
                    {
                        Effects.PlaySound(newLocation, Map, Utility.RandomList(0x5DE, 0x5DA, 0x5D8));

                        TimedStatic pumpkinExplosion = new TimedStatic(Utility.RandomList(4650, 4651, 4653, 4655), 5);
                        pumpkinExplosion.Name        = "smashed pumpkin";
                        pumpkinExplosion.Hue         = 1359;
                        pumpkinExplosion.MoveToWorld(newLocation, Map);
                    });
                });
            }
        }
Ejemplo n.º 6
0
 public static void SendMovingEffect(IEntity from, IEntity to, int itemID, int speed, int duration, bool fixedDirection, bool explodes)
 {
     Effects.SendMovingEffect(from, to, itemID, speed, duration, fixedDirection, explodes, 0, 0);
 }
Ejemplo n.º 7
0
        public override void OnGotMeleeAttack(Mobile attacker)
        {
            Point3D location = Location;
            Map     map      = Map;

            if (Utility.RandomDouble() <= .10)
            {
                PlaySound(GetAngerSound());

                FixedParticles(0x375A, 10, 15, 5037, 2499, 0, EffectLayer.Waist);

                PublicOverheadMessage(MessageType.Regular, 0, false, "*transfixes target*");

                SpecialAbilities.PetrifySpecialAbility(1.0, this, attacker, 1.0, 5.0, -1, true, "", "You are transfixed by their gaze!", "-1");
            }

            else if (Utility.RandomDouble() <= .10)
            {
                Combatant = null;

                if (m_Creatures.Count == MaxCreatures)
                {
                    for (int a = 0; a < m_Creatures.Count; a++)
                    {
                        if (m_Creatures[a] == null)
                        {
                            continue;
                        }
                        if (m_Creatures[a].Deleted)
                        {
                            continue;
                        }

                        m_Creatures[a].Delete();
                        break;
                    }
                }

                if (Utility.RandomDouble() <= .66)
                {
                    UOACZGiantBat bat = new UOACZGiantBat();
                    bat.MoveToWorld(location, map);
                    m_Creatures.Add(bat);
                }

                else
                {
                    UOACZVampireBat bat = new UOACZVampireBat();
                    bat.MoveToWorld(location, map);
                    m_Creatures.Add(bat);
                }

                int projectiles   = 6;
                int particleSpeed = 4;

                for (int a = 0; a < projectiles; a++)
                {
                    Point3D newLocation = new Point3D(location.X + Utility.RandomList(-5, -4, -3, -2, -1, 1, 2, 3, 4, 5), location.Y + Utility.RandomList(-5, -4, -3, -2, -1, 1, 2, 3, 4, 5), location.Z);
                    SpellHelper.AdjustField(ref newLocation, map, 12, false);

                    IEntity effectStartLocation = new Entity(Serial.Zero, new Point3D(location.X, location.Y, location.Z + 5), map);
                    IEntity effectEndLocation   = new Entity(Serial.Zero, new Point3D(newLocation.X, newLocation.Y, newLocation.Z + 5), map);

                    Effects.SendMovingEffect(effectStartLocation, effectEndLocation, Utility.RandomList(0x3728), particleSpeed, 0, false, false, 0, 0);
                }

                if (SpecialAbilities.VanishAbility(this, 1.0, true, 0x659, 4, 12, true, null))
                {
                    PublicOverheadMessage(MessageType.Regular, 0, false, "*transforms*");
                }

                Timer.DelayCall(TimeSpan.FromSeconds(.5), delegate
                {
                    if (Deleted || !Alive)
                    {
                        return;
                    }

                    if (Hidden)
                    {
                        RevealingAction();
                    }

                    PlaySound(GetAngerSound());
                });
            }

            base.OnGotMeleeAttack(attacker);
        }
Ejemplo n.º 8
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);
                    });
                });
            }
        }
Ejemplo n.º 9
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;
            }
        }
Ejemplo n.º 10
0
        public static void Warp(BaseCreature creature, PlayerMobile player)
        {
            if (creature == null || player == null)
            {
                return;
            }

            List <Point3D> m_Points = new List <Point3D>();

            m_Points.Add(new Point3D(1323, 1624, 55));  //Britain Throneroom
            m_Points.Add(new Point3D(2674, 2244, -20)); //Buccs Den Tunnels
            m_Points.Add(new Point3D(2187, 1408, -2));  //Cove Orc Fort
            m_Points.Add(new Point3D(1398, 3742, -21)); //Jhelom Fighting Pit
            m_Points.Add(new Point3D(3786, 2246, 20));  //Magincia Parliment
            m_Points.Add(new Point3D(2590, 482, 60));   //Minoc Mountain
            m_Points.Add(new Point3D(4707, 1122, 0));   //Moonglow Telescope
            m_Points.Add(new Point3D(3728, 1360, 5));   //Nujelm Chessboard
            m_Points.Add(new Point3D(3707, 2651, 20));  //Occlo Farmlands
            m_Points.Add(new Point3D(3024, 3536, 35));  //Serpents Hold Farmlands
            m_Points.Add(new Point3D(551, 2119, 0));    //Skara Brae Animal Pen
            m_Points.Add(new Point3D(1906, 2732, 40));  //Trinsic Cafe
            m_Points.Add(new Point3D(3014, 797, 0));    //Vesper Docks
            m_Points.Add(new Point3D(534, 992, 5));     //Yew Center

            player.PlaySound(0x0FE);

            int projectiles   = 6;
            int particleSpeed = 4;

            for (int a = 0; a < projectiles; a++)
            {
                Point3D newLocation = new Point3D(player.X + Utility.RandomList(-5, -4, -3, -2, -1, 1, 2, 3, 4, 5), player.Y + Utility.RandomList(-5, -4, -3, -2, -1, 1, 2, 3, 4, 5), player.Z);
                SpellHelper.AdjustField(ref newLocation, player.Map, 12, false);

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

                Effects.SendMovingEffect(effectStartLocation, effectEndLocation, Utility.RandomList(0x3728), particleSpeed, 0, false, false, 2604, 0);
            }

            player.Location = m_Points[Utility.RandomMinMax(0, m_Points.Count - 1)];

            Timer.DelayCall(TimeSpan.FromSeconds(.5), delegate
            {
                if (player == null)
                {
                    return;
                }

                player.PlaySound(0x0FE);

                projectiles   = 6;
                particleSpeed = 4;

                for (int a = 0; a < projectiles; a++)
                {
                    Point3D newLocation = new Point3D(player.X + Utility.RandomList(-5, -4, -3, -2, -1, 1, 2, 3, 4, 5), player.Y + Utility.RandomList(-5, -4, -3, -2, -1, 1, 2, 3, 4, 5), player.Z);
                    SpellHelper.AdjustField(ref newLocation, player.Map, 12, false);

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

                    Effects.SendMovingEffect(effectStartLocation, effectEndLocation, Utility.RandomList(0x3728), particleSpeed, 0, false, false, 2604, 0);
                }
            });

            if (player.NetState != null)
            {
                player.PrivateOverheadMessage(MessageType.Regular, 0, false, "Egads, how did I get here?", player.NetState);
            }
        }
Ejemplo n.º 11
0
        public static void DrunkardThrowBottle(Mobile from)
        {
            if (from == null)
            {
                return;
            }

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

            int throwSound = 0x5D3;
            int itemId     = Utility.RandomList(2459, 2463, 2503);
            int itemHue    = 0;
            int hitSound   = Utility.RandomList(0x38D, 0x38E, 0x38F, 0x390);

            bool    foundLocation  = false;
            Point3D targetLocation = new Point3D();

            List <Point3D> m_ValidLocations = SpecialAbilities.GetSpawnableTiles(from.Location, true, false, from.Location, from.Map, 1, 25, 2, 8, true);

            if (m_ValidLocations.Count > 0)
            {
                targetLocation = m_ValidLocations[Utility.RandomMinMax(0, m_ValidLocations.Count - 1)];
                foundLocation  = true;

                from.Direction = from.GetDirectionTo(targetLocation);

                Timer.DelayCall(TimeSpan.FromSeconds(.25), delegate
                {
                    if (from == null)
                    {
                        return;
                    }
                    if (!from.Alive)
                    {
                        return;
                    }

                    from.Animate(31, 7, 1, true, false, 0); //Throw Bottle
                    from.PublicOverheadMessage(MessageType.Regular, 0, false, "*drunkenly throws bottle*");
                });
            }

            if (!foundLocation)
            {
                from.PublicOverheadMessage(MessageType.Regular, 0, false, "*drops bottle*");

                TimedStatic bottle = new TimedStatic(Utility.RandomList(0x38D, 0x38E, 0x38F, 0x390), 1);
                bottle.Name = "a drunkard's bottle";
                bottle.MoveToWorld(from.Location, from.Map);

                Effects.PlaySound(targetLocation, map, hitSound);

                return;
            }

            Timer.DelayCall(TimeSpan.FromSeconds(.75), delegate
            {
                if (from == null)
                {
                    return;
                }
                if (!from.Alive)
                {
                    return;
                }

                if (foundLocation)
                {
                    Effects.PlaySound(from.Location, from.Map, throwSound);

                    IEntity startLocation = new Entity(Serial.Zero, new Point3D(from.Location.X, from.Location.Y, from.Location.Z + 10), from.Map);
                    IEntity endLocation   = new Entity(Serial.Zero, new Point3D(targetLocation.X, targetLocation.Y, targetLocation.Z + 5), from.Map);

                    Direction direction = from.GetDirectionTo(targetLocation);

                    double speedModifier = .66;

                    Effects.SendMovingEffect(startLocation, endLocation, itemId, (int)(15 * speedModifier), 0, true, false, itemHue, 0);

                    double distance         = from.GetDistanceToSqrt(targetLocation);
                    double destinationDelay = (double)distance * .08 * (.5 / speedModifier);

                    Timer.DelayCall(TimeSpan.FromSeconds(destinationDelay), delegate
                    {
                        Effects.PlaySound(targetLocation, map, hitSound);
                    });
                }
            });
        }