SendLocationParticles() public static méthode

public static SendLocationParticles ( IEntity e, int itemID, int speed, int duration, int effect ) : void
e IEntity
itemID int
speed int
duration int
effect int
Résultat void
Exemple #1
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            if (Utility.RandomDouble() <= .15)
            {
                if (defender == null)
                {
                    return;
                }
                if (defender.Deleted || !defender.Alive)
                {
                    return;
                }

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

                double belowDuration = 15;

                double damage = 30;

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

                SpecialAbilities.BleedSpecialAbility(1.0, this, defender, damage, 30, -1, true, "", "", "-1");
                SpecialAbilities.HinderSpecialAbility(1.0, null, defender, 1.0, belowDuration, false, -1, false, "", "You have been 'taken below' and cannot move or speak!", "-1");

                Squelched = true;

                defender.Squelched = true;
                defender.Hidden    = true;

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

                    defender.Squelched = false;
                    defender.Hidden    = false;
                });

                Blessed = true;

                Effects.PlaySound(location, defender.Map, 0x246); //0x0FB

                PublicOverheadMessage(MessageType.Regular, 0, false, "*takes them down below...*");
                SpecialAbilities.HinderSpecialAbility(1.0, null, this, 1.0, belowDuration, false, -1, false, "", "", "-1");

                Effects.SendLocationParticles(EffectItem.Create(location, defender.Map, TimeSpan.FromSeconds(0.25)), 0x3709, 10, 30, 2051, 0, 5029, 0);

                TimedStatic floorHole = new TimedStatic(7025, belowDuration + 1);
                floorHole.Name = "pit to below";
                floorHole.MoveToWorld(location, defender.Map);

                for (int a = 0; a < 6; a++)
                {
                    TimedStatic pitPlasm = new TimedStatic(Utility.RandomList(4650, 4651, 4653, 4654, 4655), belowDuration - 1);
                    pitPlasm.Name = "pit plasm";
                    pitPlasm.Hue  = 2052;

                    Point3D pitPlasmLocation = new Point3D(location.X + Utility.RandomList(-2, 2), location.Y + Utility.RandomList(-2, 2), location.Z);
                    SpellHelper.AdjustField(ref pitPlasmLocation, defender.Map, 12, false);

                    pitPlasm.MoveToWorld(pitPlasmLocation, defender.Map);
                }

                IEntity pitLocationEntity = new Entity(Serial.Zero, new Point3D(defender.X, defender.Y, defender.Z), defender.Map);
                Effects.SendLocationParticles(pitLocationEntity, 0x3709, 10, 60, 2053, 0, 5052, 0);

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

                    MoveToWorld(location, map);

                    for (int a = 0; a < 20; a++)
                    {
                        Timer.DelayCall(TimeSpan.FromSeconds(a * .1), delegate
                        {
                            if (this == null)
                            {
                                return;
                            }
                            if (Deleted || !Alive)
                            {
                                return;
                            }

                            Z--;
                        });
                    }

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

                        Blessed = false;
                        Delete();
                    });
                });
            }
        }
Exemple #2
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;
                    }
                });
            }
        }
Exemple #3
0
        public void ResolveCannonHit(Mobile from, Point3D targetLocation)
        {
            ArrayList validTargets = new ArrayList();

            Map map = Map;

            BaseBoat boatFrom   = BaseBoat.FindBoatAt(from.Location, map);
            BaseBoat targetBoat = BaseBoat.FindBoatAt(targetLocation, map);

            bool hitObject     = false;
            bool hitBoat       = false;
            bool showExplosion = true;

            IPooledEnumerable nearbyMobiles = map.GetMobilesInRange(targetLocation, BaseBoat.CannonExplosionRange);

            foreach (Mobile mobile in nearbyMobiles)
            {
                if (!validTargets.Contains(mobile))
                {
                    validTargets.Add(mobile);
                }
            }

            nearbyMobiles.Free();

            List <Mobile> m_MobilesOnSourceBoat = new List <Mobile>();
            List <Mobile> m_Targets             = new List <Mobile>();

            double baseCannonDamage = (double)(Utility.RandomMinMax(BaseBoat.CannonDamageMin, BaseBoat.CannonDamageMax));

            if (m_Boat == null)
            {
                m_MobilesOnSourceBoat.Add(from);
            }

            else
            {
                baseCannonDamage = m_Boat.CannonDamageScalar * baseCannonDamage;

                m_MobilesOnSourceBoat = m_Boat.GetMobilesOnBoat(false, false);
            }

            bool targetLocationIsBoat = false;

            if (targetBoat != null)
            {
                targetLocationIsBoat = true;
                m_Targets            = targetBoat.GetMobilesOnBoat(false, false);

                validTargets.Add(targetBoat);
            }

            else
            {
                m_Targets = new List <Mobile>();
            }

            double damageDealt;

            for (int a = 0; a < validTargets.Count; ++a)
            {
                damageDealt = baseCannonDamage;

                object target = validTargets[a];

                int d      = 0;
                int damage = 0;

                bool largeCreatureHit = false;

                PlayerMobile pm_Target;
                BaseCreature bc_Target;

                //Large Boss-Size Creature Hit: Don't Deal Damage to Boat Underneath it
                if (target is Mobile)
                {
                    bc_Target = target as BaseCreature;

                    if (bc_Target != null)
                    {
                        if (bc_Target.IsChamp() || bc_Target.IsBoss() || bc_Target.IsLoHBoss() || bc_Target.IsEventBoss())
                        {
                            largeCreatureHit = true;
                        }
                    }
                }

                if (target is Mobile)
                {
                    Mobile mobile = target as Mobile;

                    pm_Target = mobile as PlayerMobile;
                    bc_Target = mobile as BaseCreature;

                    if (!mobile.Alive)
                    {
                        continue;
                    }

                    //Mobile is somehow on boat that cannon is shooting from
                    BaseBoat mobileBoat = BaseBoat.FindBoatAt(mobile.Location, mobile.Map);

                    if (m_Boat != null && mobileBoat != null)
                    {
                        if (m_Boat == mobileBoat)
                        {
                            continue;
                        }
                    }

                    hitObject = true;

                    bool dealDamage = true;
                    bool directHit  = false;

                    if (mobile.InRange(targetLocation, 0))
                    {
                        directHit = true;
                    }

                    bool isOnWater = BaseBoat.IsWaterTile(mobile.Location, mobile.Map);

                    if (from != null || (SpellHelper.ValidIndirectTarget(from, mobile) && from.CanBeHarmful(mobile, false)))
                    {
                        //Player
                        if (pm_Target != null)
                        {
                            damageDealt *= BaseBoat.CannonPlayerDamageMultiplier;
                        }

                        //Creature
                        if (bc_Target != null)
                        {
                            if (bc_Target.IsOceanCreature)
                            {
                                damageDealt *= BaseBoat.CannonOceanCreatureDamageMultiplier;
                            }

                            else
                            {
                                damageDealt *= BaseBoat.CannonMobileDamageMultiplier;
                            }
                        }

                        if (!directHit)
                        {
                            damageDealt *= BaseBoat.CannonIndirectHitDamageMultiplier;
                        }

                        if (dealDamage)
                        {
                            from.DoHarmful(mobile);

                            int finalDamage = (int)Math.Round(damageDealt);

                            BaseCreature bc_Creature = mobile as BaseCreature;

                            if (bc_Creature != null)
                            {
                                bool willKill = false;

                                if (bc_Creature.Hits - finalDamage <= 0)
                                {
                                    willKill = true;
                                }

                                bc_Creature.OnGotCannonHit(finalDamage, from, willKill);
                            }

                            new Blood().MoveToWorld(mobile.Location, mobile.Map);
                            AOS.Damage(mobile, from, finalDamage, 100, 0, 0, 0, 0);
                        }
                    }
                }

                else if (target is DerelictCargo)
                {
                    DerelictCargo crate = target as DerelictCargo;
                    crate.TakeDamage(from, (int)damageDealt);
                }

                else if (target is BaseBoat && !largeCreatureHit)
                {
                    BaseBoat boatTarget = target as BaseBoat;

                    if (from != null && m_Boat != null && boatTarget != null)
                    {
                        //Somehow Hitting Own Boat
                        if (m_Boat == boatTarget)
                        {
                            continue;
                        }

                        CannonDoHarmful(from, m_MobilesOnSourceBoat, m_Targets);

                        hitObject = true;
                        hitBoat   = true;

                        bool dealDamage = true;

                        if (dealDamage)
                        {
                            DamageType damageType = boatTarget.GetDamageTypeByTargetingMode(m_Boat.TargetingMode);

                            int finalDamage = (int)(Math.Round(damageDealt));

                            boatTarget.ReceiveDamage(from, m_Boat, finalDamage, damageType);
                        }
                    }
                }
            }

            if (hitObject)
            {
                IEntity explosionLocationEntity = new Entity(Serial.Zero, new Point3D(targetLocation.X, targetLocation.Y, targetLocation.Z - 1), map);

                int explosionHue   = 0;
                int explosionSound = 0x307;

                if (m_Boat.MobileFactionType == MobileFactionType.Undead)
                {
                    explosionHue   = 2630;
                    explosionSound = 0x56E;
                }

                if (showExplosion)
                {
                    Effects.SendLocationParticles(explosionLocationEntity, Utility.RandomList(14013, 14015, 14027, 14012), 30, 7, explosionHue, 0, 5044, 0);
                    Effects.PlaySound(explosionLocationEntity.Location, map, explosionSound);
                }
            }

            else
            {
                Splash(targetLocation, map);
            }
        }
 public static void SendLocationParticles(IEntity e, int itemID, int speed, int duration, int effect, int unknown)
 {
     Effects.SendLocationParticles(e, itemID, speed, duration, 0, 0, effect, unknown);
 }
Exemple #5
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 #6
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;
            }
        }
Exemple #7
0
        public static void ShowMorphEffect(Mobile m)
        {
            Effects.SendLocationParticles(EffectItem.Create(m.Location, m.Map, EffectItem.DefaultDuration), 0x3728, 8, 20, 5042);

            Effects.PlaySound(m, m.Map, 0x201);
        }
Exemple #8
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;
            }
        }