コード例 #1
0
        public override void OnGiveReward(PlayerMobile to, Item item, IComunityCollection collection, int hue)
        {
            if (this.Faction != null)
            {
                FactionEquipment.CheckProperties(item);
                FactionItem.Imbue(item, Faction, false, -1, MinRank);

                if (!(item is Spellbook || item is ShrineGem))
                {
                    item.LootType = LootType.Regular;
                }

                if (item is IWearableDurability)
                {
                    ((IWearableDurability)item).MaxHitPoints = 255;
                    ((IWearableDurability)item).HitPoints    = 255;
                }

                if (item is IOwnerRestricted)
                {
                    ((IOwnerRestricted)item).Owner = to;
                    to.SendLocalizedMessage(1094803); // This faction reward is bound to you, and cannot be traded.
                }

                item.InvalidateProperties();
            }

            base.OnGiveReward(to, item, collection, hue);
        }
コード例 #2
0
ファイル: PowderOfPerseverance.cs プロジェクト: pallop/Servuo
        public override void GetProperties(ObjectPropertyList list)
        {
            base.GetProperties(list);

            list.Add(1060584, "1"); // uses remaining: ~1_val~

            FactionEquipment.AddFactionProperties(this, list);
        }
コード例 #3
0
ファイル: PowderOfPerseverance.cs プロジェクト: pallop/Servuo
        public override void OnDoubleClick(Mobile from)
        {
            if (IsChildOf(from.Backpack))
            {
                if (FactionEquipment.CanUse(this, from))
                {
                    from.BeginTarget(-1, false, Server.Targeting.TargetFlags.None, (m, targeted) =>
                    {
                        if (targeted is IFactionItem && targeted is IWearableDurability)
                        {
                            IWearableDurability durability = targeted as IWearableDurability;

                            if (durability.HitPoints >= durability.MaxHitPoints)
                            {
                                m.SendLocalizedMessage(1094761);     // This item is already in perfect condition.
                            }
                            else if (durability.MaxHitPoints <= 125)
                            {
                                m.SendLocalizedMessage(1049083);     // You cannot use the powder on that item.
                            }
                            else
                            {
                                if (durability.MaxHitPoints == 255)
                                {
                                    durability.MaxHitPoints = 225;
                                }
                                else
                                {
                                    durability.MaxHitPoints -= 25;
                                }

                                durability.HitPoints = durability.MaxHitPoints;

                                m.SendLocalizedMessage(1049084);     // You successfully use the powder on the item.
                                m.SendLocalizedMessage(1094760);     // You have used up your Powder of Perseverance.
                                m.PlaySound(0x247);

                                Delete();
                            }
                        }
                        else
                        {
                            m.SendLocalizedMessage(1049083);     // You cannot use the powder on that item.
                        }
                    });
                }
            }
            else
            {
                from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
            }
        }
コード例 #4
0
ファイル: StrongholdRune.cs プロジェクト: Evad-lab/ServUOX
 public override void OnDoubleClick(Mobile m)
 {
     if (IsChildOf(m.Backpack))
     {
         if (FactionEquipment.CanUse(this, m))
         {
             if (!IsInCooldown(m))
             {
                 Timer.DelayCall <Mobile>(TimeSpan.FromSeconds(1), Warp, m);
             }
             else
             {
                 m.SendLocalizedMessage(501789); // You must wait before trying again.
             }
         }
         else
         {
             m.SendMessage("You are not the proper faction to use this item.");
             //TODO: Message
         }
     }
 }
コード例 #5
0
        public override void OnDoubleClick(Mobile from)
        {
            if (from.InRange(GetWorldLocation(), 2))
            {
                if (FactionEquipment.CanUse(this, from))
                {
                    from.RevealingAction();

                    from.SendLocalizedMessage(500948); // Who will you use the bandages on?

                    from.BeginTarget(-1, false, Server.Targeting.TargetFlags.Beneficial, (healer, targeted) =>
                    {
                        Mobile patient = targeted as Mobile;

                        if (patient != null)
                        {
                            if (EnchantedApple.GetTotalCurses(patient) == 0)
                            {
                                healer.SendLocalizedMessage(500955);     // That being is not damaged!
                            }
                            else if (!Deleted && healer.CanBeBeneficial(patient, true, true))
                            {
                                healer.DoBeneficial(patient);

                                bool onSelf = (healer == patient);
                                int dex     = healer.Dex;

                                double seconds;
                                double resDelay = (patient.Alive ? 0.0 : 5.0);

                                if (onSelf)
                                {
                                    seconds = 9.4 + (0.6 * ((double)(120 - dex) / 10));
                                }
                                else
                                {
                                    seconds = Math.Ceiling((double)4 - healer.Dex / 60);
                                    seconds = Math.Max(seconds, 2);
                                }

                                if (Context.ContainsKey(healer))
                                {
                                    Context[healer].Stop();
                                }

                                Context[healer] = new InternalTimer(this, patient, healer, seconds);

                                if (!onSelf)
                                {
                                    patient.SendLocalizedMessage(1008078, false, healer.Name);     //  : Attempting to heal you.
                                }

                                healer.SendLocalizedMessage(500956);     // You begin applying the bandages.

                                if (healer.NetState != null && healer.NetState.IsEnhancedClient)
                                {
                                    healer.NetState.Send(new BandageTimerPacket((int)(seconds)));
                                }

                                Consume();
                            }
                        }
                    });
                }
            }
            else
            {
                from.SendLocalizedMessage(500295); // You are too far away to do that.
            }
        }
コード例 #6
0
 public override void GetProperties(ObjectPropertyList list)
 {
     base.GetProperties(list);
     FactionEquipment.AddFactionProperties(this, list);
 }