public virtual void Reward(PlayerMobile player, CollectionItem reward, int hue)
        {
            Item item = QuestHelper.Construct(reward.Type) as Item;

            if (item != null && player.AddToBackpack(item))
            {
                if (hue > 0)
                {
                    item.Hue = hue;
                }

                player.AddCollectionPoints(this.CollectionID, (int)reward.Points * -1);
                player.SendLocalizedMessage(1073621); // Your reward has been placed in your backpack.
                player.PlaySound(0x5A7);

                if (reward.QuestItem)
                {
                    CollectionsObtainObjective.CheckReward(player, item);
                }
            }
            else if (item != null)
            {
                player.SendLocalizedMessage(1074361); // The reward could not be given.  Make sure you have room in your pack.
                item.Delete();
            }

            reward.OnGiveReward(player, this, hue);

            player.CloseGump(typeof(ComunityCollectionGump));
            player.SendGump(new ComunityCollectionGump(player, this, this.Location));
        }
        public virtual void Donate(PlayerMobile player, CollectionItem item, int amount)
        {
            int points = (int)(amount * item.Points);

            player.AddCollectionPoints(this.CollectionID, points);

            player.SendLocalizedMessage(1072816);                    // Thank you for your donation!
            player.SendLocalizedMessage(1072817, points.ToString()); // You have earned ~1_POINTS~ reward points for this donation.
            player.SendLocalizedMessage(1072818, points.ToString()); // The Collection has been awarded ~1_POINTS~ points

            this.Points += points;

            this.InvalidateProperties();
        }
예제 #3
0
 public override void OnGiveReward(PlayerMobile to, IComunityCollection collection, int hue)
 {
     if (to.AddCollectionTitle(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!
     }
 }