Exemplo n.º 1
0
        public void SpawnCreature(Mobile target)
        {
            Map map = this.Map;

            if (map == null)
            {
                return;
            }

            int monsters = 0;

            foreach (Mobile m in this.GetMobilesInRange(4))
            {
                if (m is Zombie)
                {
                    ++monsters;
                }
            }

            if (monsters < 6)
            {
                PlaySound(0x216);

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

                for (int i = 0; i < newmonsters; ++i)
                {
                    BaseCreature monster;

                    monster = new Zombie();

                    monster.Team = this.Team;

                    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);
                        }
                    }

                    monster.ControlSlots = 666;
                    monster.MoveToWorld(loc, map);
                    monster.Combatant = target;
                }
            }
        }
Exemplo n.º 2
0
        public void SpawnZombie(Mobile target)
        {
            Map map = this.Map;

            if (map == null)
            {
                return;
            }

            int newZombie = 1;

            for (int i = 0; i < newZombie; ++i)
            {
                Zombie Zombie = new Zombie();

                Zombie.Team      = this.Team;
                Zombie.FightMode = FightMode.Closest;

                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);
                    }
                }

                Zombie.MoveToWorld(loc, map);
                Zombie.Combatant = target;
            }
        }
Exemplo n.º 3
0
        public void SpawnMobiles(Mobile target)
        {
            Map map = this.Map;

            if (map == null)
            {
                return;
            }

            int red = 0;

            foreach (Mobile m in this.GetMobilesInRange(10))
            {
                if (m is Skeleton || m is Zombie)
                {
                    ++red;
                }
            }

            if (red < 5)
            {
                int newblue = Utility.RandomMinMax(1, 2);

                for (int i = 0; i < newblue; ++i)
                {
                    BaseCreature yellow;

                    switch (Utility.Random(2))
                    {
                    default:
                    case 0: yellow = new Skeleton(); break;

                    case 1: yellow = new Zombie(); break;
                    }

                    yellow.Team = this.Team;

                    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);
                        }
                    }

                    yellow.MoveToWorld(loc, map);
                    yellow.Combatant = target;
                    yellow.PlaySound(yellow.GetIdleSound());
                    yellow.FixedParticles(0x3728, 1, 10, 9910, EffectLayer.Head);
                }
            }
        }
Exemplo n.º 4
0
        public void SpawnSkeletons( Mobile target )
        {
            Map map = this.Map;

            if ( map == null )
                return;

            int newSkeletons = Utility.RandomMinMax( 2, 3 );

            for ( int i = 0; i < newSkeletons; ++i )
            {
                Skeleton skeleton = new Skeleton();

                skeleton.Team = this.Team;
                skeleton.FightMode = FightMode.Closest;

                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 );
                }

                skeleton.MoveToWorld( loc, map );
                skeleton.Combatant = target;
                skeleton.VanishTime = DateTime.Now + TimeSpan.FromHours( 1 );
                skeleton.VanishEmote = "*crumbles into dust*";
                this.PlaySound( 1109 );
            }

            int newZombies = Utility.RandomMinMax( 2, 3 );

            for ( int i = 0; i < newZombies; ++i )
            {
                Zombie zombie = new Zombie();

                zombie.Team = this.Team;
                zombie.FightMode = FightMode.Closest;

                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 );
                }

                zombie.MoveToWorld( loc, map );
                zombie.Combatant = target;
                this.PlaySound( 1109 );
            }

            this.Emote( "*freshly created undead burst forth from the sickening chasm of his mouth*" );
        }
Exemplo n.º 5
0
        public void SpawnCreature(Mobile target)
        {
            Map map = this.Map;

            if (map == null)
            {
                return;
            }

            int monsters = 0;

            foreach (Mobile m in this.GetMobilesInRange(4))
            {
                if (m is BoneKnight || m is BoneMagi || m is Ghoul || m is Mummy || m is Shade || m is SkeletalKnight || m is SkeletalMage || m is Skeleton || m is Spectre || m is Wraith || m is Phantom || m is Zombie)
                {
                    ++monsters;
                }
            }

            if (monsters < 6)
            {
                PlaySound(0x216);

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

                for (int i = 0; i < newmonsters; ++i)
                {
                    BaseCreature monster;

                    switch (Utility.Random(13))
                    {
                    default:
                    case 0: monster = new BoneKnight(); break;

                    case 1: monster = new BoneMagi(); break;

                    case 2: monster = new Ghoul(); break;

                    case 3: monster = new Ghostly(); break;

                    case 4: monster = new Mummy(); break;

                    case 5: monster = new Shade(); break;

                    case 6: monster = new SkeletalKnight(); break;

                    case 7: monster = new SkeletalMage(); break;

                    case 8: monster = new Skeleton(); break;

                    case 9: monster = new Spectre(); break;

                    case 10: monster = new Wraith(); break;

                    case 11: monster = new Phantom(); break;

                    case 12: monster = new Zombie(); break;
                    }

                    monster.Team = this.Team;

                    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);
                        }
                    }

                    monster.ControlSlots = 666;                     // DJERYV ADDED FOR MONSTER CLEANUP
                    monster.MoveToWorld(loc, map);
                    monster.Combatant = target;
                }
            }
        }
Exemplo n.º 6
0
            protected override void OnTick()
            {
                if ( m_Item.Deleted )
                    return;

                Mobile spawn;

                switch ( Utility.Random( 12 ) )
                {
                    default:
                    case 0: spawn = new Skeleton(); break;
                    case 1: spawn = new Zombie(); break;
                    case 2: spawn = new Wraith(); break;
                    case 3: spawn = new Spectre(); break;
                    case 4: spawn = new Spectre(); break;
                    case 5: spawn = new Mummy(); break;
                    case 6: spawn = new Zombie(); break;
                    case 7: spawn = new Zombie(); break;
                    case 8: spawn = new Zombie(); break;
                    case 9: spawn = new SkeletalSoldier(); break;
                    case 10: spawn = new Zombie(); break;
                    case 11: spawn = new Zombie(); break;
                }

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

                m_Item.Delete();
            }
Exemplo n.º 7
0
        private void SpawnMinions()
        {
            if (CountAliveMinions() != 0)
            {
                return;
            }

            m_Minions.Clear();

            Map map = this.Map;

            if (map == null)
            {
                return;
            }

            int type = Utility.Random(2);

            BaseMobileHelper.ShowMorphEffect(this);

            switch (type)
            {
            default:
            case 0:
                BodyMod = Utility.RandomList(50, 56);
                break;

            case 1:
                BodyMod = 3;
                break;
            }

            int minions = Utility.RandomMinMax(5, 8);

            for (int i = 0; i < minions; ++i)
            {
                BaseCreature minion;

                switch (type)
                {
                default:
                case 0:
                    minion = new Skeleton();
                    break;

                case 1:
                    minion = new Zombie();
                    break;
                }

                minion.Team = this.Team;

                bool validLocation = false;

                Point3D loc = this.Location;

                for (int j = 0; !validLocation && j < 5; ++j)
                {
                    int x = X + Utility.Random(8) - 4;
                    int y = Y + Utility.Random(8) - 4;
                    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);
                    }
                }

                minion.MoveToWorld(loc, map);
                minion.Combatant = Combatant;

                m_Minions.Add(minion);
            }

            m_NextReturnTime = DateTime.Now + TimeSpan.FromSeconds(m_ReturnTime);
        }
		public void SpawnZombie( Mobile target )
		{
			Map map = this.Map;

			if ( map == null )
				return;

			int newZombie = 1;

			for ( int i = 0; i < newZombie; ++i )
			{
				Zombie Zombie = new Zombie();

				Zombie.Team = this.Team;
				Zombie.FightMode = FightMode.Closest;

				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 );
				}

				Zombie.MoveToWorld( loc, map );
				Zombie.Combatant = target;
			}
		}
Exemplo n.º 9
0
        private void SpawnMinions()
        {
            if ( CountAliveMinions() != 0 )
                return;

            m_Minions.Clear();

            Map map = this.Map;

            if ( map == null )
                return;

            int type = Utility.Random( 2 );

            BaseMobileHelper.ShowMorphEffect( this );

            switch ( type )
            {
                default:
                case 0:
                    BodyMod = Utility.RandomList( 50, 56 );
                    break;
                case 1:
                    BodyMod = 3;
                    break;
            }

            int minions = Utility.RandomMinMax( 5, 8 );

            for ( int i = 0; i < minions; ++i )
            {
                BaseCreature minion;

                switch ( type )
                {
                    default:
                    case 0:
                        minion = new Skeleton();
                        break;
                    case 1:
                        minion = new Zombie();
                        break;
                }

                minion.Team = this.Team;

                bool validLocation = false;

                Point3D loc = this.Location;

                for ( int j = 0; !validLocation && j < 5; ++j )
                {
                    int x = X + Utility.Random( 8 ) - 4;
                    int y = Y + Utility.Random( 8 ) - 4;
                    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 );
                }

                minion.MoveToWorld( loc, map );
                minion.Combatant = Combatant;

                m_Minions.Add( minion );
            }

            m_NextReturnTime = DateTime.Now + TimeSpan.FromSeconds( m_ReturnTime );
        }
Exemplo n.º 10
0
			protected override void OnTick()
			{
                /*** ADDED ***/
                // Alambik's Undead system
                if (m_Corpse.Amount == 3 && m_Corpse.Killer != null && m_Corpse.Killer.Player) // Protocol for corpse is Amount = owner's body value
                {
                	// Scriptiz : on ajoute deux conditions sur le Killer pour éviter que des gardes
                	// ne kills à longueur de journée des zombies
                    Mobile zombie = new Zombie(true); // Create zombie with no packed items
                    zombie.MoveToWorld(m_Corpse.Location, m_Corpse.Map);
                    zombie.Emote("*se redresse*");
                    m_Corpse.Delete();
                }
                else
	                /*** END ***/
					if ( !m_Corpse.GetFlag( CorpseFlag.NoBones ) )
						m_Corpse.TurnToBones();
					else
						m_Corpse.Delete();
			}