Exemplo n.º 1
0
		public UOF_CTFTeam(PvPBattle battle, string name = "Team", int minCapacity = 0, int maxCapacity = 1, int color = 12)
			: base(battle, name, minCapacity, maxCapacity, color)
		{
			Caps = 0;
			FlagRespawnDelay = TimeSpan.FromSeconds(10.0);
			RespawnOnDeath = true;
		}
Exemplo n.º 2
0
 private static void OnBattleWorldBroadcast(PvPBattle b, string text)
 {
     if (CMOptions.HandleBattles)
     {
         SendMessage(text);
     }
 }
Exemplo n.º 3
0
        protected virtual int GetProgress(ConquestState state, PlayerMobile victim)
        {
            if (victim == null)
            {
                return(0);
            }

            if (state.User == null)
            {
                return(0);
            }

            PvPBattle battle = AutoPvP.FindBattle(state.User);

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

                return(0);
            }

            return(1);
        }
Exemplo n.º 4
0
        private static bool AllowGain(Mobile from /*, Skill skill, object obj*/)
        {
            var       pm     = from as PlayerMobile;
            PvPBattle battle = AutoPvP.FindBattle(pm);

            if (Faction.InSkillLoss(from)) //Changed some time between the introduction of AoS and SE.
            {
                return(false);
            }

            if (pm != null && pm.InStat)
            {
                return(false);
            }

            if (pm != null && battle != null && battle.IsParticipant(pm))
            {
                return(false);
            }

            if (from is PlayerMobile && PvPTemplates.PvPTemplates.FetchProfile(from as PlayerMobile).Active)
            {
                return(false);
            }

            /*if (AntiMacroCode && from is PlayerMobile && UseAntiMacro[skill.Info.SkillID])
             *          {
             *                  return ((PlayerMobile)from).AntiMacroCheck(skill, obj);
             *          }*/

            return(true);
        }
Exemplo n.º 5
0
 public CTFTeam(PvPBattle battle, string name = "Team", int minCapacity = 0, int maxCapacity = 1, int color = 12)
     : base(battle, name, minCapacity, maxCapacity, color)
 {
     Caps             = 0;
     FlagRespawnDelay = TimeSpan.FromSeconds(10.0);
     RespawnOnDeath   = true;
 }
Exemplo n.º 6
0
		/*
		protected override void EnsureConstructDefaults()
		{
			base.EnsureConstructDefaults();
		}
		*/

		public BoWTeam(PvPBattle battle, string name = "Team", int minCapacity = 0, int maxCapacity = 7, int color = 12)
			: base(battle, name, minCapacity, maxCapacity, color)
		{
			Points = 0;
			Multi = 1;
			RespawnOnDeath = true;
			KickOnDeath = false;
		}
Exemplo n.º 7
0
        /*
         * protected override void EnsureConstructDefaults()
         * {
         *      base.EnsureConstructDefaults();
         * }
         */

        public BoWTeam(PvPBattle battle, string name = "Team", int minCapacity = 0, int maxCapacity = 7, int color = 12)
            : base(battle, name, minCapacity, maxCapacity, color)
        {
            Points         = 0;
            Multi          = 1;
            RespawnOnDeath = true;
            KickOnDeath    = false;
        }
Exemplo n.º 8
0
        public override double ComputeScore(PvPBattle b, PlayerMobile p, ref double min, ref double max, ref double total)
        {
            var score = base.ComputeScore(b, p, ref min, ref max, ref total);

            if (b == null || b.Deleted)
            {
                return(score);
            }

            if (p == null || p.Deleted)
            {
                return(score);
            }

            double val;

            if (FlagsCaptured > 0)
            {
                score += val = Math.Min(1.0, b.GetStatistic(p, o => o["Flags Captured"]) / (double)FlagsCaptured);

                min = Math.Min(min, val);
                max = Math.Max(max, val);

                ++total;
            }

            if (FlagsDropped > 0)
            {
                score += val = Math.Min(1.0, b.GetStatistic(p, o => o["Flags Dropped"]) / (double)FlagsDropped);

                min = Math.Min(min, val);
                max = Math.Max(max, val);

                ++total;
            }

            if (FlagsStolen > 0)
            {
                score += val = Math.Min(1.0, b.GetStatistic(p, o => o["Flags Stolen"]) / (double)FlagsStolen);

                min = Math.Min(min, val);
                max = Math.Max(max, val);

                ++total;
            }

            if (FlagsReturned > 0)
            {
                score += val = Math.Min(1.0, b.GetStatistic(p, o => o["Flags Returned"]) / (double)FlagsReturned);

                min = Math.Min(min, val);
                max = Math.Max(max, val);

                ++total;
            }

            return(score);
        }
Exemplo n.º 9
0
 public TournamentTeam(
     PvPBattle battle,
     string name     = "Incognito",
     int minCapacity = 10,
     int maxCapacity = 50,
     int color       = 12)
     : base(battle, name, minCapacity, maxCapacity, color)
 {
     RespawnOnStart = false;
     RespawnOnDeath = false;
     KickOnDeath    = true;
 }
Exemplo n.º 10
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Battles"/>
        /// </summary>
        internal Battles()
        {
            this.WaitingsPlayers = new Dictionary <long, Player>();

            this.Processor = new Thread(() =>
            {
                while (true)
                {
                    Thread.Sleep(1000);

                    lock (this.GateRemove)
                    {
                        Player[] Waitings      = this.WaitingsPlayers.Values.ToArray();
                        List <Player> Offlines = Core.Resources.Players.GetRandom(Waitings.Length);

                        foreach (Player Player in Waitings)
                        {
                            if (Offlines.Count > 0)
                            {
                                if (Player.Device?.Connected ?? false)
                                {
                                    if (!Offlines[0].Device?.Connected ?? true)
                                    {
                                        PvPBattle Battle = new PvPBattle(Offlines[0].Objects, Player, Offlines[0]);

                                        Player.Battle      = Battle;
                                        Offlines[0].Battle = Battle;

                                        Player.Device.State = State.IN_BATTLE;

                                        new EnemyHomeData(Player.Device, Offlines[0]).Send();
                                    }
                                }
                                else
                                {
                                    this.WaitingsPlayers.Remove(Player.PlayerID);
                                }
                            }
                            else
                            {
                                break;
                            }
                        }
                    }
                }
            });


            this.Processor.Start();
        }
Exemplo n.º 11
0
        public override string GetStatus(PvPBattle b, PlayerMobile p)
        {
            var status = base.GetStatus(b, p);

            if (b == null || b.Deleted)
            {
                return(status);
            }

            if (p == null || p.Deleted)
            {
                return(status);
            }

            var lines = new StringBuilder(status);

            if (FlagsCaptured > 0)
            {
                lines.AppendLine("Flags Captured: {0:#,0} / {1:#,0}", b.GetStatistic(p, o => o["Flags Captured"]), FlagsCaptured);
            }

            if (FlagsDropped > 0)
            {
                lines.AppendLine("Flags Dropped: {0:#,0} / {1:#,0}", b.GetStatistic(p, o => o["Flags Dropped"]), FlagsDropped);
            }

            if (FlagsStolen > 0)
            {
                lines.AppendLine("Flags Stolen: {0:#,0} / {1:#,0}", b.GetStatistic(p, o => o["Flags Stolen"]), FlagsStolen);
            }

            if (FlagsReturned > 0)
            {
                lines.AppendLine("Flags Returned: {0:#,0} / {1:#,0}", b.GetStatistic(p, o => o["Flags Returned"]), FlagsReturned);
            }

            return(lines.ToString());
        }
Exemplo n.º 12
0
 public CTFTeam(PvPBattle battle, GenericReader reader)
     : base(battle, reader)
 {
 }
Exemplo n.º 13
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);
        }
Exemplo n.º 14
0
 public TournamentTeam(PvPBattle battle, GenericReader reader)
     : base(battle, reader)
 {
 }
Exemplo n.º 15
0
		public UOF_PvPTeam(PvPBattle battle, string name = "Incognito", int minCapacity = 1, int maxCapacity = 1, int color = 12)
			: base(battle, name, minCapacity, maxCapacity, color)
		{ }
Exemplo n.º 16
0
		public UOF_PvPTeam(PvPBattle battle, GenericReader reader)
			: base(battle, reader)
		{ }
Exemplo n.º 17
0
		public CTFTeam(PvPBattle battle, GenericReader reader)
			: base(battle, reader)
		{ }
Exemplo n.º 18
0
 public UOF_PvPTeam(PvPBattle battle, string name = "Incognito", int minCapacity = 1, int maxCapacity = 1, int color = 12)
     : base(battle, name, minCapacity, maxCapacity, color)
 {
 }
Exemplo n.º 19
0
 public UOF_PvPTeam(PvPBattle battle, GenericReader reader)
     : base(battle, reader)
 {
 }