public UnlockTarget(GuardKey key)
     : base(3, false, TargetFlags.None)
 {
     m_Key = key;
     CheckLOS = false;
 }
		public void Spawn( int index )
		{
			Map map = Map;

			if ( map == null || map == Map.Internal || m_CreaturesName.Count == 0 || index >= m_CreaturesName.Count )
				return;

			Defrag();

			if ( m_Creatures.Count >= m_Count )
				return;

			Type type = SpawnerType.GetType( (string)m_CreaturesName[index] );

			if ( type != null )
			{
				try
				{
					object o = Activator.CreateInstance( type );

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

						m_Creatures.Add( m );
						InvalidateProperties();

						m.Map = map;

						m.Location = GetSpawnPosition();

						GuardKey key = new GuardKey( key_KeyVal, key_Description, key_Max, key_Delay );
						// m.AddToBackpack( key );
						
						if ( m is BaseCreature )
						{
							BaseCreature c = (BaseCreature)m;

							c.PackItem( key );

							c.RangeHome = m_WalkingRange;

							c.CurrentWayPoint = m_WayPoint;

							if ( m_Team > 0 )
								c.Team = m_Team;

							c.Home = this.Location;
						}


					}
				}
				catch
				{
				}
			}
		}
Example #3
0
 public UnlockTarget(GuardKey key)
     : base(3, false, TargetFlags.None)
 {
     m_Key    = key;
     CheckLOS = false;
 }