示例#1
0
        public void EndInvasion()
        {
            Region.SendRegionMessage(1152530);             // Cora's forces have destroyed the Void Pool walls. The battle is lost!

            VoidPoolStats.OnInvasionEnd(this /*CurrentScore, Wave*/);

            NextStart = DateTime.UtcNow + TimeSpan.FromMinutes(RestartSpan);

            Region.SendRegionMessage(1152526, RestartSpan.ToString());             // The battle for the Void Pool will begin in ~1_VALUE~ minutes.

            List <Mobile> list = Region.GetPlayers();

            foreach (Mobile m in list.Where(m => GetCurrentPoints(m) > 0))
            {
                PointsSystem.VoidPool.AwardPoints(m, GetCurrentPoints(m));
            }

            foreach (Mobile m in list.Where(m => CurrentScore.ContainsKey(m)))
            {
                m.SendLocalizedMessage(1152650, String.Format("{0}\t{1}\t{2}\t{3}", GetTotalWaves(m), Wave.ToString(), Wave.ToString(), CurrentScore[m]));
                // During the battle, you helped fight back ~1_COUNT~ out of ~2_TOTAL~ waves of enemy forces. Your final wave was ~3_MAX~. Your total score for the battle was ~4_SCORE~ points.
            }

            list.Clear();
            list.TrimExcess();
            ClearSpawn(true);
        }
示例#2
0
        public void OnCreatureKilled(BaseCreature killed)
        {
            if (Waves == null)
            {
                return;
            }

            Waves.ForEach(info =>
            {
                if (info.Creatures.Contains(killed))
                {
                    List <DamageStore> list = killed.GetLootingRights();
                    list.Sort();

                    for (int i = 0; i < list.Count; i++)
                    {
                        DamageStore ds = list[i];
                        Mobile m       = ds.m_Mobile;

                        if (ds.m_Mobile is BaseCreature && ((BaseCreature)ds.m_Mobile).GetMaster() is PlayerMobile)
                        {
                            m = ((BaseCreature)ds.m_Mobile).GetMaster();
                        }

                        if (!info.Credit.Contains(m))
                        {
                            info.Credit.Add(m);
                        }

                        if (!CurrentScore.ContainsKey(m))
                        {
                            CurrentScore[m] = killed.Fame / 998;
                        }
                        else
                        {
                            CurrentScore[m] += killed.Fame / 998;
                        }
                    }

                    list.Clear();
                    list.TrimExcess();

                    info.Creatures.Remove(killed);

                    if (info.Creatures.Count == 0)
                    {
                        foreach (Mobile m in info.Credit.Where(m => m.Region == this.Region && m is PlayerMobile))
                        {
                            double award = Math.Max(0, this.Map == Map.Felucca ? Stage * 2 : Stage);

                            if (award > 0)
                            {
                                //Score Bonus
                                if (!CurrentScore.ContainsKey(m))
                                {
                                    CurrentScore[m] = Stage * 125;
                                }
                                else
                                {
                                    CurrentScore[m] += Stage * 125;
                                }
                            }
                        }
                    }

                    if (killed.Corpse != null && !killed.Corpse.Deleted)
                    {
                        ((Corpse)killed.Corpse).BeginDecay(TimeSpan.FromMinutes(1));
                    }
                }
            });
        }