Ejemplo n.º 1
0
        public override void OnDoubleClick(Mobile from)
        {
            if (IsChildOf(from.Backpack))
            {
                if (Title != null && (Title.String != null || Title.Number > 0))
                {
                    PlayerMobile pm = from as PlayerMobile;

                    if (pm != null)
                    {
                        if ((Title.Number > 0 && pm.AddRewardTitle(Title.Number)) ||
                            Title.String != null && pm.AddRewardTitle(Title.String))
                        {
                            pm.SendLocalizedMessage(1155605, Title.ToString());  //Thou hath been bestowed the title ~1_TITLE~!
                            Delete();
                        }
                        else
                        {
                            pm.SendLocalizedMessage(1073626); // You already have that title!
                        }
                    }
                }
            }
            else
            {
                from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
            }
        }
Ejemplo n.º 2
0
 public override void OnGiveReward(PlayerMobile to, Item item, IComunityCollection collection, int hue)
 {
     if (to.AddRewardTitle(m_Title))
     {
         if (m_Title is int)
         {
             to.SendLocalizedMessage(1073625, "#" + (int)m_Title); // The title "~1_TITLE~" has been bestowed upon you.
         }
         else if (m_Title is string)
         {
             to.SendLocalizedMessage(1073625, (string)m_Title); // The title "~1_TITLE~" has been bestowed upon you.
         }
         to.AddCollectionPoints(collection.CollectionID, (int)Points * -1);
     }
     else
     {
         to.SendLocalizedMessage(1073626); // You already have that title!
     }
 }
Ejemplo n.º 3
0
        public void CheckTitle(PlayerMobile pm)
        {
            PlayerStatsEntry entry = GetPlayerEntry <PlayerStatsEntry>(pm);
            int title = 0;

            switch (entry.TotalDuels)
            {
            case 1: title = 1152068 + (int)ArenaTitle.FledglingGladiator; break;

            case 50: title = 1152068 + (int)ArenaTitle.BuddingGladiator; break;

            case 100: title = 1152068 + (int)ArenaTitle.Gladiator; break;

            case 250: title = 1152068 + (int)ArenaTitle.WellKnownGladiator; break;

            case 500: title = 1152068 + (int)ArenaTitle.VeteranGladiator; break;
            }

            if (title > 0)
            {
                pm.AddRewardTitle(title);
                pm.SendLocalizedMessage(1152067, String.Format("#{0}", title.ToString())); // You have gotten a new subtitle, ~1_VAL~, in reward for your duel!
            }
        }