Server.Items.SOS.ValidateDeepWater C# (CSharp) Method

ValidateDeepWater() private static method

private static ValidateDeepWater ( Map map, int x, int y ) : bool
map Map
x int
y int
return bool
		private static bool ValidateDeepWater( Map map, int x, int y )
		{
			int tileID = map.Tiles.GetLandTile( x, y ).ID;
			bool water = false;

			for ( int i = 0; !water && i < m_WaterTiles.Length; i += 2 )
				water = ( tileID >= m_WaterTiles[i] && tileID <= m_WaterTiles[i + 1] );

			return water;
		}

Usage Example

Ejemplo n.º 1
0
 public void Net_OnTarget(Mobile from, object targeted)
 {
     if (targeted is Corpse corpse && (corpse.Owner == null || !corpse.Owner.Player))
     {
         if (SOS.ValidateDeepWater(corpse.Map, corpse.X, corpse.Y))
         {
             from.Animate(12, 5, 1, true, false, 0);
             Timer.DelayCall(TimeSpan.FromSeconds(0.5), new TimerStateCallback(MoveCorpse), new object[] { corpse, from });
         }
         else
         {
             from.SendLocalizedMessage(1010485); // You can only use this in deep water!
         }
     }
All Usage Examples Of Server.Items.SOS::ValidateDeepWater