Inheritance: BaseCreature, IIlluminatingObject
Beispiel #1
0
        public void DoSpawn()
        {
            Map map = this.Map;

            if (map != null && Utility.RandomBool())
            {
                this.PlaySound(0x218);//////////

                int    newFollowers = Utility.RandomMinMax(2, 5);
                Mobile focus        = GetRandomTarget(10, false);

                if (focus != null)
                {
                    for (int i = 0; i < newFollowers; ++i)
                    {
                        BaseCreature spawn;

                        switch (Utility.Random(5))
                        {
                        default:
                        case 0: spawn = new WaterElemental(); break;

                        case 1: spawn = new EarthElemental(); break;

                        case 2: spawn = new FireSteed(); break;

                        case 3: spawn = new FireElemental(); break;

                        case 4: spawn = new AirElemental(); break;
                        }

                        spawn.Team = this.Team;

                        bool    validLocation = false;
                        Point3D loc           = focus.Location;

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

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

                        spawn.MoveToWorld(loc, map);
                        spawn.Combatant = focus;
                    }
                }
            }
        }
Beispiel #2
0
        private void DoSummon(Mobile combatant, string message)
        {
            Blessed = true;
            this.Freeze(TimeSpan.FromSeconds(60.0));
            new InternalTimer(this).Start();

            Map map = this.Map;

            if (map == null)
            {
                return;
            }

            int newSpawned = 6;

            for (int i = 0; i < newSpawned; ++i)
            {
                BaseCreature spawn;

                if (Utility.Random(6) < 4)
                {
                    spawn = new FireElemental();
                }
                else
                {
                    spawn = new FireElemental();                                             //new GreaterFireElemental();
                }
                spawn.Team = this.Team;
                spawn.Map  = map;
                bool    validLocation = false;
                Point3D loc           = this.Location;

                for (int j = 0; !validLocation && j < 10; ++j)
                {
                    int x = X + Utility.Random(3) - 1;
                    int y = Y + Utility.Random(3) - 1;
                    int z = map.GetAverageZ(x, y);

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

                spawn.MoveToWorld(loc, map);
            }
        }
Beispiel #3
0
        public void DoSummon()
        {
            if (this.Map != null)
            {
                Map map    = this.Map;
                int amount = Utility.RandomMinMax(3, 8);

                for (int l = 0; l < amount; ++l)
                {
                    for (int k = 0; k < 1; ++k)
                    {
                        bool    validLocation = false;
                        Point3D loc           = this.Location;
                        for (int j = 0; !validLocation && j < 10; ++j)
                        {
                            int x = X + Utility.Random(11) - 5;
                            int y = Y + Utility.Random(11) - 5;
                            int z = map.GetAverageZ(x, y);

                            if (validLocation = map.CanFit(x, y, this.Z, 16, false, false))
                            {
                                loc = new Point3D(x, y, Z);
                            }
                            else if (validLocation = map.CanFit(x, y, z, 16, false, false))
                            {
                                loc = new Point3D(x, y, z);
                            }
                        }
                        switch (Utility.Random(4))
                        {
                        case 0: MagmaElemental serpent = new MagmaElemental();
                            SpellHelper.Summon(serpent, this, 0, TimeSpan.FromMinutes(2.0), false, false);
                            break;

                        case 1: VolitileFlameSpawn fiend = new VolitileFlameSpawn();
                            SpellHelper.Summon(fiend, this, 0, TimeSpan.FromMinutes(2.0), false, false);
                            break;

                        case 2: FireElemental ice = new FireElemental();
                            SpellHelper.Summon(ice, this, 0, TimeSpan.FromMinutes(2.0), false, false);
                            break;

                        case 3: LavaHopper snow = new LavaHopper();
                            SpellHelper.Summon(snow, this, 0, TimeSpan.FromMinutes(2.0), false, false);
                            break;
                        }
                    }
                }
            }
        }
Beispiel #4
0
        public override void OnHitsChange(int oldValue)
        {

            if (Map != null && 0.05 > Utility.RandomDouble())
            {
                Map map = Map;

                if (map == null)
                    return;
                BaseCreature spawn = new SpiritMinion();

                spawn.Team = Team;
                bool validLocation = false;
                Point3D loc = Location;

                for (int j = 0; !validLocation && j < 10; ++j)
                {
                    int x = X + Utility.Random(8) - 1;
                    int y = Y + Utility.Random(8) - 1;
                    int z = map.GetAverageZ(x, y);

                    if (validLocation == map.CanFit(x, y, Z, 16, false, false))
                        loc = new Point3D(x, y, Z);
                    else if (validLocation == map.CanFit(x, y, z, 16, false, false))
                        loc = new Point3D(x, y, z);
                }
                PublicOverheadMessage(MessageType.Regular, 0x3B2, true,"In Flam Kal Xen");
                spawn.MoveToWorld(loc, map);
                Effects.SendLocationEffect(new Point3D(X, Y, Z), Map, 0x3709, 30);
            }
            else if (Map != null && 0.04 > Utility.RandomDouble())
            {
                Map map = Map;

                if (map == null)
                    return;
                BaseCreature spawn = new FireElemental();

                spawn.Team = Team;
                bool validLocation = false;
                Point3D loc = Location;

                for (int j = 0; !validLocation && j < 10; ++j)
                {
                    int x = X + Utility.Random(8) - 1;
                    int y = Y + Utility.Random(8) - 1;
                    int z = map.GetAverageZ(x, y);

                    if (validLocation == map.CanFit(x, y, Z, 16, false, false))
                        loc = new Point3D(x, y, Z);
                    else if (validLocation == map.CanFit(x, y, z, 16, false, false))
                        loc = new Point3D(x, y, z);
                }
                PublicOverheadMessage(MessageType.Regular, 0x3B2, true, "Kal Vas Xen Flam");
                spawn.MoveToWorld(loc, map);
                Effects.SendLocationEffect(new Point3D(X, Y, Z), Map, 0x3709, 30);
            }

            base.OnHitsChange(oldValue);
        }
Beispiel #5
0
        public override void OnHitsChange(int oldValue)
        {
            if (Map != null && 0.05 > Utility.RandomDouble())
            {
                Map map = Map;

                if (map == null)
                {
                    return;
                }
                BaseCreature spawn = new SpiritMinion();

                spawn.Team = Team;
                bool    validLocation = false;
                Point3D loc           = Location;

                for (int j = 0; !validLocation && j < 10; ++j)
                {
                    int x = X + Utility.Random(8) - 1;
                    int y = Y + Utility.Random(8) - 1;
                    int z = map.GetAverageZ(x, y);

                    if (validLocation == map.CanFit(x, y, Z, 16, false, false))
                    {
                        loc = new Point3D(x, y, Z);
                    }
                    else if (validLocation == map.CanFit(x, y, z, 16, false, false))
                    {
                        loc = new Point3D(x, y, z);
                    }
                }
                PublicOverheadMessage(MessageType.Regular, 0x3B2, true, "In Flam Kal Xen");
                spawn.MoveToWorld(loc, map);
                Effects.SendLocationEffect(new Point3D(X, Y, Z), Map, 0x3709, 30);
            }
            else if (Map != null && 0.04 > Utility.RandomDouble())
            {
                Map map = Map;

                if (map == null)
                {
                    return;
                }
                BaseCreature spawn = new FireElemental();

                spawn.Team = Team;
                bool    validLocation = false;
                Point3D loc           = Location;

                for (int j = 0; !validLocation && j < 10; ++j)
                {
                    int x = X + Utility.Random(8) - 1;
                    int y = Y + Utility.Random(8) - 1;
                    int z = map.GetAverageZ(x, y);

                    if (validLocation == map.CanFit(x, y, Z, 16, false, false))
                    {
                        loc = new Point3D(x, y, Z);
                    }
                    else if (validLocation == map.CanFit(x, y, z, 16, false, false))
                    {
                        loc = new Point3D(x, y, z);
                    }
                }
                PublicOverheadMessage(MessageType.Regular, 0x3B2, true, "Kal Vas Xen Flam");
                spawn.MoveToWorld(loc, map);
                Effects.SendLocationEffect(new Point3D(X, Y, Z), Map, 0x3709, 30);
            }

            base.OnHitsChange(oldValue);
        }
Beispiel #6
0
        public void SpawnFollowers(Mobile target)
        {
            Map map = this.Map;

            if (map == null)
                return;

            int followers = 0;

            foreach (Mobile m in this.GetMobilesInRange(10))
            {
                if (m is EarthElemental || m is FireElemental || m is AirElemental || m is FireSteed || m is WaterElemental)
                    ++followers;
            }

            if (this.Followers < 9)
            {
                this.PlaySound(0x218);//////////

                int newFollowers = Utility.RandomMinMax(1, 3);

                for (int i = 0; i < newFollowers; ++i)
                {
                    BaseCreature follower;

                    switch (Utility.Random(5))
                    {
                        default:
                        case 0:
                            follower = new WaterElemental();
                            break;
                        case 1:
                            follower = new EarthElemental();
                            break;
                        case 2:
                            follower = new FireSteed();
                            break;
                        case 3:
                            follower = new FireElemental();
                            break;
                        case 4:
                            follower = new AirElemental();
                            break;
                    }

                    follower.Team = this.Team;

                    bool validLocation = false;
                    Point3D loc = this.Location;

                    for (int j = 0; !validLocation && j < 9; ++j)
                    {
                        int x = this.X + Utility.Random(3) - 1;
                        int y = this.Y + Utility.Random(3) - 1;
                        int z = map.GetAverageZ(x, y);

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

                    follower.MoveToWorld(loc, map);
                    follower.Combatant = target;
                }
            }
        }
        public void SpawnFollowers(Mobile target)
        {
            Map map = this.Map;

            if (map == null)
            {
                return;
            }

            int followers = 0;

            foreach (Mobile m in this.GetMobilesInRange(10))
            {
                if (m is EarthElemental || m is FireElemental || m is AirElemental || m is FireSteed || m is WaterElemental)
                {
                    ++followers;
                }
            }

            if (this.Followers < 9)
            {
                this.PlaySound(0x218);//////////

                int newFollowers = Utility.RandomMinMax(1, 3);

                for (int i = 0; i < newFollowers; ++i)
                {
                    BaseCreature follower;

                    switch (Utility.Random(5))
                    {
                    default:
                    case 0:
                        follower = new WaterElemental();
                        break;

                    case 1:
                        follower = new EarthElemental();
                        break;

                    case 2:
                        follower = new FireSteed();
                        break;

                    case 3:
                        follower = new FireElemental();
                        break;

                    case 4:
                        follower = new AirElemental();
                        break;
                    }

                    follower.Team = this.Team;

                    bool    validLocation = false;
                    Point3D loc           = this.Location;

                    for (int j = 0; !validLocation && j < 9; ++j)
                    {
                        int x = this.X + Utility.Random(3) - 1;
                        int y = this.Y + Utility.Random(3) - 1;
                        int z = map.GetAverageZ(x, y);

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

                    follower.MoveToWorld(loc, map);
                    follower.Combatant = target;
                }
            }
        }
			protected override void OnTick()
			{
				if ( m_Item.Deleted )
					return;

				Mobile spawn;

				switch ( Utility.Random( 10 ) )
				{
					default:
					case 0: spawn = new AirElemental(); break;
					case 1: spawn = new EarthElemental(); break;
					case 2: spawn = new WaterElemental(); break;
					case 3: spawn = new FireElemental(); break;
					case 4: spawn = new IceElemental(); break;
					case 5: spawn = new SnowElemental(); break;
					case 6: spawn = new Efreet(); break;
					case 7: spawn = new BloodElemental(); break;
					case 8: spawn = new PoisonElemental(); break;
				}

				spawn.MoveToWorld( m_Item.Location, m_Item.Map );

				m_Item.Delete();
			}
		private void DoSummon( Mobile combatant, string message )
		{
			Blessed = true;
        		this.Freeze(TimeSpan.FromSeconds(60.0));
			new InternalTimer( this ).Start();

			Map map = this.Map;

			if ( map == null )
				return;

			int newSpawned = 6;

      		for ( int i = 0; i < newSpawned; ++i )
      		{
               	BaseCreature spawn = new FireElemental();

				spawn.Team = this.Team;
                    		spawn.Map = map;
				bool validLocation = false;
				Point3D loc = this.Location;

				for ( int j = 0; !validLocation && j < 10; ++j )
				{
					int x = X + Utility.Random( 3 ) - 1;
					int y = Y + Utility.Random( 3 ) - 1;
					int z = map.GetAverageZ( x, y );

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

				spawn.MoveToWorld( loc, map );
			}
		}
Beispiel #10
0
        public bool SpawnPortal()
        {
            bool success = false;
            bool CanFit = false;
            Map map = Map.Felucca;
            int count = 0;

            if (PortalItem != null)
            {
                return true;
            }
            while (!CanFit)
            {
                int x = Utility.Random(0, 5072);
                int y = Utility.Random(0, 4072);
                int z = map.GetAverageZ(x, y);
                CanFit = map.CanSpawnMobile(new Point3D(x, y, z));
                Region region = Region.Find(new Point3D(x, y, z), map);

                if (CanFit && !(region is HouseRegion || region is GuardedRegion))
                {
                    PortalEntrance = new Point3D(x, y, z);
                    PortalItem = new PortalItem(DungeonEntrance, DungeonMap) {_PortalSerial = UID};
                    PortalItem.MoveToWorld(PortalEntrance, map);

                    PortalItem2 = new PortalItem(PortalEntrance, map);
                    PortalItem2.MoveToWorld(DungeonEntrance, DungeonMap);

                    Anim1 = new FireElemental
                    {
                        CantWalk = true,
                        Blessed = true,
                        Direction = Direction.Mask,
                        IgnoreMobiles = true,
                        Name = ""
                    };
                    Anim2 = new FireElemental
                    {
                        CantWalk = true,
                        Blessed = true,
                        Direction = Direction.Mask,
                        IgnoreMobiles = true,
                        Name = "a mysterious gate"
                    };

                    Anim1.MoveToWorld(PortalEntrance, map);
                    Anim2.MoveToWorld(PortalEntrance, map);
                    success = true;
                }
                else
                {
                    CanFit = false;
                }
                count++;
                if (count >= 10000)
                {
                    break;
                }
            }

            return success;
        }