Esempio n. 1
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            if (info.ButtonID <= 0)
            {
                return;                 // Canceled
            }
            BaseTrap       m_Trap   = null;
            TeiravonMobile m_Player = (TeiravonMobile)sender.Mobile;

            switch (info.ButtonID)
            {
            case 1:
                m_Trap = new SpikeTrap();

                break;

            case 2:
                m_Trap = new GiantSpikeTrap();

                break;

                /* case 3:
                 *
                 * case 4:
                 *      m_Trap = new GasTrap();
                 *
                 *      break;
                 *
                 * case 5:
                 *      m_Trap = new FlameSpurtTrap();
                 *
                 *      break;
                 */
            }

            if (m_Trap != null)
            {
                m_Trap.Trapper   = (int)m_Player.Serial;
                m_Trap.TrapSkill = m_Player.Skills.RemoveTrap.Base;

                m_Trap.MoveToWorld(m_Player.Location, m_Player.Map);
                m_Player.SendMessage("You place a trap...");
            }
        }
		public virtual void SpawnTraps( Field Handeling )
		{
			if ( Handeling.AllowTraps == false )
				return;
		
			int numberOfTraps = Handeling.NumberOfTraps;
			int kindOfTrap = 0;
			Item trap = null;
			
			int randomValueX = 0;
			int randomValueY = 0;
			int negative = 0;
			
			for ( int i = 0; i < numberOfTraps; i++ )
			{
				kindOfTrap = Utility.Random( 5 );
				
				randomValueX = Utility.Random( 20 );
				negative = Utility.Random( 2 );
				if ( negative > 0 )
					randomValueX *= -1;
					
				negative = Utility.Random( 2 );
				randomValueY = Utility.Random( 20 );
				if ( negative > 0 )
					randomValueY *= -1;
				
				switch ( kindOfTrap )
				{
					case 0:
						{
							trap = new FireColumnTrap();
							break;
						}
					case 1:
						{
							trap = new GasTrap();
							break;
						}
					case 2:
						{
							trap = new GiantSpikeTrap();
							break;
						}
					case 3:
						{
							trap = new SawTrap();
							break;
						}
					case 4:
						{
							trap = new SpikeTrap();
							break;
						}
				}
				trap.Movable = false;
				trap.Location = new Point3D((spawnpoint.X + randomValueX), (spawnpoint.Y + randomValueY), (spawnpoint.Z));
				trap.Map = spawnmap;
				Traps.Add(trap);
			}
		}