public override void OnExplode( Mobile source, Item itemSource, int intensity, Point3D loc, Map map )
 {
     //Server.Effects.PlaySound( loc, map, 0x3B9 );
     foreach ( Mobile m in map.GetMobilesInRange( loc, ((BombPotion)itemSource).ExplosionRange ) )
         if ( m != null )
             if ( map.LineOfSight( loc, m ) )
                 m.MovingEffect( new Entity( Serial.Zero, loc, map ), 10244, 18, 1, false, false );
 }
			public static bool FindMobile( Map map, Point3D p )
			{
				IPooledEnumerable eable = map.GetMobilesInRange( p, 0 );

				foreach ( Mobile mob in eable )
				{
					if ( mob is BaseQuester )
					{
						int delta = mob.Z - p.Z;

						if ( delta >= -12 && delta <= 12 )
							m_Queue.Enqueue( mob );
					}
				}

				eable.Free();

				while ( m_Queue.Count > 0 )
					((Mobile)m_Queue.Dequeue()).Delete();

				return false;
			}
		public virtual void Explode( Mobile from, Point3D loc, Map map )
		{
			if ( Deleted || map == null )
				return;

			Consume();

			// Check if any other players are using this potion
			for ( int i = 0; i < m_Users.Count; i ++ )
			{
				ThrowTarget targ = m_Users[ i ].Target as ThrowTarget;

				if ( targ != null && targ.Potion == this )
					Target.Cancel( from );
			}

			// Effects
			Effects.PlaySound( loc, map, 0x207 );

			Geometry.Circle2D( loc, map, Radius, new DoEffect_Callback( BlastEffect ), 270, 90 );

			Timer.DelayCall( TimeSpan.FromSeconds( 0.3 ), new TimerStateCallback( CircleEffect2 ), new object[] { loc, map } );

			foreach ( Mobile mobile in map.GetMobilesInRange( loc, Radius ) )
			{
				if ( mobile is BaseCreature )
				{
					BaseCreature mon = (BaseCreature) mobile;

					if ( mon.Controlled || mon.Summoned )
						continue;

					mon.Pacify( from, DateTime.UtcNow + TimeSpan.FromSeconds( 5.0 ) ); // TODO check
				}
			}
		}
		public void Explode( Mobile from, bool direct, Point3D loc, Map map )
		{
			if ( Deleted )
				return;

			BrotherMaynard.SellBomb = true;
			BrotherMaynard.Attempts = BrotherMaynard.Attempts + 1;

			Delete();

			if ( map == null )
				return;

			Effects.PlaySound( loc, map, 0x207 );
			Effects.SendLocationEffect( loc, map, 0x36BD, 20 );

			ArrayList list = new ArrayList();

			foreach ( Mobile m in map.GetMobilesInRange( loc, 2 ) )
			{
				if ( m is BigTeethRabbit )
				{
					list.Add( m );
				}
			}

			foreach ( Mobile m in list )
			{
				m.Kill();
			}
		}
		public virtual void Explode( Mobile from, Point3D loc, Map map )
		{
			if ( Deleted || map == null )
				return;

			Consume();
			
			// Check if any other players are using this potion
			for ( int i = 0; i < m_Users.Count; i ++ )
			{
				ThrowTarget targ = m_Users[ i ].Target as ThrowTarget;

				if ( targ != null && targ.Potion == this )
					Target.Cancel( from );
			}
			
			// Add delay
			AddDelay( from );
			
			// Effects		
			Effects.PlaySound( loc, map, 0x207 );
			
			EffectCircle( loc, map, Radius );
			
			foreach ( Mobile mobile in map.GetMobilesInRange( loc, Radius ) )
			{
				if ( mobile is BaseCreature )
				{
					BaseCreature mon = (BaseCreature) mobile;
					
					mon.Pacify( from, DateTime.Now + TimeSpan.FromSeconds( 5.0 ) ); // TODO check
				}
			}
		}
		public void CheckForMobileVictims( Point3D location, Map map, BombBag sourcebag )
		{
			IPooledEnumerable ie = map.GetMobilesInRange( location, 0 );
			
			List<Mobile> tomove = new List<Mobile>();
			
			foreach( Mobile m in ie )
			{
				if( Players.IndexOf( m ) > -1 )
				{
					if( m != sourcebag.Owner )
					{
						
					
						m.SendMessage( "You've been blown up by " + sourcebag.Owner.Name + "'s blast!" );
					
						//handle scoring
						BoardGameData.ChangeScore( GameName, sourcebag.Owner, BombermanSettings.KILL_SCORE );
					
						BoardGameData.ChangeScore( GameName, m, BombermanSettings.DEATH_SCORE );
						BoardGameData.AddLose( GameName, m );
					}
					else
					{
						m.SendMessage( "You just blew yourself up!!" );
						
						BoardGameData.ChangeScore( GameName, m, BombermanSettings.SUICIDE_SCORE );
					}
					
					
					m.PlaySound( m.Female? 0x32E : 0x549 );
					//0x54A - yelp1 
					
					tomove.Add( m );
				}
			}
			ie.Free();
			
			foreach( Mobile m in tomove )
			{
				m.MoveToWorld( new Point3D( X - 1, Y - 1, Z ), Map );
				m.SendGump( new BoardGameLostGump( m, this ) );
				
				Players.Remove( m );
				
				BombBag bag = (BombBag)m.Backpack.FindItemByType( typeof( BombBag ) );
				
				if( bag != null )
				{
					//don't let players run around blowing stuff up outside the game while they wait for others to finish
					bag.Active = false;
				}
				
				//start the timer to check for endgame, delay for 1s
			}
			//test big bomb chain!
			StartEndGameTimer( TimeSpan.FromSeconds( 1 ) );
		}
Beispiel #7
0
        public void Explode( Mobile from, bool direct, Point3D loc, Map map )
        {
            if ( Deleted )
                return;

            Delete();

            for ( int i = 0; m_Users != null && i < m_Users.Count; ++i )
            {
                Mobile m = (Mobile)m_Users[i];
                ThrowTarget targ = m.Target as ThrowTarget;

                if ( targ != null && targ.Potion == this )
                    Target.Cancel( m );
            }

            if ( map == null )
            {
                return;
            }

            IPooledEnumerable eable = LeveledExplosion ? map.GetObjectsInRange( loc, m_ExplosionRange ) : map.GetMobilesInRange( loc, m_ExplosionRange );
            ArrayList toExplode = new ArrayList();

            int toDamage = 0;

            foreach ( object o in eable )
            {
                if ( o is Mobile )
                {
                    toExplode.Add( o );
                    ++toDamage;
                }
                else if ( o is BombPotion && o != this )
                {
                    toExplode.Add( o );
                }
            }

            eable.Free();

            foreach ( KeyValuePair<CustomEffect, int> kvp in Effects )
            {
                CustomPotionEffect effect = CustomPotionEffect.GetEffect( kvp.Key );
                if ( effect != null )
                    effect.OnExplode( from, this, kvp.Value, loc, map );
            }

            Point3D eye = new Point3D( loc );
            eye.Z += 14;

            for ( int i = 0; i < toExplode.Count; ++i )
            {
                object o = toExplode[i];

                if ( o is Mobile )
                {
                    Mobile m = (Mobile)o;
                    Point3D target = new Point3D( m.Location );
                    target.Z += 14;

                    if ( from == null || (SpellHelper.ValidIndirectTarget( from, m ) && from.CanBeHarmful( m, false )) )
                    {
                        if ( o != null && map.LineOfSight( eye, target ) )
                        {
                            foreach ( KeyValuePair<CustomEffect, int> kvp in Effects )
                            {
                                CustomPotionEffect effect = CustomPotionEffect.GetEffect( kvp.Key );
                                if ( effect != null )
                                    effect.ApplyEffect( m, from, kvp.Value, this );
                            }
                        }
                    }
                }
                else if ( o is BombPotion )
                {
                    BombPotion pot = (BombPotion)o;
                    Point3D target = new Point3D( pot.Location );
                    target.Z += 14;
                    if ( o != null && map.LineOfSight( eye, target ) )
                        pot.Explode( from, false, pot.GetWorldLocation(), pot.Map );
                }
            }
        }
Beispiel #8
0
        private void CheckHint(Map map)
        {
            IPooledEnumerable eable = map.GetMobilesInBounds(new Rectangle2D(735, 2135, 24, 24));

            foreach (Mobile m in eable)
            {
                if (m is BaseVendor)
                {
                    IPooledEnumerable players = map.GetMobilesInRange(m.Location, 3);

                    foreach (Mobile player in players)
                    {
                        if (player is PlayerMobile && ((PlayerMobile)player).NpcGuild == NpcGuild.RangersGuild && !player.Hidden)
                        {
                            GiveHint(player, m);
                            eable.Free();
                            players.Free();
                            return;
                        }
                    }

                    players.Free();
                }
            }

            eable.Free();
        }
		public static FillableContent Acquire( Point3D loc, Map map )
		{
			if ( map == null || map == Map.Internal )
				return null;

			if ( m_AcquireTable == null )
			{
				m_AcquireTable = new Hashtable();

				for ( int i = 0; i < m_ContentTypes.Length; ++i )
				{
					FillableContent fill = m_ContentTypes[i];

					for ( int j = 0; j < fill.m_Vendors.Length; ++j )
						m_AcquireTable[fill.m_Vendors[j]] = fill;
				}
			}

			Mobile nearest = null;
			FillableContent content = null;

			foreach ( Mobile mob in map.GetMobilesInRange( loc, 20 ) )
			{
				if ( nearest != null && mob.GetDistanceToSqrt( loc ) > nearest.GetDistanceToSqrt( loc ) && !(nearest is Cobbler && mob is Provisioner) )
					continue;

				FillableContent check = m_AcquireTable[mob.GetType()] as FillableContent;

				if ( check != null )
				{
					nearest = mob;
					content = check;
				}
			}

			return content;
		}
Beispiel #10
0
        public void ResolveCannonHit(Mobile from, Point3D targetLocation)
        {
            ArrayList validTargets = new ArrayList();

            Map map = Map;

            BaseShip targetShip = BaseShip.FindShipAt(targetLocation, map);

            bool hitObject     = false;
            bool hitShip       = false;
            bool showExplosion = true;

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

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

            nearbyMobiles.Free();

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

            double baseCannonDamage = (double)(Utility.RandomMinMax(BaseShip.BaseCannonDamageMin, BaseShip.BaseCannonDamageMax));

            if (m_Ship == null)
            {
                m_MobilesOnSourceShip.Add(from);
            }

            else
            {
                baseCannonDamage = m_Ship.m_ShipStatsProfile.CannonMinDamage + (Utility.RandomDouble() * (m_Ship.m_ShipStatsProfile.CannonMaxDamage - m_Ship.m_ShipStatsProfile.CannonMinDamage));

                m_MobilesOnSourceShip = m_Ship.GetMobilesOnShip(false, false);
            }

            bool targetLocationIsShip = false;

            if (targetShip != null)
            {
                targetLocationIsShip = true;
                m_Targets            = targetShip.GetMobilesOnShip(false, false);

                validTargets.Add(targetShip);
            }

            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 Ship 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 ship that cannon is shooting from
                    BaseShip mobileShip = BaseShip.FindShipAt(mobile.Location, mobile.Map);

                    if (m_Ship != null && mobileShip != null)
                    {
                        if (m_Ship == mobileShip)
                        {
                            continue;
                        }
                    }

                    hitObject = true;

                    bool dealDamage = true;
                    bool directHit  = false;

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

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

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

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

                            else
                            {
                                damageDealt *= BaseShip.CannonMobileDamageMultiplier;
                            }
                        }

                        if (!directHit)
                        {
                            damageDealt *= BaseShip.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 BaseShip && !largeCreatureHit)
                {
                    BaseShip shipTarget = target as BaseShip;

                    if (from != null && m_Ship != null && shipTarget != null)
                    {
                        //Somehow Hitting Own Ship
                        if (m_Ship == shipTarget)
                        {
                            continue;
                        }

                        CannonDoHarmful(from, m_MobilesOnSourceShip, m_Targets);

                        hitObject = true;
                        hitShip   = true;

                        bool dealDamage = true;

                        if (dealDamage)
                        {
                            DamageType damageType = shipTarget.GetDamageTypeByTargetingMode(m_Ship.m_TargetingMode);

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

                            shipTarget.ReceiveDamage(from, m_Ship, 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_Ship.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 void Explode( Mobile from, bool direct, Point3D loc, Map map )
		{
			if ( Deleted )
				return;

			Consume();

			for ( int i = 0; m_Users != null && i < m_Users.Count; ++i )
			{
				Mobile m = (Mobile)m_Users[i];
				ThrowTarget targ = m.Target as ThrowTarget;

				if ( targ != null && targ.Potion == this )
					Target.Cancel( m );
			}

			if ( map == null )
				return;

			Effects.SendLocationParticles( EffectItem.Create( loc, map, EffectItem.DefaultDuration ), 0x36B0, 1, 14, 63, 7, 9915, 0 );
			Effects.PlaySound( loc, map, 0x229 );

			IPooledEnumerable eable = LeveledExplosion ? map.GetObjectsInRange( loc, ExplosionRange ) : map.GetMobilesInRange( loc, ExplosionRange );
			ArrayList toExplode = new ArrayList();

			int toDamage = 0;

			foreach ( object o in eable )
			{
				if ( o is Mobile )
				{
					toExplode.Add( o );
					++toDamage;
				}
				else if ( o is BasePoisonExplosionPotion && o != this )
				{
					toExplode.Add( o );
				}
			}

			eable.Free();

			for ( int i = 0; i < toExplode.Count; ++i )
			{
				object o = toExplode[i];

				if ( o is Mobile )
				{
					Mobile m = (Mobile)o;

					if ( from == null || (SpellHelper.ValidIndirectTarget( from, m ) && from.CanBeHarmful( m, false )) )
					{
						if ( from != null )
							from.DoHarmful( m );
							
						int level = 0;
						if( this.PotionEffect == PotionEffect.ExplosionLesser )
						{
							level = 1;
						}
						else if ( this.PotionEffect == PotionEffect.Explosion )
						{
							level = 2;
						}
						else if ( this.PotionEffect == PotionEffect.ExplosionGreater )
						{
							level = 3;
						}
							
						m.ApplyPoison( from, Poison.GetPoison(level) );
					}
				}
				else if ( o is BasePoisonExplosionPotion )
				{
					BasePoisonExplosionPotion pot = (BasePoisonExplosionPotion)o;

					pot.Explode( from, false, pot.GetWorldLocation(), pot.Map );
				}
			}
		}
Beispiel #12
0
        // Main Aura Method
        public static void Aura(Point3D location, Map map, Mobile from, int min, int max, ResistanceType type, int range, Poison poison, string text, bool scales, bool allownull, bool effects, int itemid, int hue)
        {
            if (from == null && !allownull)
            {
                return;
            }

            List <Mobile>     targets = new List <Mobile>();
            IPooledEnumerable eable   = map.GetMobilesInRange(location, range);

            foreach (Mobile m in eable)
            {
                if (CanTarget(from, m, true, false, allownull))
                {
                    targets.Add(m);
                }
            }
            eable.Free();

            if (effects && from != null)
            {
                from.Animate(12, 5, 1, true, false, 0);
            }

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

                if (text != "")
                {
                    m.SendMessage(text);
                }

                int auradamage = Utility.RandomMinMax(min, max);

                if (scales)
                {
                    auradamage = (int)((auradamage / GetDist(location, m.Location)) * range);
                }

                if (poison != null)
                {
                    m.ApplyPoison((from == null) ? m : from, poison);
                }

                if (effects)
                {
                    m.FixedParticles(itemid, 10, 15, 5030 /*what the hell does this number do?*/, hue, 0, EffectLayer.Waist);
                }

                switch (type)
                {
                case ResistanceType.Physical:
                    AOS.Damage(m, (from == null) ? m : from, auradamage, 100, 0, 0, 0, 0);
                    break;

                case ResistanceType.Fire:
                    AOS.Damage(m, (from == null) ? m : from, auradamage, 0, 100, 0, 0, 0);
                    break;

                case ResistanceType.Cold:
                    AOS.Damage(m, (from == null) ? m : from, auradamage, 0, 0, 100, 0, 0);
                    break;

                case ResistanceType.Poison:
                    AOS.Damage(m, (from == null) ? m : from, auradamage, 0, 0, 0, 100, 0);
                    break;

                case ResistanceType.Energy:
                    AOS.Damage(m, (from == null) ? m : from, auradamage, 0, 0, 0, 0, 100);
                    break;
                }
            }

            targets.Clear();
        }
Beispiel #13
0
		public void Explode( Mobile from, bool direct, Point3D loc, Map map )
		{
			PBGrenade nade = this;
			if ( Deleted )
				return;

			Consume();

			for ( int i = 0; m_Users != null && i < m_Users.Count; ++i )
			{
				Mobile m = (Mobile)m_Users[i];
				ThrowTarget targ = m.Target as ThrowTarget;

				if ( targ != null && targ.Nade == this )
					Target.Cancel( m );
			}

			if ( map == null )
				return;

			Effects.PlaySound( loc, map, 0x207 );
			Effects.SendLocationEffect( loc, map, 0x36BD, 35, this.Hue, 0 );

			int alchemyBonus = 0;

			if ( direct )
				alchemyBonus = (int)(from.Skills.Alchemy.Value / (Core.AOS ? 5 : 10));

			IPooledEnumerable eable = LeveledExplosion ? map.GetObjectsInRange( loc, ExplosionRange ) : map.GetMobilesInRange( loc, ExplosionRange );
			ArrayList toExplode = new ArrayList();

			int toDamage = 0;

			foreach ( object o in eable )
			{
				if ( o is Mobile )
				{
					toExplode.Add( o );
					++toDamage;
				}
				else if ( o is PBGrenade && o != this )
				{
					toExplode.Add( o );
				}
			}

			eable.Free();

		

			for ( int i = 0; i < toExplode.Count; ++i )
			{
				object o = toExplode[i];

				if ( o is Mobile )
				{
					Mobile m = (Mobile)o;

					if ( from == null || (SpellHelper.ValidIndirectTarget( from, m ) && from.CanBeHarmful( m, false )) )
					{
						if ( from != null )
							//from.DoHarmful( m );
							
							if ( m_PBGI.Players.Contains(m) || m_PBGI.NpcPlayers.Contains(m) )
							{
							DoDamage( nade, from, m );
							}
							else
							{
							from.SendMessage( "You cannot attack someone that is not playing!" );
				            m.SendMessage( "You are not playing Paintball, please leave the area." );
							}

					

						/*

						if ( !Core.AOS && damage > 40 )
							damage = 40;
						else if ( Core.AOS && toDamage > 2 )
							damage /= toDamage - 1;

						AOS.Damage( m, from, damage, 0, 100, 0, 0, 0 ); */
					}
				}
				else if ( o is PBGrenade )
				{
					PBGrenade pot = (PBGrenade)o;

					pot.Explode( from, false, pot.GetWorldLocation(), pot.Map );
				}
				else
				{
					DoDamage( nade, from );
				}
			}
		}
Beispiel #14
0
        public override bool Use(Mobile user)
        {
            if (this.Movable)
            {
                user.BeginTarget(12, true, Server.Targeting.TargetFlags.None, delegate(Mobile from, object obj)
                {
                    if (this.Movable && !this.Deleted)
                    {
                        IPoint3D pt = obj as IPoint3D;

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

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

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

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

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

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

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

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

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

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

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

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

                                            from.DoHarmful(mob);

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

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

            return(false);
        }
		public void Explode( Mobile from, bool direct, Point3D loc, Map map )
		{
			if ( Deleted )
				return;


			Delete();

			if ( map == null )
				return;

			Effects.PlaySound( loc, map, 0x207 );
			Effects.SendLocationEffect( loc, map, 0x36BD, 20 );

			ArrayList list = new ArrayList();

			foreach ( Mobile m in map.GetMobilesInRange( loc, 0 ) )
			{
				if ( m is HojanKing )
				{
					list.Add( m );
				}
			}

			foreach ( Mobile m in list )
			{
				m.Kill();
			}
		}
Beispiel #16
0
        public List<Mobile> FindMobiles(Mobile shooter, Point3D pnt, Map map, bool player, bool pet, bool monsters, bool seacreature)
        {
            List<Mobile> list = new List<Mobile>();

            if (map == null || map == Map.Internal || m_Galleon == null)
                return list;

            IPooledEnumerable eable = map.GetMobilesInRange(pnt, 0);

            foreach (Mobile mob in eable)
            {
                if (!shooter.CanBeHarmful(mob, false) || m_Galleon.Contains(mob))
                    continue;

                if (player && mob is PlayerMobile)
                    list.Add(mob);

                if (monsters && mob is BaseCreature && !((BaseCreature)mob).Controlled && !((BaseCreature)mob).Summoned)
                    list.Add(mob);

                if (pet && mob is BaseCreature && (((BaseCreature)mob).Controlled || ((BaseCreature)mob).Summoned))
                    list.Add(mob);

                if (seacreature && mob is BaseSeaChampion)
                    list.Add(mob);
            }

            eable.Free();

            return list;
        }
        public void Explode( bool direct, Point3D loc, Map map)
        {
            if (Deleted)
                return;

            Delete();

            if (map == null)
                return;

            Effects.PlaySound(loc, map, 0x207);
            for (int i = 0; i < 20; i++)
            {
                Point3D temp1 = new Point3D(loc.X, loc.Y, (loc.Z + i));
                Effects.SendLocationEffect(temp1, map, 0x3709, 60);
            }

            IPooledEnumerable eable = LeveledExplosion ? map.GetObjectsInRange(loc, ExplosionRange) : map.GetMobilesInRange(loc, ExplosionRange);
            ArrayList toExplode = new ArrayList();

            foreach (object o in eable)
            {
                if (o is Mobile)
                {
					if(o is ElementalChamp) { }
					else
	                    toExplode.Add(o);
                }

                else if (o is Atomic && o != this)
                {
                    toExplode.Add(o);
                }
            }

            eable.Free();

            for (int i = 0; i < toExplode.Count; ++i)
            {
                object o = toExplode[i];

                if (o is Mobile)
                {
                    Mobile m = (Mobile)o;

                    Spells.SpellHelper.Damage(TimeSpan.FromTicks(0), m, 40);
                }
                else if (o is Atomic)
                {
                    Atomic pot = (Atomic)o;

                    pot.Explode( false, pot.GetWorldLocation(), pot.Map);
                }
            }
            if (map != null)
            {
                for (int x = -8; x <= 8; ++x)
                {
                    for (int y = -8; y <= 8; ++y)
                    {
                        double dist = Math.Sqrt(x * x + y * y);

                        if (dist <= 8)
                        {
                            Explotion(loc, map, X + x, Y + y);
                        }
                    }
                }
            }

        }
		public virtual void Explode( Mobile from, Point3D loc, Map map )
		{
			if ( Deleted || map == null )
				return;

			Consume();

			// Check if any other players are using this potion
			for ( int i = 0; i < m_Users.Count; i ++ )
			{
				ThrowTarget targ = m_Users[ i ].Target as ThrowTarget;

				if ( targ != null && targ.Potion == this )
					Target.Cancel( from );
			}

			// Effects
			Effects.PlaySound( loc, map, 0x207 );

			Geometry.Circle2D( loc, map, Radius, new DoEffect_Callback( TarEffect ), 270, 90 );

			Timer.DelayCall( TimeSpan.FromSeconds( 1 ), new TimerStateCallback( CircleEffect2 ), new object[] { loc, map } );
  
                      	foreach ( Mobile mobile in map.GetMobilesInRange( loc, Radius ) )
			{					
                             if ( mobile != from ) 
			     {
                                  if ( mobile is PlayerMobile )
				  {
					PlayerMobile player = (PlayerMobile) mobile;
 
                                        player.SendLocalizedMessage(1095151);    
                                  }
				
                                  mobile.Send( SpeedControl.WalkSpeed );

                                  Timer.DelayCall(TimeSpan.FromMinutes(1.0), delegate()
                                  {                                
					mobile.Send( SpeedControl.Disable );
                                  });            
			     } 
		       }
		}
Beispiel #19
0
        public void Explode( Mobile from, bool direct, Point3D loc, Map map )
        {
            if ( Deleted )
                return;

            Consume();

            for ( int i = 0; m_Users != null && i < m_Users.Count; ++i )
            {
                Mobile m = (Mobile)m_Users[i];
                ThrowTarget targ = m.Target as ThrowTarget;

                if ( targ != null && targ.Potion == this )
                    Target.Cancel( m );
            }

            if ( map == null )
                return;

            Effects.PlaySound( loc, map, 0x207 );
            Effects.SendLocationEffect( loc, map, 0x36BD, 20 );

            int alchemyBonus = 0;

            if ( direct )
                alchemyBonus = (int)(from.Skills.Alchemy.Value / (Core.AOS ? 5 : 10));

            IPooledEnumerable eable = LeveledExplosion ? map.GetObjectsInRange( loc, ExplosionRange ) : map.GetMobilesInRange( loc, ExplosionRange );
            ArrayList toExplode = new ArrayList();

            int toDamage = 0;

            foreach ( object o in eable )
            {
                if ( o is Mobile )
                {
                    toExplode.Add( o );
                    ++toDamage;
                }
                else if ( o is BaseExplosionPotion && o != this )
                {
                    toExplode.Add( o );
                }
            }

            eable.Free();

            int min = Scale( from, MinDamage );
            int max = Scale( from, MaxDamage );

            for ( int i = 0; i < toExplode.Count; ++i )
            {
                object o = toExplode[i];

                if ( o is Mobile )
                {
                    Mobile m = (Mobile)o;

                    if ( from == null || (SpellHelper.ValidIndirectTarget( from, m ) && from.CanBeHarmful( m, false )) )
                    {
                        if ( from != null )
                            from.DoHarmful( m );

                        int damage = Utility.RandomMinMax( min, max );

                        damage += alchemyBonus;

                        if ( !Core.AOS && damage > 40 )
                            damage = 40;
                        else if ( Core.AOS && toDamage > 2 )
                            damage /= toDamage - 1;

                        AOS.Damage( m, from, damage, 0, 100, 0, 0, 0 );
                    }
                }
                else if ( o is BaseExplosionPotion )
                {
                    BaseExplosionPotion pot = (BaseExplosionPotion)o;

                    pot.Explode( from, false, pot.GetWorldLocation(), pot.Map );
                }
            }
        }
      public void Explode( Mobile from, bool direct, Point3D loc, Map map )
      {
         if ( Deleted )
            return;

         Delete();

         if ( map == null )
            return;

         Effects.PlaySound( loc, map, 0x207 );
         for( int i=0; i<20;i++)
         {
            Point3D temp1 = new Point3D( loc.X, loc.Y, (loc.Z + i));
            Effects.SendLocationEffect( temp1, map, 0x3709, 60 );
         }

         int alchemyBonus = direct ? (int)(from.Skills[SkillName.Alchemy].Value / 10) : 0;

         IPooledEnumerable eable = LeveledExplosion ? map.GetObjectsInRange( loc, ExplosionRange ) : map.GetMobilesInRange( loc, ExplosionRange );
         ArrayList toExplode = new ArrayList();

         foreach ( object o in eable )
         {
            if ( o is Mobile )
            {
               toExplode.Add( o );
            }
            else if ( o is BaseAtomicBomb && o != this )
            {
               toExplode.Add( o );
            }
         }

         eable.Free();

         for ( int i = 0; i < toExplode.Count; ++i )
         {
            object o = toExplode[i];

            if ( o is Mobile )
            {
               Mobile m = (Mobile)o;

               if ( from == null || (SpellHelper.ValidIndirectTarget( from, m ) && from.CanBeHarmful( m, false )) )
               {
                  if ( from != null )
                     from.DoHarmful( m );

                  int damage = Utility.RandomMinMax( MinDamage, MaxDamage );

                  damage += alchemyBonus;

                  if ( damage > 40 )
                     damage = 40;

                  AOS.Damage( from, damage, 0, 100, 0, 0, 0 );
               }
            }
            else if ( o is BaseAtomicBomb )
            {
               BaseAtomicBomb pot = (BaseAtomicBomb)o;

               pot.Explode( from, false, pot.GetWorldLocation(), pot.Map );
            }
         }
         if ( map != null )
         {
            for ( int x = -8; x <= 8; ++x )
            {
               for ( int y = -8; y <= 8; ++y )
               {
                  double dist = Math.Sqrt(x*x+y*y);

                  if ( dist <= 8 )
                  {
                     Explotion( loc, map, X + x, Y + y );
                  }
               }
            }
         }

      }