public void CheckOccupation() { if (!OnGoing) { return; } if (Participants.Count == 1) { Guild g = Participants[0]; if (!GuildStats.ContainsKey(g)) { GuildStats[g] = new VvVGuildBattleStats(g); } GuildStats[g].Points += OccupyPoints; UpdateAllGumps(); CheckScore(); if (OnGoing && NextAnnouncement < DateTime.UtcNow) { System.SendVvVMessage(1154957, g.Name); // ~1_NAME~ is occupying the city! NextAnnouncement = DateTime.UtcNow + TimeSpan.FromMinutes(Announcement); } } else // Is this a bug? Verified on EA this is how it behaves { if (NextAnnouncement < DateTime.UtcNow) { System.SendVvVMessage(1154958); // The City is unoccupied! Slay opposing forces to claim the city for your guild! NextAnnouncement = DateTime.UtcNow + TimeSpan.FromMinutes(Announcement); } } }
public void OnBattleEnd() { foreach (KeyValuePair <Guild, VvVGuildBattleStats> kvp in Battle.GuildStats) { Guild g = kvp.Key; if (!GuildStats.ContainsKey(g)) { GuildStats[g] = new VvVGuildStats(g); } int score = (int)kvp.Value.Points; GuildStats[g].Kills += kvp.Value.Kills; GuildStats[g].ReturnedSigils += kvp.Value.ReturnedSigils; GuildStats[g].Score += score; List <Mobile> list = g.Members.Where(mob => mob.NetState != null && mob.Region.IsPartOf(Battle.Region)).ToList(); foreach (Mobile m in list) { VvVPlayerEntry entry = GetPlayerEntry <VvVPlayerEntry>(m, true); if (entry != null) { entry.Score += score; } } } }
public VvVGuildBattleStats GetGuildStats(Guild g) { if (g == null) { return(null); } if (!GuildStats.ContainsKey(g)) { GuildStats[g] = new VvVGuildBattleStats(g); } return(GuildStats[g]); }
/// <summary> /// Gets real time leader of battle, out parameter of their score /// </summary> /// <param name="score"></param> /// <returns></returns> public Guild GetLeader(out int score) { Guild leader = null; score = 0; foreach (Guild g in Participants) { if (!GuildStats.ContainsKey(g)) { GuildStats[g] = new VvVGuildBattleStats(g); } if (leader == null || GuildStats[g].Points > score) { leader = g; score = (int)GuildStats[g].Points; } } return(leader); }