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; }
private static void OnBattleWorldBroadcast(PvPBattle b, string text) { if (CMOptions.HandleBattles) { SendMessage(text); } }
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); }
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); }
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; }
/* 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; }
/* * 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; }
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); }
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; }
/// <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(); }
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()); }
public CTFTeam(PvPBattle battle, GenericReader reader) : base(battle, reader) { }
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); }
public TournamentTeam(PvPBattle battle, GenericReader reader) : base(battle, reader) { }
public UOF_PvPTeam(PvPBattle battle, string name = "Incognito", int minCapacity = 1, int maxCapacity = 1, int color = 12) : base(battle, name, minCapacity, maxCapacity, color) { }
public UOF_PvPTeam(PvPBattle battle, GenericReader reader) : base(battle, reader) { }
public CTFTeam(PvPBattle battle, GenericReader reader) : base(battle, reader) { }
public UOF_PvPTeam(PvPBattle battle, string name = "Incognito", int minCapacity = 1, int maxCapacity = 1, int color = 12) : base(battle, name, minCapacity, maxCapacity, color) { }
public UOF_PvPTeam(PvPBattle battle, GenericReader reader) : base(battle, reader) { }