/**********************************************************
RunUO 2.0 AoV C# script file
Official Age of Valor Script :: www.uovalor.com
Last modified by 
Filepath: scripts\_custom\engines\Event System\events\pvptourney\MatchRegion.cs
Lines of code: 68
***********************************************************/


using Server;
using System;
using Server.Regions;
using Server.Mobiles;


namespace Server.EventSystem
{
	public class PvPMatchRegion : BaseRegion
	{
		PvPMatch match;
		
		
		public PvPMatchRegion(PvPMatch pmatch) : base( null, pmatch.Arena.Map, 80, pmatch.Arena.Area )
		{
			match=pmatch;			
		}
		
		public override bool AllowHousing( Mobile from, Point3D p )
		{
			return false;
		}
		
		public override bool AllowHarmful( Mobile from, Mobile target )
		{
			return (from.Team!=target.Team && from.Team!=0 && from.Team!=0);
		}
		
		public override bool AllowBeneficial( Mobile from, Mobile target )
		{
			return from.Team==target.Team && from.Team!=0;	
		}
		
		
		
		
		public override bool OnSkillUse( Mobile m, int Skill )
		{
			return match.RegionOnSkillUse( m, Skill );
		}
		
		public override bool OnBeginSpellCast( Mobile m, ISpell s )
		{
			return match.RegionOnBeginSpellCast( m, s );
		}
				
		public override bool OnMount( Mobile m)
		{
			if(match.Controller==null)return true;
			
			return match.Controller.AllowMount;
		}		
		
		public override bool OnResurrect( Mobile m )
		{
			return false;
		}		
		
		public override bool OnBeforeDeath( Mobile m )
		{
			return match.RegionOnBeforeDeath( m );
		}		
		
		public override bool OnDamage( Mobile m, ref int Damage )
		{
			return match.RegionOnDamage( m, ref Damage );
		}		
		
		public override bool OnHeal( Mobile m, ref int Heal )
		{
			return match.RegionOnHeal( m, ref  Heal );
		}		
		
		public override bool OnDoubleClick( Mobile m, object o )
		{
			return match.RegionOnDoubleClick( m, o );
		}		
		
		public override bool AllowTravel()
		{
			return false;
		}		
		
		public override TimeSpan GetLogoutDelay( Mobile m )
		{
			return TimeSpan.FromDays(1); 
		}		
		
		
		
		
		
		
	
	
	}
}