Ejemplo n.º 1
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            if (Utility.RandomDouble() <= .075 && !isExploding)
            {
                isExploding = true;

                CreateFlashText(Location, Map, "*terminates*", SpeechHue);

                Timer.DelayCall(TimeSpan.FromSeconds(Utility.RandomMinMax(1, 3)), delegate
                {
                    if (Deleted || !Alive)
                    {
                        return;
                    }

                    SpecialAbilities.AnimalExplosion(null, Location, Map, null, Utility.RandomMinMax(3, 4), 15, 25, 5, ExplosionHue, true, true);

                    Kill();
                });
            }
        }
Ejemplo n.º 2
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            if (Utility.RandomDouble() <= .20 && !isExploding)
            {
                isExploding = true;

                PublicOverheadMessage(MessageType.Regular, 0, false, "*loses grip on reality*");

                Timer.DelayCall(TimeSpan.FromSeconds(Utility.RandomMinMax(1, 3)), delegate
                {
                    if (Deleted || !Alive)
                    {
                        return;
                    }

                    SpecialAbilities.AnimalExplosion(null, Location, Map, null, Utility.RandomMinMax(1, 3), 5, 15, 5, 2588, true, true);

                    Kill();
                });
            }
        }
Ejemplo n.º 3
0
        public override void OnDamage(int amount, Mobile from, bool willKill)
        {
            if (!willKill && amount >= 10)
            {
                if (Utility.RandomDouble() <= .075 && !isExploding)
                {
                    isExploding = true;

                    CreateFlashText(Location, Map, "*terminates*", SpeechHue);

                    Timer.DelayCall(TimeSpan.FromSeconds(Utility.RandomMinMax(1, 3)), delegate
                    {
                        if (Deleted || !Alive)
                        {
                            return;
                        }

                        SpecialAbilities.AnimalExplosion(null, Location, Map, null, Utility.RandomMinMax(3, 4), 15, 25, 5, ExplosionHue, false, true);

                        Kill();
                    });
                }
            }
        }
Ejemplo n.º 4
0
        public override void OnDamage(int amount, Mobile from, bool willKill)
        {
            if (!willKill && amount >= 10)
            {
                if (Utility.RandomDouble() <= .20 && !isExploding)
                {
                    isExploding = true;

                    PublicOverheadMessage(MessageType.Regular, 0, false, "*loses grip on reality*");

                    Timer.DelayCall(TimeSpan.FromSeconds(Utility.RandomMinMax(1, 3)), delegate
                    {
                        if (Deleted || !Alive)
                        {
                            return;
                        }

                        SpecialAbilities.AnimalExplosion(null, Location, Map, null, Utility.RandomMinMax(1, 3), 5, 10, 5, 2588, true, true);

                        Kill();
                    });
                }
            }
        }
Ejemplo n.º 5
0
            protected override void OnTarget(Mobile from, object target)
            {
                if (m_ExplodingAnimal.Deleted || m_ExplodingAnimal.RootParent != from)
                {
                    return;
                }

                PlayerMobile pm = from as PlayerMobile;

                if (pm == null)
                {
                    return;
                }

                IPoint3D targetPoint = target as IPoint3D;

                if (targetPoint == null)
                {
                    return;
                }

                Map map = from.Map;

                if (map == null)
                {
                    return;
                }

                SpellHelper.GetSurfaceTop(ref targetPoint);

                if (targetPoint is Mobile)
                {
                    targetLocation = (Mobile)targetPoint;
                }

                else
                {
                    targetLocation = new Entity(Serial.Zero, new Point3D(targetPoint), map);
                }

                if (!map.CanSpawnMobile(targetLocation.Location))
                {
                    from.SendLocalizedMessage(501942); // That location is blocked.
                    return;
                }

                from.RevealingAction();

                BaseCreature bc_Creature = (BaseCreature)Activator.CreateInstance(m_ExplodingAnimal.CreatureType);

                bc_Creature.Tameable = false;
                bc_Creature.Blessed  = true;
                bc_Creature.Hue      = 2620;
                bc_Creature.Name     = m_ExplodingAnimal.CreatureName;
                bc_Creature.MoveToWorld(targetLocation.Location, targetLocation.Map);

                bc_Creature.Frozen   = true;
                bc_Creature.CantWalk = true;

                bc_Creature.PlaySound(bc_Creature.GetAngerSound());

                bc_Creature.FaceRandomDirection();

                for (int a = 0; a < 11; a++)
                {
                    int tick = a;

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

                        if (tick == 10)
                        {
                            bc_Creature.Blessed = false;

                            SpecialAbilities.AnimalExplosion(from, bc_Creature.Location, bc_Creature.Map, m_ExplodingAnimal.CreatureType, m_ExplodingAnimal.Radius, m_ExplodingAnimal.MinDamage, m_ExplodingAnimal.MaxDamage, 30, -1, true, false);

                            bc_Creature.Kill();
                        }

                        else
                        {
                            int countDown = 10 - tick;
                            bc_Creature.PublicOverheadMessage(MessageType.Regular, 0, false, countDown.ToString());

                            if (Utility.RandomDouble() <= .33)
                            {
                                bc_Creature.FaceRandomDirection();
                            }

                            if (Utility.RandomMinMax(1, 10) <= tick)
                            {
                                bc_Creature.PlaySound(bc_Creature.GetIdleSound());
                            }
                        }
                    });
                }

                if (from.AccessLevel == AccessLevel.Player)
                {
                    from.BeginAction(typeof(ExplodingAnimal));

                    Timer.DelayCall(TimeSpan.FromMinutes(60), delegate
                    {
                        if (from != null)
                        {
                            from.EndAction(typeof(ExplodingAnimal));
                        }
                    });
                }

                m_ExplodingAnimal.Delete();
            }