protected override int GetProgress(ConquestState state, PlayerConquestContainer args)
		{
            if (state.User == null)
                return 0;

            if (args == null || args.Mobile == null || args.Killer is PlayerMobile && args.Killer.Account != state.User.Account || !(args.Mobile is PlayerMobile) || !(args.Killer is PlayerMobile))
			{
				return 0;
			}

		    var killer = args.Killer as PlayerMobile;
		    var victim = args.Killer as PlayerMobile;

            Faction killerFaction = Faction.Find(killer, true);
            Faction victimFaction = Faction.Find(victim, true);

            if (killerFaction == null || victimFaction == null || killerFaction == victimFaction || AutoPvP.IsParticipant(victim))
            {
                return 0;
            }

            Player ethickiller = Player.Find(killer);
            Player ethicvictim = Player.Find(victim);

		    if (IsEthic && (ethickiller == null || ethicvictim == null || ethickiller.Ethic == ethicvictim.Ethic))
		    {
		        return 0;
		    }

		    return base.GetProgress(state, args);
		}
Пример #2
0
        protected override int GetProgress(ConquestState state, PlayerConquestContainer args)
        {
            if (state.User == null)
            {
                return(0);
            }

            if (args == null || args.Mobile == null || args.Killer is PlayerMobile && args.Killer.Account != state.User.Account || !(args.Mobile is PlayerMobile) || !(args.Killer is PlayerMobile))
            {
                return(0);
            }

            var killer = args.Killer as PlayerMobile;
            var victim = args.Killer as PlayerMobile;

            Faction killerFaction = Faction.Find(killer, true);
            Faction victimFaction = Faction.Find(victim, true);

            if (killerFaction == null || victimFaction == null || killerFaction == victimFaction || AutoPvP.IsParticipant(victim))
            {
                return(0);
            }

            Player ethickiller = Player.Find(killer);
            Player ethicvictim = Player.Find(victim);

            if (IsEthic && (ethickiller == null || ethicvictim == null || ethickiller.Ethic == ethicvictim.Ethic))
            {
                return(0);
            }

            return(base.GetProgress(state, args));
        }
Пример #3
0
        public static void HandlePlayerDeath(PlayerConquestContainer e)
        {
            if (e == null || e.Mobile == null || !(e.Mobile is PlayerMobile))
            {
                return;
            }

            var player = (PlayerMobile)e.Mobile;

            CheckProgress <PlayerDeathConquest>(player, e);

            List <PlayerMobile> team =
                player.DamageEntries.Not(de => de.DamageGiven <= 0 || de.HasExpired)
                .Select(de => de.Damager)
                .OfType <PlayerMobile>()
                .ToList();

            var killer = e.Killer as PlayerMobile;

            if (killer == null && e.Killer is BaseCreature)
            {
                killer = ((BaseCreature)e.Killer).GetMaster <PlayerMobile>();
            }

            if (killer == null)
            {
                killer = player.GetLastKiller <PlayerMobile>();
            }

            if (killer != null && !team.Contains(killer))
            {
                team.Add(killer);
            }

            team.ForEach(k => CheckProgress <PlayerKillConquest>(k, new PlayerConquestContainer(player, k, e.Corpse)));
        }
Пример #4
0
        public static void HandlePlayerDeath(PlayerConquestContainer e)
        {
            if (e == null || e.Mobile == null || !(e.Mobile is PlayerMobile))
            {
                return;
            }

            var player = (PlayerMobile) e.Mobile;

            CheckProgress<PlayerDeathConquest>(player, e);

            List<PlayerMobile> team =
                player.DamageEntries.Not(de => de.DamageGiven <= 0 || de.HasExpired)
                    .Select(de => de.Damager)
                    .OfType<PlayerMobile>()
                    .ToList();

            var killer = e.Killer as PlayerMobile;

            if (killer == null && e.Killer is BaseCreature)
            {
                killer = ((BaseCreature) e.Killer).GetMaster<PlayerMobile>();
            }

            if (killer == null)
            {
                killer = player.GetLastKiller<PlayerMobile>();
            }

            if (killer != null && !team.Contains(killer))
            {
                team.Add(killer);
            }

            team.ForEach(k => CheckProgress<PlayerKillConquest>(k, new PlayerConquestContainer(player, k, e.Corpse)));
        }
Пример #5
0
        protected virtual int GetProgress(ConquestState state, PlayerConquestContainer args)
        {
            if (state.User == null)
            {
                return(0);
            }

            if (args == null || args.Mobile == null || args.Killer is PlayerMobile && args.Killer.Account != state.User.Account)
            {
                return(0);
            }

            if (IsDuel && args.Mobile is PlayerMobile && args.Killer is PlayerMobile && ((PlayerMobile)args.Killer).DuelContext == null)
            {
                return(0);
            }

            if (IsDungeon && !args.Mobile.InRegion <DungeonRegion>())
            {
                return(0);
            }

            PvPBattle battle = AutoPvP.FindBattle(args.Killer as PlayerMobile);

            if (Battle.IsNotNull && !battle.TypeEquals(Battle, BattleChildren))
            {
                if (ChangeBattleReset)
                {
                    return(-state.Progress);
                }

                return(0);
            }

            if (AccessPlayer > args.Mobile.AccessLevel)
            {
                return(0);
            }

            if (AccessKiller > args.Killer.AccessLevel)
            {
                return(0);
            }

            if (NotoCompare != NotorietyType.None && NotoCompare != args.Killer.ComputeNotoriety(args.Mobile))
            {
                return(0);
            }

            if (NotoPlayer != NotorietyType.None && NotoPlayer != args.Mobile.ComputeNotoriety())
            {
                return(0);
            }

            if (NotoKiller != NotorietyType.None && NotoKiller != args.Killer.ComputeNotoriety())
            {
                return(0);
            }

            if (Map != null && Map != Map.Internal && (args.Mobile.Map == null || args.Mobile.Map != Map))
            {
                return(0);
            }

            if (!String.IsNullOrWhiteSpace(RegionName) && (args.Mobile.Region == null || !args.Mobile.Region.IsPartOf(RegionName)))
            {
                return(0);
            }

            return(1);
        }
Пример #6
0
        protected virtual int GetProgress(ConquestState state, PlayerConquestContainer args)
		{
            if (state.User == null)
                return 0;

            if (args == null || args.Mobile == null || args.Killer is PlayerMobile && args.Killer.Account != state.User.Account)
			{
				return 0;
			}

            if (IsDuel && args.Mobile is PlayerMobile && args.Killer is PlayerMobile && ((PlayerMobile)args.Killer).DuelContext == null)
		    {
		        return 0;
		    }

            if (IsDungeon && !args.Mobile.InRegion<DungeonRegion>())
            {
                return 0;
            }

            PvPBattle battle = AutoPvP.FindBattle(args.Killer as PlayerMobile);

            if (Battle.IsNotNull && !battle.TypeEquals(Battle, BattleChildren))
            {
                if (ChangeBattleReset)
                {
                    return -state.Progress;
                }

                return 0;
            }

			if (AccessPlayer > args.Mobile.AccessLevel)
			{
				return 0;
			}

			if (AccessKiller > args.Killer.AccessLevel)
			{
				return 0;
			}

			if (NotoCompare != NotorietyType.None && NotoCompare != args.Killer.ComputeNotoriety(args.Mobile))
			{
				return 0;
			}

			if (NotoPlayer != NotorietyType.None && NotoPlayer != args.Mobile.ComputeNotoriety())
			{
				return 0;
			}

			if (NotoKiller != NotorietyType.None && NotoKiller != args.Killer.ComputeNotoriety())
			{
				return 0;
			}

            if (Map != null && Map != Map.Internal && (args.Mobile.Map == null || args.Mobile.Map != Map))
            {
                return 0;
            }

            if (!String.IsNullOrWhiteSpace(RegionName) && (args.Mobile.Region == null || !args.Mobile.Region.IsPartOf(RegionName)))
            {
                return 0;
            }

			return 1;
		}