Ejemplo n.º 1
0
        public virtual void AwardRankTrophy(PlayerMobile pm, int rank)
        {
            switch (rank)
            {
            case 0:
            {
                pm.SendMessage(54, "You took first place in the {0}.", Name);
                pm.PublicOverheadMessage(MessageType.Label, 54, true, "FIRST PLACE!");

                BankBox bank = pm.FindBank(Map.Expansion);

                if (bank != null)
                {
                    bank.DropItem(
                        new BattlesTrophy(Name + " - First Place", TrophyType.First)
                        {
                            Owner = pm
                        });

                    pm.SendMessage(54, "A trophy has been placed in your bankbox.");
                }
            }
            break;

            case 1:
            {
                pm.SendMessage(54, "You took second place in the {0}.", Name);
                pm.PublicOverheadMessage(MessageType.Label, 54, true, "SECOND PLACE!");

                BankBox bank = pm.FindBank(Map.Expansion);

                if (bank != null)
                {
                    bank.DropItem(
                        new BattlesTrophy(Name + " - Second Place", TrophyType.Second)
                        {
                            Owner = pm
                        });

                    pm.SendMessage(54, "A trophy has been placed in your bankbox.");
                }
            }
            break;

            case 2:
            {
                pm.SendMessage(54, "You took third place in the {0}.", Name);
                pm.PublicOverheadMessage(MessageType.Label, 54, true, "THIRD PLACE!");

                BankBox bank = pm.FindBank(Map.Expansion);

                if (bank != null)
                {
                    bank.DropItem(
                        new BattlesTrophy(Name + " - Third Place", TrophyType.Third)
                        {
                            Owner = pm
                        });

                    pm.SendMessage(54, "A trophy has been placed in your bankbox.");
                }
            }
            break;
            }
        }
Ejemplo n.º 2
0
        public virtual void AwardTrophies()
        {
            PlayerMobile topkiller = null;
            long         topkills  = 0;

            PlayerMobile topdamager = null;
            long         topdamage  = 0;

            PlayerMobile tophealer = null;
            long         topheals  = 0;

            foreach (KeyValuePair <PlayerMobile, PvPProfileHistoryEntry> kv in StatisticsCache)
            {
                if (kv.Value.Kills > topkills)
                {
                    topkills  = kv.Value.Kills;
                    topkiller = kv.Key;
                }

                if (kv.Value.DamageDone > topdamage)
                {
                    topdamage  = kv.Value.DamageDone;
                    topdamager = kv.Key;
                }

                if (kv.Value.HealingDone > topheals)
                {
                    topheals  = kv.Value.HealingDone;
                    tophealer = kv.Key;
                }
            }

            if (topkiller != null)
            {
                topkiller.SendMessage(54, "You had the top kills in the {0}.", Name);
                topkiller.PublicOverheadMessage(MessageType.Label, 54, true, topkiller.Name + ": Top Kills!");

                BankBox bank = topkiller.FindBank(Map.Expansion);

                if (bank != null)
                {
                    bank.DropItem(
                        new BattlesTrophy(Name + " - Top Kills: " + topkills, TrophyType.Kills)
                    {
                        Owner = topkiller
                    });

                    topkiller.SendMessage(54, "A trophy has been placed in your bankbox.");
                }
            }

            if (topdamager != null)
            {
                topdamager.SendMessage(54, "You had the top damage done in the {0}.", Name);
                topdamager.PublicOverheadMessage(MessageType.Label, 54, true, topdamager.Name + ": Top Damage!");

                BankBox bank = topdamager.FindBank(Map.Expansion);

                if (bank != null)
                {
                    bank.DropItem(
                        new BattlesTrophy(Name + " - Top Damage: " + topdamage, TrophyType.Damage)
                    {
                        Owner = topdamager
                    });

                    topdamager.SendMessage(54, "A trophy has been placed in your bankbox.");
                }
            }

            if (tophealer != null)
            {
                tophealer.SendMessage(54, "You had the top healing done in the {0}.", Name);
                tophealer.PublicOverheadMessage(MessageType.Label, 54, true, tophealer.Name + ": Top Healing!");

                BankBox bank = tophealer.FindBank(Map.Expansion);

                if (bank != null)
                {
                    bank.DropItem(
                        new BattlesTrophy(Name + " - Top Heals: " + topheals, TrophyType.Healing)
                    {
                        Owner = tophealer
                    });

                    tophealer.SendMessage(54, "A trophy has been placed in your bankbox.");
                }
            }
        }
Ejemplo n.º 3
0
        public override void AwardTrophies()
        {
            base.AwardTrophies();

            PlayerMobile topwaller = null;
            long         topwalls  = 0;

            PlayerMobile topdefender = null;
            long         topdefends  = 0;

            PlayerMobile topassaulter = null;
            long         topassaults  = 0;

            PlayerMobile topcapper = null;
            long         topcaps   = 0;

            foreach (KeyValuePair <PlayerMobile, PvPProfileHistoryEntry> kv in StatisticsCache)
            {
                if (kv.Value["Walls Cast"] > topwalls)
                {
                    topwalls  = kv.Value["Walls Cast"];
                    topwaller = kv.Key;
                }

                if (kv.Value["Flags Returned"] > topdefends)
                {
                    topdefends  = kv.Value["Flags Returned"];
                    topdefender = kv.Key;
                }

                if (kv.Value["Flags Stolen"] > topassaults)
                {
                    topassaults  = kv.Value["Flags Stolen"];
                    topassaulter = kv.Key;
                }

                if (kv.Value["Flags Captured"] > topcaps)
                {
                    topcaps   = kv.Value["Flags Captured"];
                    topcapper = kv.Key;
                }
            }

            if (topwaller != null)
            {
                topwaller.SendMessage(54, "You had the top walls cast in the {0}.", Name);
                topwaller.PublicOverheadMessage(MessageType.Label, 54, true, topwaller.Name + ": Top Walls Cast!");

                var bank = topwaller.FindBank(Map.Expansion);

                if (bank != null)
                {
                    bank.DropItem(
                        new BattlesTrophy(Name + " - Top Walls Cast: " + topwalls, TrophyType.Walls)
                    {
                        Owner = topwaller
                    });

                    topwaller.SendMessage(54, "A trophy has been placed in your bankbox.");
                }
            }

            if (topdefender != null)
            {
                topdefender.SendMessage(54, "You had the top flags defended in the {0}.", Name);
                topdefender.PublicOverheadMessage(MessageType.Label, 54, true, topdefender.Name + ": Top Flags Defended!");

                var bank = topdefender.FindBank(Map.Expansion);

                if (bank != null)
                {
                    bank.DropItem(
                        new BattlesTrophy(Name + " - Top Flags Defended: " + topdefends, TrophyType.FlagDefends)
                    {
                        Owner = topdefender
                    });

                    topdefender.SendMessage(54, "A trophy has been placed in your bankbox.");
                }
            }

            if (topassaulter != null)
            {
                topassaulter.SendMessage(54, "You had the top flags assaulted in the {0}.", Name);
                topassaulter.PublicOverheadMessage(MessageType.Label, 54, true, topassaulter.Name + ": Top Flag Assaults!");

                var bank = topassaulter.FindBank(Map.Expansion);

                if (bank != null)
                {
                    bank.DropItem(
                        new BattlesTrophy(Name + " - Top Flags Assaulted: " + topassaults, TrophyType.FlagAssaults)
                    {
                        Owner = topassaulter
                    });

                    topassaulter.SendMessage(54, "A trophy has been placed in your bankbox.");
                }
            }

            if (topcapper != null)
            {
                topcapper.SendMessage(54, "You had the top flags captured in the {0}.", Name);
                topcapper.PublicOverheadMessage(MessageType.Label, 54, true, topcapper.Name + ": Top Flag Captures!");

                var bank = topcapper.FindBank(Map.Expansion);

                if (bank != null)
                {
                    bank.DropItem(
                        new BattlesTrophy(Name + " - Top Flags Captured: " + topcaps, TrophyType.FlagCaps)
                    {
                        Owner = topcapper
                    });

                    topcapper.SendMessage(54, "A trophy has been placed in your bankbox.");
                }
            }
        }
Ejemplo n.º 4
0
        public override void AwardTrophies()
        {
            base.AwardTrophies();

            PlayerMobile topwaller = null;
            long         topwalls  = 0;

            PlayerMobile topassaulter = null;
            long         topassaults  = 0;

            PlayerMobile topholder = null;
            long         topheld   = 0;

            PlayerMobile carrierkiller   = null;
            long         topcarrierkills = 0;

            foreach (KeyValuePair <PlayerMobile, PvPProfileHistoryEntry> kv in StatisticsCache)
            {
                if (kv.Value["Walls Cast"] > topwalls)
                {
                    topwalls  = kv.Value["Walls Cast"];
                    topwaller = kv.Key;
                }

                if (kv.Value["Crystal Points"] > topheld)
                {
                    topheld   = kv.Value["Crystal Points"];
                    topholder = kv.Key;
                }

                if (kv.Value["Crystal Steals"] > topassaults)
                {
                    topassaults  = kv.Value["Crystal Steals"];
                    topassaulter = kv.Key;
                }

                if (kv.Value["Crystal Carrier Kills"] > topcarrierkills)
                {
                    topcarrierkills = kv.Value["Crystal Carrier Kills"];
                    carrierkiller   = kv.Key;
                }
            }

            if (topwaller != null)
            {
                topwaller.SendMessage(54, "You had the top walls cast in the {0}.", Name);
                topwaller.PublicOverheadMessage(MessageType.Label, 54, true, topwaller.Name + ": Top Walls Cast!");

                BankBox bank = topwaller.FindBank(Map.Expansion);

                if (bank != null)
                {
                    bank.DropItem(
                        new BattlesTrophy(Name + " - Top Walls Cast: " + topwalls, TrophyType.Walls)
                    {
                        Owner = topwaller
                    });

                    topwaller.SendMessage(54, "A trophy has been placed in your bankbox.");
                }
            }

            if (topholder != null)
            {
                topholder.SendMessage(54, "You had the top crystal points in the {0}.", Name);
                topholder.PublicOverheadMessage(MessageType.Label, 54, true, topholder.Name + ": Top Crystal Points!");

                BankBox bank = topholder.FindBank(Map.Expansion);

                if (bank != null)
                {
                    bank.DropItem(
                        new BattlesTrophy(Name + " - Top Crystal Points: " + topheld, TrophyType.CrystalTime)
                    {
                        Owner = topholder
                    });

                    topholder.SendMessage(54, "A trophy has been placed in your bankbox.");
                }
            }

            if (topassaulter != null)
            {
                topassaulter.SendMessage(54, "You had the most crystal assaults in the {0}.", Name);
                topassaulter.PublicOverheadMessage(MessageType.Label, 54, true, topassaulter.Name + ": Top Crystal Assaults!");

                BankBox bank = topassaulter.FindBank(Map.Expansion);

                if (bank != null)
                {
                    bank.DropItem(
                        new BattlesTrophy(Name + " - Top Crystals Assaulted: " + topassaults, TrophyType.FlagAssaults)
                    {
                        Owner = topassaulter
                    });

                    topassaulter.SendMessage(54, "A trophy has been placed in your bankbox.");
                }
            }

            if (carrierkiller != null)
            {
                carrierkiller.SendMessage(54, "You had the top carrier kills in the {0}.", Name);
                carrierkiller.PublicOverheadMessage(MessageType.Label, 54, true, carrierkiller.Name + ": Top Carrier Kills!");

                BankBox bank = carrierkiller.FindBank(Map.Expansion);

                if (bank != null)
                {
                    bank.DropItem(
                        new BattlesTrophy(Name + " - Top Crystal Carrier Kills: " + topcarrierkills, TrophyType.FlagCaps)
                    {
                        Owner = carrierkiller
                    });

                    carrierkiller.SendMessage(54, "A trophy has been placed in your bankbox.");
                }
            }
        }
Ejemplo n.º 5
0
        private void OnAccept()
        {
            Type cType = Head.Expansion == Expansion.T2A ? typeof(Silver) : typeof(Gold);

            if (Head == null || Head.Deleted)
            {
                _Victim.SendMessage(
                    "Your head was turned over to the authorities by {0} during negotations.", User.RawName);
                User.SendMessage("You turned over {0}'s to the authorities during negotations and cannot accept this offer.", User.RawName);
                return;
            }

            if (Head.RootParentEntity != User)
            {
                _Victim.SendMessage(
                    "Your head does not appear to be possessed by {0} any longer.", User.RawName);
                User.SendMessage("You must retain the head in your pack or bank to engage in negotations for {0}'s head.", User.RawName);
                return;
            }

            if (!Banker.Withdraw(_Victim, cType, _Offer))
            {
                User.SendMessage("{0} could not afford this price.  Please make another offer later.", _Victim.RawName);

                _Victim.SendMessage(
                    "You could not afford to pay the counteroffer you made.  The amount of {0} in your bank has declined since you made the counteroffer.",
                    cType.Name);

                LoggingCustom.Log(
                    "MurdererNegotiate.txt",
                    String.Format(
                        "[Killer -> Victim][FAILED][{0}]:\t[{1} -> {2}]\t[{3}]\t[{4:#,0} {5}]\t\"{6}\"",
                        ServerTime.ShortDateTimeNow,
                        User,
                        _Victim,
                        Head,
                        _Offer,
                        cType.Name,
                        _Message));
                return;
            }

            _Victim.SendMessage(
                "{0:#,0} {1} has been withdrawn from your bank and paid to {2}.", _Offer, cType.Name, User.RawName);
            User.SendMessage("{0:#,0} {1} has been paid and added to your bank box by {2}.", _Offer, cType.Name, _Victim.RawName);

            Banker.Deposit(User, cType, _Offer);

            BankBox bank = _Victim.FindBank(Head.Expansion) ?? _Victim.BankBox;

            if (bank != null)
            {
                bank.DropItem(Head);
            }

            if (Head is Head2)
            {
                Head2.AllHeads.Remove((Head2)Head);
            }

            foreach (var g in GetInstances <HeadNegotiateGump>(_Victim, true).Where(g => g.Head == Head))
            {
                g.Close(true);
            }

            _Victim.SendMessage("Your severed head has been deposited into your bank box.");

            LoggingCustom.Log(
                "MurdererNegotiate.txt",
                String.Format(
                    "[Killer -> Victim][ACCEPTED][{0}]:\t[{1} -> {2}]\t[{3}]\t[{4:#,0} {5}]\t\"{6}\"",
                    ServerTime.ShortDateTimeNow,
                    User,
                    _Victim,
                    Head,
                    _Offer,
                    cType.Name,
                    _Message));
        }