Inheritance: Item
        protected override void OnTick()
        {
            if( !LegalGrappling(attacker) || !LegalGrappling(defender) )
                return;

            Blood blood = new Blood();
            blood.ItemID = Utility.Random( 0x122A, 5 );
            Map map = defender.Map;
            bool validLocation = false;
            Point3D loc = defender.Location;

            for( int i = 0; !validLocation && i < 10; i++ )
            {
                int x = defender.X + Utility.RandomMinMax( 0, 2 ) - 1;
                int y = defender.Y + Utility.RandomMinMax( 0, 2 ) - 1;
                int z = map.GetAverageZ( x, y );

                if( validLocation = map.CanFit( x, y, defender.Z, 16, false, false ) )
                    loc = new Point3D( x, y, defender.Z );
                else if( validLocation = map.CanFit( x, y, z, 16, false, false ) )
                    loc = new Point3D( x, y, z );
            }

            blood.MoveToWorld( loc, map );
            defender.PlaySound( 0x133 );
            defender.Damage( (int)( Math.Max( 10, Math.Min( 50, ( attacker.Str / 10 ) ) ) ), attacker );

            if( attacker.MeleeAttackType != MeleeAttackType.PermanentGrapple )
                reps--;

            if( reps < 1 || !LegalGrappling( attacker ) || !LegalGrappling( defender ) )
                return;

            new GrappleTimer( attacker, defender, reps ).Start();
        }
Exemple #2
0
        public static void DoBleed( Mobile m, Mobile from, int level )
        {
            if ( m.Alive )
            {
                int damage = Utility.RandomMinMax( level, level * 2 );

                if ( !m.IsPlayer )
                    damage *= 2;

                m.PlaySound( 0x133 );
                m.Damage( damage, from );

                Blood blood = new Blood();
                blood.ItemID = Utility.Random( 0x122A, 5 );
                blood.MoveToWorld( m.Location, m.Map );

                BaseWeapon weapon = from.Weapon as BaseWeapon;

                if ( weapon != null && weapon.WeaponAttributes[WeaponAttribute.BloodDrinker] != 0 && from.Hits < from.HitsMax )
                {
                    from.FixedParticles( 0x375A, 1, 10, 0x1AE9, 0x21, 0x2, EffectLayer.Head );
                    from.SendLocalizedMessage( 1113606 ); // The blood drinker effect heals you.

                    from.Hits += damage;
                }
            }
            else
            {
                EndBleed( m, false );
            }
        }
Exemple #3
0
        public static void DoBleed(Mobile m, Mobile from, int level, bool blooddrinker)
        {
            if (m.Alive)
            {
                int damage = Utility.RandomMinMax(level, level * 2);

                if (!m.Player)
                    damage *= 2;

                m.PlaySound(0x133);
                AOS.Damage(m, from, damage, false, 0, 0, 0, 0, 0, 0, 100, false, false, false);

                if (blooddrinker && from.Hits < from.HitsMax)
                {
                    from.SendLocalizedMessage(1113606); //The blood drinker effect heals you.
                    from.Heal(damage);
                }

                Blood blood = new Blood();

                blood.ItemID = Utility.Random(0x122A, 5);

                blood.MoveToWorld(m.Location, m.Map);
            }
            else
            {
                EndBleed(m, false);
            }
        }
		protected override void OnTick()
		{
			int damage = 2 + Utility.Random( 3 );

			if (m_Target.Deleted || !m_Target.Alive)
			{
				DoExpire();

				return;				
			}

			m_Target.PlaySound( 0x133 );
			m_Target.Damage( damage, m_Mobile );

			m_Target.SendLocalizedMessage( 1070825 ); // The creature continues to rage!

			Blood blood = new Blood();
			blood.ItemID = Utility.Random( 0x122A, 5 );
			blood.MoveToWorld( m_Target.Location, m_Target.Map );

			if ( m_Count >= m_CountMax ) 
			{
				DoExpire();

				return;
			}

			m_Count++;
		}
        public void Target(HouseTrap item)
        {
            if (!Caster.CanSee(item))
            {
                Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }
            else if (CheckSequence())
            {
                SpellHelper.Turn(Caster, item);

                Point3D loc = item.GetWorldLocation();

                Blood shards = new Blood();
                shards.ItemID = 0xC2D;
                shards.Map = item.Map;
                shards.Location = loc;
                Effects.PlaySound(loc, item.Map, 0x305);
                if (item.Placer != null)
                    item.Placer.SendMessage("A trap you placed has been destroyed!");

                item.Delete();
                Caster.SendMessage("You destroy the trap!");
            }

            FinishSequence();
        }
        public override void OnMovement(Mobile m, Point3D oldLocation)
        {
            if (DateTime.UtcNow >= LastSpit && m.InRange(Location, 6) && m.CanSee(this))
            {
                PublicOverheadMessage(MessageType.Emote, 61, true, "*spits*");
                Effects.PlaySound(m.Location, m.Map, 0x19C);

                Timer.DelayCall(
                    TimeSpan.FromMilliseconds(100),
                    () =>
                    {
                            int bloodID = Utility.RandomMinMax(4650, 4655);

                            new MovingEffectInfo(this, m, m.Map, bloodID, 60).MovingImpact(
                                info =>
                                {
                                    var blood = new Blood
                                    {
                                        Name = "slime",
                                        ItemID = bloodID,
                                        Hue = 61
                                    };
                                    blood.MoveToWorld(info.Target.Location, info.Map);

                                    Effects.PlaySound(info.Target, info.Map, 0x028);
                                });
                    });
                LastSpit = DateTime.UtcNow + TimeSpan.FromSeconds(10);
            }
            base.OnMovement(m, oldLocation);
        }
Exemple #7
0
 public override void OnMovement(Mobile m, Point3D oldLocation)
 {
     if (DateTime.UtcNow >= NextSlime  && Alive)
     {
         var blood = new Blood {Hue = 61};
         blood.MoveToWorld(Location, Map);
         NextSlime = DateTime.UtcNow + TimeSpan.FromSeconds(2);
     }
     base.OnMovement(m, oldLocation);
 }
 public static void DoBleed( Mobile m, Mobile from, int level )
 {
     if ( m.Alive )
     {
         m.PlaySound( 0x133 );
         m.Damage( level, from );
         Blood blood = new Blood();
         blood.ItemID = Utility.Random( 0x122A, 5 );
         blood.MoveToWorld( m.Location, m.Map );
     }
     else
         EndBleed( m, false );
 }
Exemple #9
0
		public override void ExecuteTrap( Mobile from )
		{
			base.ExecuteTrap( from );

			from.Damage( Utility.RandomMinMax( 20, 30 ), this.Owner );

			Effects.SendMovingEffect( this.Door, from, 0xF42, 18, 1, false, false );
			from.PlaySound( 0x234 );

			Blood bl = new Blood();
			bl.ItemID = Utility.Random( 0x122A, 5 );
			bl.MoveToWorld( from.Location, from.Map );
		}
Exemple #10
0
        public virtual void Activate(AddonComponent c, Mobile from)
        {
            if (c.ItemID == 0x125E || c.ItemID == 0x1269 || c.ItemID == 0x1260)
            {
                c.ItemID = 0x1269;
            }
            else
            {
                c.ItemID = 0x1247;
            }

            // blood
            int amount = Utility.RandomMinMax(3, 7);

            for (int i = 0; i < amount; i++)
            {
                int x = c.X + Utility.RandomMinMax(-1, 1);
                int y = c.Y + Utility.RandomMinMax(-1, 1);
                int z = c.Z;

                if (!c.Map.CanFit(x, y, z, 1, false, false, true))
                {
                    z = c.Map.GetAverageZ(x, y);

                    if (!c.Map.CanFit(x, y, z, 1, false, false, true))
                    {
                        continue;
                    }
                }

                Blood blood = new Blood(Utility.RandomMinMax(0x122C, 0x122F));
                blood.MoveToWorld(new Point3D(x, y, z), c.Map);
            }

            if (from.Female)
            {
                from.PlaySound(Utility.RandomMinMax(0x150, 0x153));
            }
            else
            {
                from.PlaySound(Utility.RandomMinMax(0x15A, 0x15D));
            }

            from.LocalOverheadMessage(MessageType.Regular, 0, 501777); // Hmm... you suspect that if you used this again, it might hurt.
            SpellHelper.Damage(TimeSpan.Zero, from, Utility.Dice(2, 10, 5));

            Timer.DelayCall(TimeSpan.FromSeconds(0.5), TimeSpan.FromSeconds(0.5), 2, new TimerStateCallback(Deactivate), c);
        }
            protected override void OnTick()
            {
                if (!Owner.Alive || Owner.Map == Map.Internal || Ticks++ >= 5)
                {
                    Stop();
                    Heart.Timer = null;
                }
                else
                {
                    Owner.PlaySound(0x133);

                    var blood = new Blood();
                    blood.ItemID = Utility.Random(0x122A, 5);
                    blood.MoveToWorld(Owner.Location, Owner.Map);
                }
            }
Exemple #12
0
        public void DoBleed(Mobile m)
        {
            if (m.Alive)
            {
                m.PlaySound(0x133);
                AOS.Damage(m, Utility.Random(1, 10), false, 0, 0, 0, 0, 100);

                Blood blood = new Blood();
                blood.ItemID = Utility.Random(0x122A, 5);
                blood.MoveToWorld(m.Location, m.Map);
            }
            else
            {
                EndBleed(m);
            }
        }
	    public override void OnDoubleClick(Mobile from)
	    {
            if (DateTime.UtcNow >= LastUsed && ParentEntity != null && ParentEntity == from)
	        {
	            int range = Utility.RandomMinMax(5, 7);
	            int zOffset = from.Mounted ? 20 : 10;

	            Point3D src = from.Location.Clone3D(0, 0, zOffset);
	            var points = src.GetAllPointsInRange(from.Map, range, range);

	            Effects.PlaySound(from.Location, from.Map, 0x19C);

	            Timer.DelayCall(
	                TimeSpan.FromMilliseconds(100),
	                () =>
	                {
	                    foreach (Point3D trg in points)
	                    {
	                        int bloodID = Utility.RandomMinMax(4650, 4655);

	                        new MovingEffectInfo(src, trg.Clone3D(0, 0, 2), from.Map, bloodID).MovingImpact(
	                            info =>
	                            {
	                                var blood = new Blood
	                                {
	                                    ItemID = bloodID
	                                };
	                                blood.MoveToWorld(info.Target.Location, info.Map);

	                                Effects.PlaySound(info.Target, info.Map, 0x028);
	                            });
	                    }
	                });
	            LastUsed = DateTime.UtcNow + TimeSpan.FromMinutes(30);
	        }
            else if (ParentEntity == null || from != ParentEntity)
            {
                from.SendMessage(54, "You must be wearing this to use it.");
                return;
            }
	        else
	        {
	            var nextuse = LastUsed - DateTime.UtcNow;
                from.SendMessage("You cannot use this again for another " + nextuse.Minutes + " minutes.");
	        }
	        base.OnDoubleClick(from);
	    }
        public override void OnDoubleClick(Mobile from)
        {
            if (DateTime.UtcNow >= LastUsed && ParentEntity != null && ParentEntity == from)
            {
                int range   = Utility.RandomMinMax(5, 7);
                int zOffset = from.Mounted ? 20 : 10;

                Point3D src    = from.Location.Clone3D(0, 0, zOffset);
                var     points = src.GetAllPointsInRange(from.Map, range, range);

                Effects.PlaySound(from.Location, from.Map, 0x19C);

                Timer.DelayCall(
                    TimeSpan.FromMilliseconds(100),
                    () =>
                {
                    foreach (Point3D trg in points)
                    {
                        int bloodID = Utility.RandomMinMax(4650, 4655);

                        new MovingEffectInfo(src, trg.Clone3D(0, 0, 2), from.Map, bloodID).MovingImpact(
                            info =>
                        {
                            var blood = new Blood
                            {
                                ItemID = bloodID
                            };
                            blood.MoveToWorld(info.Target.Location, info.Map);

                            Effects.PlaySound(info.Target, info.Map, 0x028);
                        });
                    }
                });
                LastUsed = DateTime.UtcNow + TimeSpan.FromMinutes(30);
            }
            else if (ParentEntity == null || from != ParentEntity)
            {
                from.SendMessage(54, "You must be wearing this to use it.");
                return;
            }
            else
            {
                var nextuse = LastUsed - DateTime.UtcNow;
                from.SendMessage("You cannot use this again for another " + nextuse.Minutes + " minutes.");
            }
            base.OnDoubleClick(from);
        }
Exemple #15
0
        public void Activate(Mobile from)
        {
            ItemID += 1;
            if (from != null)
            {
                from.Direction = Direction.Down;
            }
            if (ItemID >= 0x124D)
            {
                // blood
                int amount = Utility.RandomMinMax(3, 7);

                for (int i = 0; i < amount; i++)
                {
                    int x = X + Utility.RandomMinMax(-1, 1);
                    int y = Y + Utility.RandomMinMax(-1, 1);
                    int z = Z;

                    if (!Map.CanFit(x, y, z, 1, false, false, true))
                    {
                        z = Map.GetAverageZ(x, y);

                        if (!Map.CanFit(x, y, z, 1, false, false, true))
                        {
                            continue;
                        }
                    }

                    Blood blood = new Blood(Utility.RandomMinMax(0x122C, 0x122F));
                    blood.MoveToWorld(new Point3D(x, y, z), Map);
                }

                if (from.Female)
                {
                    from.PlaySound(Utility.RandomMinMax(0x150, 0x153));
                }
                else
                {
                    from.PlaySound(Utility.RandomMinMax(0x15A, 0x15D));
                }

                from.LocalOverheadMessage(MessageType.Regular, 0, 501777); // Hmm... you suspect that if you used this again, it might hurt.
                SpellHelper.Damage(TimeSpan.Zero, from, Utility.RandomMinMax(7, 20));

                Timer.DelayCall <Mobile>(TimeSpan.FromSeconds(1), new TimerStateCallback <Mobile>(Deactivate), from);
            }
        }
Exemple #16
0
        public static void DoBleed(Mobile m)
        {
            if (m.Alive)
            {
                m.PlaySound(0x133);

                Blood blood = new Blood();

                blood.ItemID = Utility.Random(0x122A, 5);

                blood.MoveToWorld(m.Location, m.Map);
            }
            else
            {
                EndBleed(m, false);
            }
        }
        public static void DoBleed(Mobile m)
        {
            if (m.Alive)
            {
                m.PlaySound(0x133);

                Blood blood = new Blood();

                blood.ItemID = Utility.Random(0x122A, 5);

                blood.MoveToWorld(m.Location, m.Map);
            }
            else
            {
                EndBleed(m, false);
            }
        }
Exemple #18
0
        void ICarvable.Carve(Mobile from, Item item)
        {
            Point3D loc = this.Location;

            if (this.ParentContainer != null)
            {
                if (this.ParentMobile != null)
                {
                    if (this.ParentMobile != from)
                    {
                        from.SendMessage("You can't carve that there");
                        return;
                    }

                    loc = this.ParentMobile.Location;
                }
                else
                {
                    loc = this.ParentContainer.Location;
                    if (!from.InRange(loc, 1))
                    {
                        from.SendMessage("That is too far away.");
                        return;
                    }
                }
            }

            //add blood
            Blood blood = new Blood(Utility.Random(0x122A, 5), Utility.Random(15 * 60, 5 * 60));

            blood.MoveToWorld(loc, Map);
            //add meat
            Jerky jerky = new Jerky(m_IOBAlignment);

            if (this.ParentContainer == null)
            {
                jerky.MoveToWorld(loc, Map);
            }
            else
            {
                this.ParentContainer.DropItem(jerky);
            }

            this.Delete();
        }
Exemple #19
0
        public void Splash()
        {
            Effects.PlaySound(Location, Map, 0x025);

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

            for (int a = 0; a < splashes; a++)
            {
                Blood water = new Blood();
                water.Hue    = 2222;
                water.Name   = "water";
                water.ItemID = Utility.RandomList(4650, 4651, 4652, 4653, 4654, 4655);

                Point3D splashLocation = new Point3D(Location.X + Utility.RandomMinMax(-1, 1), Location.Y + Utility.RandomMinMax(-1, 1), Z);

                water.MoveToWorld(splashLocation, Map);
            }
        }
Exemple #20
0
        public override void OnDoubleClick(Mobile from)
        {
            if (ParentEntity != null && ParentEntity == from)
            {
                from.PublicOverheadMessage(MessageType.Label, 54, true, "*You see " + from.Name + " rubbing his bracelet furiously*");
                int range   = Utility.RandomMinMax(5, 7);
                int zOffset = from.Mounted ? 20 : 10;

                Point3D src    = from.Location.Clone3D(0, 0, zOffset);
                var     points = src.GetAllPointsInRange(from.Map, 0, range);

                Effects.PlaySound(from.Location, from.Map, 0x19C);

                Timer.DelayCall(
                    TimeSpan.FromMilliseconds(100),
                    () =>
                {
                    foreach (Point3D trg in points)
                    {
                        int bloodID = Utility.RandomMinMax(4650, 4655);

                        new MovingEffectInfo(src, trg.Clone3D(0, 0, 2), from.Map, bloodID, 1152).MovingImpact(
                            info =>
                        {
                            var blood = new Blood
                            {
                                ItemID = bloodID,
                                Hue    = 1153
                            };
                            blood.MoveToWorld(info.Target.Location, info.Map);

                            Effects.PlaySound(info.Target, info.Map, 0x028);
                        });
                    }
                });
            }
            else if (ParentEntity == null || from != ParentEntity)
            {
                from.SendMessage(54, "You must be wearing this to use it.");
                return;
            }
            base.OnDoubleClick(from);
        }
Exemple #21
0
        public virtual void Activate(AddonComponent c, Mobile from)
        {
            c.ItemID += 1;

            if (c.ItemID < 0x124D)
            {
                return;
            }

            // blood
            var amount = Utility.RandomMinMax(3, 7);

            for (var i = 0; i < amount; i++)
            {
                var x = c.X + Utility.RandomMinMax(-1, 1);
                var y = c.Y + Utility.RandomMinMax(-1, 1);
                var z = c.Z;

                if (!c.Map.CanFit(x, y, z, 1, false, false))
                {
                    z = c.Map.GetAverageZ(x, y);

                    if (!c.Map.CanFit(x, y, z, 1, false, false))
                    {
                        continue;
                    }
                }

                var blood = new Blood(Utility.RandomMinMax(0x122C, 0x122F));
                blood.MoveToWorld(new Point3D(x, y, z), c.Map);
            }

            from.PlaySound(from.Female ? Utility.RandomMinMax(0x150, 0x153) : Utility.RandomMinMax(0x15A, 0x15D));

            from.LocalOverheadMessage(
                MessageType.Regular,
                0,
                501777
                ); // Hmm... you suspect that if you used this again, it might hurt.
            SpellHelper.Damage(TimeSpan.Zero, from, Utility.Dice(2, 10, 5));

            Timer.DelayCall(TimeSpan.FromSeconds(1), Deactivate, c);
        }
	    public override void OnDoubleClick(Mobile from)
	    {
            if (ParentEntity != null && ParentEntity == from)
	        {
                from.PublicOverheadMessage(MessageType.Label, 54, true, "*You see " + from.Name + " rubbing his bracelet furiously*");
	            int range = Utility.RandomMinMax(5, 7);
	            int zOffset = from.Mounted ? 20 : 10;

	            Point3D src = from.Location.Clone3D(0, 0, zOffset);
	            var points = src.GetAllPointsInRange(from.Map, 0, range);

	            Effects.PlaySound(from.Location, from.Map, 0x19C);

	            Timer.DelayCall(
	                TimeSpan.FromMilliseconds(100),
	                () =>
	                {
	                    foreach (Point3D trg in points)
	                    {
	                        int bloodID = Utility.RandomMinMax(4650, 4655);

                            new MovingEffectInfo(src, trg.Clone3D(0, 0, 2), from.Map, bloodID, 1152).MovingImpact(
	                            info =>
	                            {
	                                var blood = new Blood
	                                {
	                                    ItemID = bloodID,
                                        Hue = 1153
	                                };
	                                blood.MoveToWorld(info.Target.Location, info.Map);

	                                Effects.PlaySound(info.Target, info.Map, 0x028);
	                            });
	                    }
	                });
	        }
            else if (ParentEntity == null || from != ParentEntity)
            {
                from.SendMessage(54, "You must be wearing this to use it.");
                return;
            }
	        base.OnDoubleClick(from);
	    }
Exemple #23
0
		public void Activate( Mobile from )
		{
			ItemID += 1;
            if (from != null)
                from.Direction = Direction.Down;
            if (ItemID >= 0x124D)
            {
                // blood
                int amount = Utility.RandomMinMax(3, 7);

                for (int i = 0; i < amount; i++)
                {
                    int x = X + Utility.RandomMinMax(-1, 1);
                    int y = Y + Utility.RandomMinMax(-1, 1);
                    int z = Z;

                    if (!Map.CanFit(x, y, z, 1, false, false, true))
                    {
                        z = Map.GetAverageZ(x, y);

                        if (!Map.CanFit(x, y, z, 1, false, false, true))
                            continue;
                    }

                    Blood blood = new Blood(Utility.RandomMinMax(0x122C, 0x122F));
                    blood.MoveToWorld(new Point3D(x, y, z), Map);
                }

                if (from.Female)
                    from.PlaySound(Utility.RandomMinMax(0x150, 0x153));
                else
                    from.PlaySound(Utility.RandomMinMax(0x15A, 0x15D));

                from.LocalOverheadMessage(MessageType.Regular, 0, 501777); // Hmm... you suspect that if you used this again, it might hurt.
                SpellHelper.Damage(TimeSpan.Zero, from, Utility.RandomMinMax(7, 20));

                Timer.DelayCall<Mobile>(TimeSpan.FromSeconds(1), new TimerStateCallback<Mobile>(Deactivate), from);
            }
		}
Exemple #24
0
        public virtual void Activate( AddonComponent c, Mobile from )
        {
            if ( c.ItemID == 0x125E )
                c.ItemID = 0x1269;
            else
                c.ItemID = 0x1245;

            // blood
            int amount = Utility.RandomMinMax( 3, 7 );

            for ( int i = 0; i < amount; i++ )
            {
                int x = c.X + Utility.RandomMinMax( -1, 1 );
                int y = c.Y + Utility.RandomMinMax( -1, 1 );
                int z = c.Z;

                if ( !c.Map.CanFit( x, y, z, 1, false, false, true ) )
                {
                    z = c.Map.GetAverageZ( x, y );

                    if ( !c.Map.CanFit( x, y, z, 1, false, false, true ) )
                        continue;
                }

                Blood blood = new Blood( Utility.RandomMinMax( 0x122C, 0x122F ) );
                blood.MoveToWorld( new Point3D( x, y, z ), c.Map );
            }

            if ( from.Female )
                from.PlaySound( Utility.RandomMinMax( 0x150, 0x153 ) );
            else
                from.PlaySound( Utility.RandomMinMax( 0x15A, 0x15D ) );

            from.LocalOverheadMessage( MessageType.Regular, 0, 501777 ); // Hmm... you suspect that if you used this again, it might hurt.
            SpellHelper.Damage( TimeSpan.Zero, from, Utility.Dice( 2, 10, 5 ) );

            Timer.DelayCall( TimeSpan.FromSeconds( 0.5 ), TimeSpan.FromSeconds( 0.5 ), 2, new TimerStateCallback( Deactivate ), c );
        }
		public static void DoBleed( Mobile m, Mobile from, int level )
		{
			if ( m.Alive )
			{
				int damage = Utility.RandomMinMax( level, level * 2 );

				if ( !m.Player )
					damage *= 2;

				m.PlaySound( 0x133 );
				m.Damage( damage, from );

				Blood blood = new Blood();

				blood.ItemID = Utility.Random( 0x122A, 5 );

				blood.MoveToWorld( m.Location, m.Map );
			}
			else
			{
				EndBleed( m, false );
			}
		}
Exemple #26
0
        public static void DoBleed(Mobile m, Mobile from, int level)
        {
            if (m.Alive)
            {
                int damage = Utility.RandomMinMax(level, level * 2);

                if (!m.Player)
                {
                    damage *= 2;
                }

                m.PlaySound(0x133);
                m.Damage(damage, from);

                Blood blood = new Blood {
                    ItemID = Utility.Random(0x122A, 5)
                };
                blood.MoveToWorld(m.Location, m.Map);
            }
            else
            {
                EndBleed(m, false);
            }
        }
        void ICarvable.Carve(Mobile from, Item item)
        {
            Point3D loc = this.Location;

            if (this.ParentContainer != null)
            {
                if (this.ParentMobile != null)
                {
                    if (this.ParentMobile != from)
                    {
                        from.SendMessage("You can't carve that there");
                        return;
                    }

                    loc = this.ParentMobile.Location;
                }
                else
                {
                    loc = this.ParentContainer.Location;
                    if (!from.InRange(loc, 1))
                    {
                        from.SendMessage("That is too far away.");
                        return;
                    }
                }
            }


            //add blood
            Blood blood = new Blood(Utility.Random(0x122A, 5), Utility.Random(15 * 60, 5 * 60));

            blood.MoveToWorld(loc, Map);
            //add meat
            Jerky jerky  = new Jerky(m_IOBAlignment);
            Jerky jerky2 = new Jerky(m_IOBAlignment);
            Jerky jerky3 = new Jerky(m_IOBAlignment);

            BodyPart heart = new BodyPart(BodyPart.Part.HEART);
            BodyPart liver = new BodyPart(BodyPart.Part.LIVER);
            BodyPart ent   = new BodyPart(BodyPart.Part.ENTRAILS);

            if (this.ParentContainer == null)
            {
                jerky.MoveToWorld(loc, Map);
                jerky2.MoveToWorld(loc, Map);
                jerky3.MoveToWorld(loc, Map);
                heart.MoveToWorld(loc, Map);
                liver.MoveToWorld(loc, Map);
                ent.MoveToWorld(loc, Map);
            }
            else
            {
                this.ParentContainer.DropItem(jerky);
                this.ParentContainer.DropItem(jerky2);
                this.ParentContainer.DropItem(jerky3);
                this.ParentContainer.DropItem(heart);
                this.ParentContainer.DropItem(liver);
                this.ParentContainer.DropItem(ent);
            }

            this.Delete();
        }
 public override void OnAfterMove(Point3D oldLocation)
 {
     Blood gooPuddle = new Blood();
     gooPuddle.ItemID = Utility.Random(0x122A, 5);
     gooPuddle.Name = "slime";
     gooPuddle.Hue = 0x14;
     gooPuddle.MoveToWorld(oldLocation, this.Map);
 }
        public override void OnReceivedAttack(bool melee, bool parried, Mobile attacker)
        {
            if (attacker.Weapon is BaseRanged)
            {
                int damage = Utility.RandomMinMax(1,attacker.RawStr);
                PlaySound(0x133);
                Damage(damage, attacker);
                Blood blood = new Blood();
                blood.ItemID = Utility.Random(0x122A, 5);
                blood.MoveToWorld(Location, Map);

                if (Utility.RandomBool())
                    AIObject.Action = ActionType.Flee;
            }

            base.OnReceivedAttack(melee, parried, attacker);
        }
Exemple #30
0
        public void DoAbilityNoxiousBlood(BaseCreature target, BaseMetaPet pet)
        {
            int range = Utility.RandomMinMax(3, 5);
            int zOffset = 10;

            Point3D src = pet.Location.Clone3D(0, 0, zOffset);
            Point3D[] points = src.GetAllPointsInRange(pet.Map, range, range);

            Effects.PlaySound(pet.Location, pet.Map, 0x19C);

            Timer.DelayCall(
                TimeSpan.FromMilliseconds(100),
                () =>
                {
                    foreach (Point3D trg in points)
                    {
                        int bloodID = Utility.RandomMinMax(4650, 4655);

                        new MovingEffectInfo(src, trg.Clone3D(0, 0, 2), pet.Map, bloodID, 1367).MovingImpact(
                            info =>
                            {
                                var blood = new Blood
                                {
                                    ItemID = bloodID,
                                    Hue = 1368
                                };
                                blood.MoveToWorld(info.Target.Location, info.Map);

                                Effects.PlaySound(info.Target, info.Map, 0x028);
                            });
                    }
                    foreach (
                        Mobile mobile in
                            pet.Location.GetMobilesInRange(pet.Map, range)
                                .Where(m => m is BaseCreature && !m.IsControlled()).Take(4))
                    {
                        var num = (int) Math.Floor((float) Level / 2);
                        if (num == 5)
                            num = 4;
                        mobile.ApplyPoison(pet, Poison.GetPoison(num));
                    }
                    Experience ++;
                    if (Experience >= NextLevelExperience)
                    {
                        LevelUpNoxiousBlood(pet.ControlMaster);
                    }
                });
            NextUse = DateTime.UtcNow + CoolDown;
        }
Exemple #31
0
		void ICarvable.Carve(Mobile from, Item item)
		{
			Point3D loc = this.Location;
			if (this.ParentContainer != null)
			{
				if (this.ParentMobile != null)
				{
					if (this.ParentMobile != from)
					{
						from.SendMessage("You can't carve that there");
						return;
					}

					loc = this.ParentMobile.Location;
				}
				else
				{
					loc = this.ParentContainer.Location;
					if (!from.InRange(loc, 1))
					{
						from.SendMessage("That is too far away.");
						return;
					}
				}
			}

			//add blood
			Blood blood = new Blood(Utility.Random(0x122A, 5), Utility.Random(15 * 60, 5 * 60));
			blood.MoveToWorld(loc, Map);
			//add meat
			Jerky jerky = new Jerky(m_IOBAlignment);
			if (this.ParentContainer == null)
			{
				jerky.MoveToWorld(loc, Map);
			}
			else
			{
				this.ParentContainer.DropItem(jerky);
			}

			this.Delete();
		}
        protected override void OnTick()
        {
            if (m_Addict == null || m_Addict.Deleted)
            {
                Stop();
                return;
            }

            if (!m_Addict.Alive)
                return;

            if (m_Addict.Map == Map.Internal)
                return;

            if (m_Addict is PlayerMobile && (m_Addict as PlayerMobile).Reforging)
                return;

            if (m_RecoveryCount >= HungerMax)
            {
                m_Addict.SendMessage(2006, "You have successfully recovered from your addiction to " + m_Crave.ToLower() + ".");

                XmlAddiction addAtt = XmlAttach.FindAttachment(m_Addict, typeof(XmlAddiction)) as XmlAddiction;
                if (addAtt != null)
                {
                    if (addAtt.Addictions.Contains(this))
                        addAtt.Addictions.Remove(this);
                }

                Stop();
                return;
            }

            if (Hunger < HungerMax / 2)
            {
                int statLoss = HungerMax - m_Addict.ManaMax - m_Addict.StamMax;
                if (statLoss < 5)
                    statLoss = 5;

                if (Hunger <= 0)
                {
                    XmlHits withdrawal1 = new XmlHits(0 - statLoss, HungerMax * 10); withdrawal1.Name = "Severe Withdrawal";
                    XmlAttach.AttachTo(m_Addict, withdrawal1);
                    XmlHue withdrawal2 = new XmlHue(2419, HungerMax * 10); withdrawal2.Name = "Severe Withdrawal";
                    XmlAttach.AttachTo(m_Addict, withdrawal2);

                    m_Addict.SendMessage(37, "You grow weak and pale with your desire for " + m_Crave.ToLower() + ".");
                    m_RecoveryCount++;
                }

                if (m_Crave == "Tobacco")
                {
                    XmlDex withdrawal = new XmlDex(0 - statLoss, HungerMax * 1); withdrawal.Name = "Tobacco Withdrawal";
                    XmlAttach.AttachTo(m_Addict, withdrawal);

                    m_Addict.SendMessage(37, "You've developed the shakes!");
                }
                else if (m_Crave == "Swampweed")
                {
                    XmlInt withdrawal = new XmlInt(0 - statLoss, HungerMax * 10); withdrawal.Name = "Swampweed Withdrawal";
                    XmlAttach.AttachTo(m_Addict, withdrawal);

                    m_Addict.SendMessage(37, "You have a splitting migraine!");
                }
                else if (m_Crave == "Qat")
                {
                    XmlStam withdrawal = new XmlStam(0 - statLoss, HungerMax * 10); withdrawal.Name = "Qat Withdrawal";
                    XmlAttach.AttachTo(m_Addict, withdrawal);

                    m_Addict.SendMessage(37, "You feel lethargic.");
                }
                else if (m_Crave == "Banestone")
                {
                    XmlMana withdrawal1 = new XmlMana(0 - statLoss, HungerMax * 10); withdrawal1.Name = "Banestone Withdrawal";
                    XmlAttach.AttachTo(m_Addict, withdrawal1);
                    XmlInt withdrawal2 = new XmlInt(0 - statLoss, HungerMax * 10); withdrawal2.Name = "Banestone Withdrawal";
                    XmlAttach.AttachTo(m_Addict, withdrawal2);

                    if (Utility.RandomBool())
                    {
                        new TripFoe.TripFoeTimer(m_Addict, 3);
                        m_Addict.Emote("*collapses, thrashing violently!*");
                    }
                    else
                    {
                        int damage = (HungerMax - Hunger);
                        if(damage < 1)
                            damage = 1;
                        if(m_Addict.HitsMax / 10 < 1)
                            damage = 1;
                        else
                            damage = damage / (m_Addict.HitsMax / 10);

                        m_Addict.PlaySound(0x133);
                        m_Addict.Damage(damage, m_Addict);
                        Blood blood = new Blood();
                        blood.ItemID = Utility.Random(0x122A, 5);
                        blood.MoveToWorld(m_Addict.Location, m_Addict.Map);
                        m_Addict.Emote("*blood flows from " + (m_Addict.Female ? "her" : "his") + " nose as " + (m_Addict.Female ? "her" : "his") +
                            " eyes roll to the back of " + (m_Addict.Female ? "her" : "his") + " head!*");
                    }

                    m_Addict.SendMessage(1609, "You are wracked with seizures!");
                }
                else if (m_Crave == "Opium")
                {
                    XmlDex withdrawal = new XmlDex(0 - statLoss, HungerMax * 10); withdrawal.Name = "Opium Withdrawal";
                    XmlAttach.AttachTo(m_Addict, withdrawal);
                    m_Addict.Hunger--;

                    m_Addict.SendMessage(37, "You feel a gnawing hunger.");
                }
            }

            Hunger--;
            if (Hunger < 0)
                Hunger = 0;

            base.OnTick();
        }
Exemple #33
0
        public void DoBleed(Mobile m, Mobile from, int level)
        {
            if (m.Alive)
            {
                int damage = Utility.RandomMinMax(level, level * 2);

                if (!m.Player)
                    damage *= 2;

                m.PlaySound(0x133);
                AOS.Damage(m, from, damage, false, 0, 0, 0, 0, 0, 0, 100, false, false, false);

                Blood blood = new Blood();

                blood.ItemID = Utility.Random(0x122A, 5);

                blood.MoveToWorld(m.Location, m.Map);
            }
            else
            {
                EndBleed(m, false);
                RemoveEffects();

                BuffInfo.RemoveBuff(m, BuffIcon.SplinteringEffect);
            }
        }
Exemple #34
0
        public override void OnHit(Mobile attacker, Mobile defender, double damageBonus)
        {
            int bombwhere = Utility.Random(7);

            switch (bombwhere)
            {
            case 0:
                defender.FixedParticles(0x375A, 1, 30, 2405, 78, 0, EffectLayer.Head);
                defender.PlaySound(814);
                break;

            case 1:
                defender.FixedParticles(0x37B9, 1, 30, 2406, 85, 0, EffectLayer.RightHand);
                defender.PlaySound(1088);
                break;

            case 2:
                defender.FixedParticles(0x376A, 1, 31, 2404, 80, 0, EffectLayer.LeftHand);
                defender.PlaySound(814);
                break;

            case 3:
                defender.FixedParticles(0x37C4, 1, 31, 2405, 88, 0, EffectLayer.Waist);
                defender.PlaySound(1088);
                break;

            case 4:
                defender.FixedParticles(0x3728, 1, 30, 2406, 88, 0, EffectLayer.LeftFoot);
                defender.PlaySound(814);
                break;

            case 5:
                defender.FixedParticles(0x3779, 1, 30, 2404, 85, 0, EffectLayer.RightFoot);
                defender.PlaySound(1088);
                break;

            case 6:
                defender.FixedParticles(0x376A, 1, 31, 2405, 80, 0, EffectLayer.CenterFeet);
                defender.PlaySound(814);
                break;
            }
            for (int x = defender.X - 5; x <= defender.X + 5; x++)
            {
                for (int y = defender.Y - 5; y <= defender.Y + 5; y++)
                {
                    Blood g = new Blood();
                    g.Visible = false;
                    g.MoveToWorld(new Point3D(x, y, defender.Z), defender.Map);
                    switch (Utility.Random(20))
                    {
                    case 0:
                    {
                        Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x375A, 1, 30, 2405, 88);
                        Effects.PlaySound(g, g.Map, 814);
                        break;
                    }

                    case 1:
                    {
                        Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x37B9, 1, 30, 2406, 85);
                        Effects.PlaySound(g, g.Map, 1088);
                        break;
                    }

                    case 2:
                    {
                        Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x376A, 1, 31, 2405, 80);
                        Effects.PlaySound(g, g.Map, 814);
                        break;
                    }

                    case 3:
                    {
                        Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x37C4, 1, 31, 2405, 88);
                        Effects.PlaySound(g, g.Map, 1088);
                        break;
                    }

                    case 4:
                    {
                        Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x3728, 1, 30, 2406, 88);
                        Effects.PlaySound(g, g.Map, 814);
                        break;
                    }

                    case 5:
                    {
                        Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x37B9, 1, 30, 2406, 85);
                        Effects.PlaySound(g, g.Map, 1088);
                        break;
                    }

                    case 6:
                    {
                        Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x376A, 1, 31, 2404, 80);
                        Effects.PlaySound(g, g.Map, 814);
                        break;
                    }

                    case 7:
                    {
                        Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x37C4, 1, 31, 2406, 88);
                        Effects.PlaySound(g, g.Map, 1088);
                        break;
                    }

                    case 8:
                    {
                        Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x3728, 1, 30, 2405, 85);
                        Effects.PlaySound(g, g.Map, 814);
                        break;
                    }

                    case 9:
                    {
                        Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x37B9, 1, 30, 2404, 88);
                        Effects.PlaySound(g, g.Map, 1088);
                        break;
                    }

                    case 10:
                    {
                        Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x376A, 1, 31, 2406, 88);
                        Effects.PlaySound(g, g.Map, 814);
                        break;
                    }

                    case 11:
                    {
                        Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x3779, 1, 31, 2405, 85);
                        Effects.PlaySound(g, g.Map, 1088);
                        break;
                    }

                    default:
                        break;
                    }
                }
            }

            int               explosionDamage = Utility.Random(30, 10);
            ArrayList         targets         = new ArrayList();
            IPooledEnumerable eable           = defender.Map.GetMobilesInRange(new Point3D(defender.Location), 5);

            foreach (Mobile m in eable)
            {
                targets.Add(m);
            }
            eable.Free();
            if (targets.Count > 0)
            {
                explosionDamage /= targets.Count;
                for (int i = 0; i < targets.Count; ++i)
                {
                    Mobile m = (Mobile)targets[i];
                    m.Damage(explosionDamage);
                    m.FixedParticles(0x37C4, 1, 31, 2405, 85, 0, EffectLayer.CenterFeet);
                    m.PlaySound(1088);
                }
            }
            base.OnHit(attacker, defender, damageBonus);
        }
Exemple #35
0
        void ICarvable.Carve(Mobile from, Item item)
        {
            Point3D loc = this.Location;

            if (this.ParentContainer != null)
            {
                if (this.ParentMobile != null)
                {
                    if (this.ParentMobile != from)
                    {
                        from.SendMessage("You can't carve that there");
                        return;
                    }

                    loc = this.ParentMobile.Location;
                }
                else
                {
                    loc = this.ParentContainer.Location;
                    if (!from.InRange(loc, 1))
                    {
                        from.SendMessage("That is too far away.");
                        return;
                    }
                }
            }

            //add blood
            Blood blood = new Blood(Utility.Random(0x122A, 5), Utility.Random(15 * 60, 5 * 60));

            blood.MoveToWorld(loc, Map);
            //add brain			//add skull
            if (Player == null)
            {
                if (this.ParentContainer == null)
                {
                    new Brain().MoveToWorld(loc, Map);
                    new Skull().MoveToWorld(loc, Map);
                }
                else
                {
                    this.ParentContainer.DropItem(new Brain());
                    this.ParentContainer.DropItem(new Skull());
                }
            }
            else
            {
                if (this.ParentContainer == null)
                {
                    new Brain(Player.Name).MoveToWorld(loc, Map);
                    new Skull(Player.Name).MoveToWorld(loc, Map);
                }
                else
                {
                    this.ParentContainer.DropItem(new Brain(Player.Name));
                    this.ParentContainer.DropItem(new Skull(Player.Name));
                }
            }

            this.Delete();
        }
Exemple #36
0
			protected override void OnTick()
			{
				if ( m_Location != m_Mobile.Location )
				{
					int amount = Utility.RandomMinMax( 0, 7 );

					for ( int i = 0; i < amount; i++ )
					{
						int x = m_Mobile.X + Utility.RandomMinMax( -1, 1 );
						int y = m_Mobile.Y + Utility.RandomMinMax( -1, 1 );
						int z = m_Mobile.Z;

						if ( !m_Mobile.Map.CanFit( x, y, z, 1, false, false, true ) )
						{
							z = m_Mobile.Map.GetAverageZ( x, y );

							if ( !m_Mobile.Map.CanFit( x, y, z, 1, false, false, true ) )
								continue;
						}

						Blood blood = new Blood( Utility.RandomMinMax( 0x122C, 0x122F ) );
						blood.MoveToWorld( new Point3D( x, y, z ), m_Mobile.Map );
					}

					m_Location = m_Mobile.Location;
				}
			}
        public void TakeDamage(Mobile from, int damage)
        {
            if (from == null)
            {
                return;
            }

            if (damage < 1)
            {
                damage = 1;
            }

            //Break
            if (damage >= m_HitPoints)
            {
                Effects.PlaySound(Location, Map, 0x11B);

                m_HitPoints = 0;

                PlayerMobile player     = from as PlayerMobile;
                BaseShip     playerShip = BaseShip.FindShipAt(player.Location, player.Map);

                int doubloonValue = 10;

                switch (m_CrateType)
                {
                case CrateType.Bronze: doubloonValue = Utility.RandomMinMax(10, 25); break;

                case CrateType.Silver: doubloonValue = Utility.RandomMinMax(25, 100); break;

                case CrateType.Gold: doubloonValue = Utility.RandomMinMax(100, 250); break;
                }

                if (player != null && playerShip != null)
                {
                    if (!playerShip.Deleted)
                    {
                        if (playerShip.DepositDoubloons(doubloonValue))
                        {
                            Doubloon doubloonPile = new Doubloon(doubloonValue);
                            player.SendSound(doubloonPile.GetDropSound());
                            doubloonPile.Delete();

                            //playerShip.doubloonsEarned += doubloonValue;

                            player.SendMessage("You have recovered " + doubloonValue.ToString() + " doubloons worth of materials in the cargo! The coins have been placed in your ship's hold.");
                        }

                        else
                        {
                            player.SendMessage("You have earned doubloons, but alas there was not enough room in your ship's hold to place them all!");
                        }
                    }
                }

                Point3D startLocation       = Location;
                IEntity effectStartLocation = new Entity(Serial.Zero, Location, Map);

                Effects.SendLocationParticles(effectStartLocation, Utility.RandomList(0x36BD, 0x36BF, 0x36CB, 0x36BC), 30, 7, 0, 0, 5044, 0);

                int debrisCount = Utility.RandomMinMax(6, 8);

                for (int a = 0; a < debrisCount; a++)
                {
                    int itemId;

                    Point3D endLocation;
                    IEntity effectEndLocation;

                    if (Utility.RandomDouble() <= .80)
                    {
                        itemId      = Utility.RandomList(7041, 7044, 7053, 7067, 7068, 7069, 7070, 7604, 7605);
                        endLocation = new Point3D(X + Utility.RandomMinMax(-3, 3), Y + Utility.RandomMinMax(-3, 3), Z + 5);

                        effectEndLocation = new Entity(Serial.Zero, endLocation, Map);
                    }

                    else
                    {
                        itemId      = Utility.RandomList(3117, 3118, 3119, 3120);
                        endLocation = new Point3D(X + Utility.RandomMinMax(-2, 2), Y + Utility.RandomMinMax(-2, 2), Z);

                        effectEndLocation = new Entity(Serial.Zero, endLocation, Map);
                    }

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

                    double distance = Utility.GetDistanceToSqrt(startLocation, endLocation);

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

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

                        Blood debris  = new Blood();
                        debris.Name   = "debris";
                        debris.ItemID = itemId;

                        debris.MoveToWorld(endLocation, Map);
                        Effects.PlaySound(endLocation, Map, 0x027);
                    });
                }

                Delete();
            }

            //Damage
            else
            {
                int debrisCount = Utility.RandomMinMax(1, 2);

                for (int a = 0; a < debrisCount; a++)
                {
                    int itemId = Utility.RandomList(7041, 7044, 7053, 7067, 7068, 7069, 7070, 7604, 7605);

                    Blood debris = new Blood();
                    debris.Name   = "debris";
                    debris.ItemID = itemId;

                    Point3D endLocation = new Point3D(X + Utility.RandomMinMax(-2, 2), Y + Utility.RandomMinMax(-2, 2), Z + 5);

                    debris.MoveToWorld(endLocation, Map);
                    Effects.PlaySound(endLocation, Map, 0x027);
                }

                //Wood Breaking Sound
                Effects.PlaySound(Location, Map, Utility.RandomList(0x11D)); //0x3B7, 0x3B5, 0x3B1

                m_HitPoints -= damage;
            }
        }
        public static void DoBleed( Mobile m, Mobile from, int level )
        {
            if ( m.Alive )
            {
                int damage = Utility.RandomMinMax( level, level * ((IKhaerosMobile)from).Feats.GetFeatLevel(FeatList.BleedingStrike) );

                m.PlaySound( 0x133 );
                m.Damage( damage, from );

                Blood blood = new Blood();

                blood.ItemID = Utility.Random( 0x122A, 5 );

                blood.MoveToWorld( m.Location, m.Map );
            }
            else
            {
                EndBleed( m, false );
            }
        }
 public virtual void FinishThrow(Mobile m, Mobile target)
 {
     if (m != null && !m.Deleted && target != null)
     {
         var blood = new Blood();
         blood.MoveToWorld(target.Location, target.Map);
         target.Damage(45, this);
         CantWalk = false;
     }
 }
Exemple #40
0
		public static void DoBleed( Mobile m, Mobile from, int level, bool leeches )
		{
		#endregion
			if ( m.Alive )
			{
				int damage = Utility.RandomMinMax( level, level * 2 );

				#region SA
				if ( leeches )
				{
					from.Hits += damage;
					from.SendLocalizedMessage( 1113606 ); // The blood drinker effect heals you.
				}
				#endregion

				if ( !m.Player )
					damage *= 2;

				m.PlaySound( 0x133 );
				m.Damage( damage, from );

				Blood blood = new Blood();

				blood.ItemID = Utility.Random( 0x122A, 5 );

				blood.MoveToWorld( m.Location, m.Map );
			}
			else
			{
				EndBleed( m, false );
			}
		}
Exemple #41
0
        public void DoExplode(PlayerMobile pm)
        {
            pm.Emote("*The gaze of the asylum guardian melts the flesh from your bones and causes your organs to explode.*");
            int range   = Utility.RandomMinMax(5, 7);
            int zOffset = pm.Mounted ? 20 : 10;

            Point3D src = pm.Location.Clone3D(0, 0, zOffset);

            Point3D[] points = src.GetAllPointsInRange(pm.Map, 0, range);

            Effects.PlaySound(pm.Location, pm.Map, 0x19C);

            pm.FixedParticles(0x36BD, 20, 10, 5044, 137, 0, EffectLayer.Head);
            pm.PlaySound(0x307);

            Timer.DelayCall(
                TimeSpan.FromMilliseconds(100),
                () =>
            {
                int i               = 0;
                int place           = 0;
                int[] BodyPartArray = { 7584, 7583, 7586, 7585, 7588, 7587 };
                foreach (Point3D trg in points)
                {
                    i++;
                    int bodypartID = Utility.RandomMinMax(4650, 4655);

                    if (Utility.RandomDouble() <= 0.1 && place < BodyPartArray.Count())
                    {
                        bodypartID = BodyPartArray[place];
                        place++;
                    }
                    new MovingEffectInfo(src, trg.Clone3D(0, 0, 2), pm.Map, bodypartID).MovingImpact(
                        info =>
                    {
                        Item bodypart;
                        if (bodypartID <= 4655 && bodypartID >= 4650)
                        {
                            bodypart = new Blood
                            {
                                ItemID = bodypartID
                            };
                            bodypart.MoveToWorld(info.Target.Location, info.Map);
                        }

                        switch (bodypartID)
                        {
                        case 7584:
                            bodypart = new Head();
                            bodypart.MoveToWorld(info.Target.Location, info.Map);
                            break;

                        case 7583:
                            bodypart = new Torso();
                            bodypart.MoveToWorld(info.Target.Location, info.Map);
                            break;

                        case 7586:
                            bodypart = new RightArm();
                            bodypart.MoveToWorld(info.Target.Location, info.Map);
                            break;

                        case 7585:
                            bodypart = new LeftArm();
                            bodypart.MoveToWorld(info.Target.Location, info.Map);
                            break;

                        case 7588:
                            bodypart = new RightLeg();
                            bodypart.MoveToWorld(info.Target.Location, info.Map);
                            break;

                        case 7587:
                            bodypart = new LeftLeg();
                            bodypart.MoveToWorld(info.Target.Location, info.Map);
                            break;
                        }

                        Effects.PlaySound(info.Target, info.Map, 0x028);
                    });
                }
            });

            pm.Damage(pm.Hits + 5);

            Timer.DelayCall(
                TimeSpan.FromMilliseconds(100),
                () =>
            {
                var corpse = pm.Corpse as Corpse;

                if (corpse != null && !corpse.Deleted)
                {
                    corpse.TurnToBones();
                }
            });
        }
Exemple #42
0
        public bool ReceivePrize(Mobile from, int seed)
        {
            Item   i    = null;
            string text = "";

            /*              Rewards
             * Sandals ~ Hued [2651, 2662]  :::: 0.5%
             * Spellbook ~ Hued [2651, 2662]  :::: 0.5%
             * UncutCloth ~ Hued [2651, 2662]  :::: 1%
             * Stuffed Easter Bunny Statue Hued [1150] :::: 1.5%
             * Dragon Coin ~ Amount [10-25] :::: 3%
             * Magic Weapon (Might + random others) 5%
             * RabbitBomb ~ 5%
             * Random Skill Manual ~ 5%
             * Another Easter Egg 10%
             *
             * Explosion ~ (5-15 damage) :::: 25.5%
             * Gold ~ Amount [50-199] :::: 43%
             *
             */

            if (seed <= 25)
            {
                text = "You receive Easter Sandals!";

                i      = new Sandals();
                i.Hue  = Utility.RandomList(2651, 2662);
                i.Name = "Easter Sandals";
            }

            else if (seed <= 75)
            {
                text = "You receive an Easter Spellbook!";

                i      = new Spellbook();
                i.Hue  = Utility.RandomList(2651, 2662);
                i.Name = "Easter Spellbook";
            }

            else if (seed <= 125)
            {
                text = "You receive some Easter Cloth!";

                i        = new UncutCloth();
                i.Hue    = Utility.RandomList(2651, 2662);
                i.Amount = 8;
            }

            else if (seed <= 225)
            {
                text = "You receive a stuffed Easter Bunny!";
                i    = new StuffedEasterBunny();
            }

            else if (seed <= 600)
            {
                text     = "You receive some Dragon Coins!";
                i        = new DragonCoin();
                i.Amount = Utility.Random(25, 50);
            }

            else if (seed <= 850)
            {
            }

            else if (seed <= 3150)
            {
                text = "You receive more easter eggs!";
                i    = new EasterEgg();
            }

            else if (seed <= 5750)
            {
                Point3D loc   = this.GetWorldLocation();
                Map     facet = this.Map;

                text = "You receive remorse!";

                if (from.CanBeDamaged())
                {
                    Effects.SendLocationEffect(loc, facet, 0x36BD, 15, 10);
                    Effects.PlaySound(from.Location, from.Map, 0x246);

                    from.PublicOverheadMessage(MessageType.Regular, 0, false, "*Looks remorseful*");

                    AOS.Damage(from, Utility.Random(10, 20), 0, 100, 0, 0, 0);

                    Blood blood = new Blood();
                    blood.MoveToWorld(from.Location, from.Map);
                }
            }

            else if (seed <= 6000)
            {
                text     = "You receive a large amount of gold.";
                i        = new Gold();
                i.Amount = Utility.RandomMinMax(750, 1250);

                from.SendSound(0x2e6);
            }

            else if (seed <= 6500)
            {
                text     = "You receive a moderate amount of gold.";
                i        = new Gold();
                i.Amount = Utility.RandomMinMax(400, 600);

                from.SendSound(0x2e5);
            }

            else
            {
                text     = "You receive a small amount of gold.";
                i        = new Gold();
                i.Amount = Utility.RandomMinMax(200, 300);

                from.SendSound(0x2e4);
            }

            if (text.Length > 0)
            {
                from.SendMessage(text);
            }

            if (i != null)
            {
                if (!from.AddToBackpack(i))
                {
                    i.Delete();
                    from.SendMessage("You don't have enough room in your backpack. Please make room and try again.");

                    return(false);
                }
            }

            return(true);
        }
		public static void DoBleed( Mobile m )
		{
			Blood blood = new Blood();
			blood.ItemID = Utility.Random( 0x122A, 5 );
			blood.MoveToWorld( m.Location, m.Map );
		}
        public void BloodEffect(int range, Mobile m)
        {
            int zOffset = m.Mounted ? 20 : 10;

            Point3D src = m.Location.Clone3D(0, 0, zOffset);
            Point3D[] points = src.GetAllPointsInRange(m.Map, 0, range);

            Effects.PlaySound(m.Location, m.Map, 0x19C);

            Timer.DelayCall(
                TimeSpan.FromMilliseconds(100),
                () =>
                {
                    foreach (Point3D trg in points)
                    {
                        int bloodID = Utility.RandomMinMax(4650, 4655);

                        new MovingEffectInfo(src, trg.Clone3D(0, 0, 2), m.Map, bloodID)
                            .MovingImpact(
                                info =>
                                {
                                    var blood = new Blood
                                    {
                                        ItemID = bloodID
                                    };
                                    blood.MoveToWorld(info.Target.Location, info.Map);

                                    Effects.PlaySound(info.Target, info.Map, 0x028);
                                });
                    }
                });
        }
		public override void OnThink()
		{
			if ( this.m_NextSpawn <= DateTime.Now && this.m_Spawns != null && this.m_Spawns.Count < 5 )
			{
				EvilSquirrel squirrel = new EvilSquirrel();
				squirrel.MoveToWorld( this.Location, this.Map );
				this.m_Spawns.Add( squirrel );
				this.m_NextSpawn = DateTime.Now + TimeSpan.FromSeconds( 45.0 );
			}

			if ( this.m_NextAbility < DateTime.Now )
			{
				if ( this.Hits < this.HitsMaxSeed && this.Combatant == null && this.Mana > 10 )
				{
					this.Hits += Utility.Random( 30, 40 );
					this.Mana -= 10;
					this.m_NextAbility = DateTime.Now + TimeSpan.FromSeconds( 5.0 );
				}
				if ( this.Combatant != null )
				{
					if ( this.Hits < this.HitsMaxSeed / 2 && this.Mana >= 10 )
					{
						this.Hits += Utility.Random( 40, 50 );
						this.Mana -= 10;
						this.Say( "Spirit of the woods, ease my pain." );
						this.m_NextAbility = DateTime.Now + TimeSpan.FromSeconds( 5.0 );
					}

					else if ( this.Combatant.Hits < this.Combatant.HitsMax / 2 && this.Mana >= 15 )
					{
						this.Say( "Guardians of Gaia, bring forth your grasping hands." );
						Blood blood = new Blood();
						blood.ItemID = 3391;
						blood.Name = "Grasping Roots";
						this.Combatant.Paralyzed = true;
						this.Mana -= 15;
						this.m_NextAbility = DateTime.Now + TimeSpan.FromSeconds( 10.0 );
					}

					else if ( this.Mana >= 30 )
					{
						this.Say( "Gaia, bring forth your wrath!" );
						ArrayList alist = new ArrayList();
						IPooledEnumerable eable = this.Map.GetMobilesInRange( this.Location, 10 );
						foreach( Mobile m in eable )
							alist.Add( m );
						eable.Free();
						this.PlaySound( 518 );
						this.m_NextAbility = DateTime.Now + TimeSpan.FromSeconds( 15.0 );
						Effects.SendLocationParticles( EffectItem.Create( this.Location, this.Map, TimeSpan.FromSeconds( 10.0 ) ), 0x37CC, 1, 50, 2101, 7, 9909, 0 );
						if ( alist.Count > 0 )
						{
							for( int i = 0; i < alist.Count; i++ )
							{
								Mobile m = (Mobile)alist[i];
								if ( m is EvilSquirrel )
								{}
								else
								{
									AOS.Damage( m, this, Utility.Random( 15, 20 ), 100, 0, 0, 0, 0 );
									m.BoltEffect( 2 );
								}
							}
						}
					}
				}
			}
		}
Exemple #46
0
            protected override void OnTick()
            {
                if (this.m_Mobile == null || this.m_Mobile.Map == null || this.m_Mobile.Deleted || !this.m_Mobile.Alive || this.m_Mobile.Map == Map.Internal)
                {
                    this.Stop();
                }
                else
                {
                    if (this.m_Location != this.m_Mobile.Location)
                    {
                        int amount = Utility.RandomMinMax(0, 7);

                        for (int i = 0; i < amount; i++)
                        {
                            int x = this.m_Mobile.X + Utility.RandomMinMax(-1, 1);
                            int y = this.m_Mobile.Y + Utility.RandomMinMax(-1, 1);
                            int z = this.m_Mobile.Z;

                            if (!this.m_Mobile.Map.CanFit(x, y, z, 1, false, false, true))
                            {
                                z = this.m_Mobile.Map.GetAverageZ(x, y);

                                if (!this.m_Mobile.Map.CanFit(x, y, z, 1, false, false, true))
                                {
                                    continue;
                                }
                            }

                            Blood blood = new Blood(Utility.RandomMinMax(0x122C, 0x122F));
                            blood.MoveToWorld(new Point3D(x, y, z), this.m_Mobile.Map);
                        }
                        this.m_Location = this.m_Mobile.Location;
                    }
                }
            }
Exemple #47
0
        public override void OnHit(Mobile attacker, Mobile defender, double damageBonus)
        {
            int bombwhere = Utility.Random(7);

            switch (bombwhere)
            {
            case 0:
                defender.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                break;

            case 1:
                defender.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.RightHand);
                break;

            case 2:
                defender.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.LeftHand);
                break;

            case 3:
                defender.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Waist);
                break;

            case 4:
                defender.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.LeftFoot);
                break;

            case 5:
                defender.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.RightFoot);
                break;

            case 6:
                defender.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.CenterFeet);
                break;
            }
            for (int x = defender.X - 5; x <= defender.X + 5; x++)
            {
                for (int y = defender.Y - 5; y <= defender.Y + 5; y++)
                {
                    Blood g = new Blood();
                    g.Visible = false;
                    g.MoveToWorld(new Point3D(x, y, defender.Z), defender.Map);
                    switch (Utility.Random(10))
                    {
                    case 0: // Fire column
                    {
                        Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x3709, 10, 30, 5052);
                        Effects.PlaySound(g, g.Map, 0x208);
                        break;
                    }

                    case 1: // Explosion

                    {
                        Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x36BD, 20, 10, 5044);
                        Effects.PlaySound(g, g.Map, 0x307);
                        break;
                    }

                    case 2:
                    {
                        Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x36FE, 10, 10, 5052);
                        break;
                    }

                    default:
                        break;
                    }
                }
            }
            int               explosionDamage = Utility.Random(30, 10);
            ArrayList         targets         = new ArrayList();
            IPooledEnumerable eable           = defender.Map.GetMobilesInRange(new Point3D(defender.Location), 5);

            foreach (Mobile m in eable)
            {
                targets.Add(m);
            }
            eable.Free();
            if (targets.Count > 0)
            {
                explosionDamage /= targets.Count;
                for (int i = 0; i < targets.Count; ++i)
                {
                    Mobile m = (Mobile)targets[i];
                    m.Damage(explosionDamage);
                    m.FixedParticles(0x3709, 10, 30, 5052, EffectLayer.CenterFeet);
                    m.PlaySound(0x208);
                }
            }
            base.OnHit(attacker, defender, damageBonus);
        }
Exemple #48
0
		void ICarvable.Carve(Mobile from, Item item)
		{
			Point3D loc = this.Location;
			if (this.ParentContainer != null)
			{
				if (this.ParentMobile != null)
				{
					if (this.ParentMobile != from)
					{
						from.SendMessage("You can't carve that there");
						return;
					}

					loc = this.ParentMobile.Location;
				}
				else
				{
					loc = this.ParentContainer.Location;
					if (!from.InRange(loc, 1))
					{
						from.SendMessage("That is too far away.");
						return;
					}
				}
			}


			//add blood
			Blood blood = new Blood(Utility.Random(0x122A, 5), Utility.Random(15 * 60, 5 * 60));
			blood.MoveToWorld(loc, Map);
			//add meat
			Jerky jerky = new Jerky(m_IOBAlignment);
			Jerky jerky2 = new Jerky(m_IOBAlignment);
			Jerky jerky3 = new Jerky(m_IOBAlignment);

			BodyPart heart = new BodyPart(BodyPart.Part.HEART);
			BodyPart liver = new BodyPart(BodyPart.Part.LIVER);
			BodyPart ent = new BodyPart(BodyPart.Part.ENTRAILS);

			if (this.ParentContainer == null)
			{
				jerky.MoveToWorld(loc, Map);
				jerky2.MoveToWorld(loc, Map);
				jerky3.MoveToWorld(loc, Map);
				heart.MoveToWorld(loc, Map);
				liver.MoveToWorld(loc, Map);
				ent.MoveToWorld(loc, Map);
			}
			else
			{
				this.ParentContainer.DropItem(jerky);
				this.ParentContainer.DropItem(jerky2);
				this.ParentContainer.DropItem(jerky3);
				this.ParentContainer.DropItem(heart);
				this.ParentContainer.DropItem(liver);
				this.ParentContainer.DropItem(ent);
			}

			this.Delete();
		}