Example #1
0
        private void AddMonster(Type type)
        {
            object monster = Activator.CreateInstance(type);

            if (monster != null && monster is Mobile)
            {
                Point3D location = FindSpawnLocation();

                if (location == Point3D.Zero)
                {
                    return;
                }

                Mobile from = (Mobile)monster;

                from.OnBeforeSpawn(location, SpawnMap);
                from.MoveToWorld(location, SpawnMap);
                from.OnAfterSpawn();

                if (from is BaseCreature)
                {
                    ((BaseCreature)from).Tamable = false;
                }

                _Spawned.Add(from);
            }
        }
Example #2
0
        public void SpawnChampion()
        {
            if ( m_Altar != null )
                m_Altar.Hue = 0x26;

            m_Kills = 0;
            Level = 0;
            InvalidateProperties();
            SetWhiteSkullCount( 0 );

            try
            {
                m_Champion = Activator.CreateInstance( ChampionSpawnInfo.GetInfo( m_Type ).Champion ) as Mobile;
            }
            catch { }

            if ( m_Champion != null )
            {
                var location = new Point3D( X, Y, Z - 15 );

                m_Champion.OnBeforeSpawn( location, Map );
                m_Champion.MoveToWorld( location, Map );
            }
        }
Example #3
0
		private void StartFight()
		{
			State = InstanceState.Fighting;

			m_Boss = Activator.CreateInstance( m_Owner.BossType ) as Mobile;
			m_Boss.OnBeforeSpawn( m_BossSpawnLocation, m_Owner.Map );
			m_Boss.MoveToWorld( m_BossSpawnLocation, m_Owner.Map );

			m_SliceTimer = new SliceTimer( this );
			m_SliceTimer.Start();

			m_KickTimer = Timer.DelayCall( TimeSpan.FromHours( 2.0 ), new TimerCallback( Kick ) );
		}