Exemplo n.º 1
0
        public override void AlterFrom( BaseQuiver orig )
        {
            base.AlterFrom( orig );

            m_PhysicalDamage = orig.PhysicalDamage;
            m_FireDamage = orig.FireDamage;
            m_ColdDamage = orig.ColdDamage;
            m_PoisonDamage = orig.PoisonDamage;
            m_EnergyDamage = orig.EnergyDamage;
            m_ChaosDamage = orig.ChaosDamage;
            m_DirectDamage = orig.DirectDamage;
            m_DamageModifier = orig.DamageModifier;
        }
Exemplo n.º 2
0
        public virtual void AlterFrom( BaseQuiver orig )
        {
            m_Altered = true;

            m_MagicalAttributes = orig.Attributes;

            Crafter = orig.Crafter;
            Exceptional = orig.Exceptional;
        }
Exemplo n.º 3
0
            protected override void OnTarget(Mobile from, object target)
            {
                Item item = target as Item;
                Type type = item.GetType();

                if (item is BaseArmor || item is BaseWeapon || item is BaseHat || item is BaseJewel || item is BaseTalisman || item is BaseQuiver || item is Spellbook)
                {
                    if (Runescribing.GetProps(item) >= 7)
                    {
                        from.SendMessage("This item cannot be enhanced any further");
                    }
                    else if (item.ChantSlots >= 3)
                    {
                        from.SendMessage("This item cannot handle any more enhancments.");
                    }
                    else if (Runescribing.CheckBlacklist(type) == true)
                    {
                        from.SendMessage("This item cannot be enhanced.");
                    }
                    else
                    {
                        int value = m_Rune.BaseAmount;
                        int max   = m_Rune.MaxAmount;

                        if (item is BaseArmor)
                        {
                            BaseArmor i = item as BaseArmor;

                            if (i.Attributes.RegenMana + value <= max)
                            {
                                i.Attributes.RegenMana += value;
                            }
                            else
                            {
                                i.Attributes.RegenMana = max;
                            }
                        }

                        if (item is BaseWeapon)
                        {
                            BaseWeapon i = item as BaseWeapon;

                            if (i.Attributes.RegenMana + value <= max)
                            {
                                i.Attributes.RegenMana += value;
                            }
                            else
                            {
                                i.Attributes.RegenMana = max;
                            }
                        }

                        if (item is BaseHat)
                        {
                            BaseHat i = item as BaseHat;

                            if (i.Attributes.RegenMana + value <= max)
                            {
                                i.Attributes.RegenMana += value;
                            }
                            else
                            {
                                i.Attributes.RegenMana = max;
                            }
                        }

                        if (item is BaseJewel)
                        {
                            BaseJewel i = item as BaseJewel;

                            if (i.Attributes.RegenMana + value <= max)
                            {
                                i.Attributes.RegenMana += value;
                            }
                            else
                            {
                                i.Attributes.RegenMana = max;
                            }
                        }

                        if (item is BaseTalisman)
                        {
                            BaseTalisman i = item as BaseTalisman;

                            if (i.Attributes.RegenMana + value <= max)
                            {
                                i.Attributes.RegenMana += value;
                            }
                            else
                            {
                                i.Attributes.RegenMana = max;
                            }
                        }

                        if (item is BaseQuiver)
                        {
                            BaseQuiver i = item as BaseQuiver;

                            if (i.Attributes.RegenMana + value <= max)
                            {
                                i.Attributes.RegenMana += value;
                            }
                            else
                            {
                                i.Attributes.RegenMana = max;
                            }
                        }

                        if (item is Spellbook)
                        {
                            max += 1;

                            Spellbook i = item as Spellbook;

                            if (i.Attributes.RegenMana + value <= max)
                            {
                                i.Attributes.RegenMana += value;
                            }
                            else
                            {
                                i.Attributes.RegenMana = max;
                            }
                        }

                        item.ChantSlots += 1;
                        m_Rune.Delete();
                    }
                }
                else
                {
                    from.SendMessage("You cannot use this enhancement on that.");
                }
            }
Exemplo n.º 4
0
        public virtual bool OnFired(Mobile attacker, Mobile defender)
        {
            int color = 0;

            if (this is ThrowingGloves && attacker.Player)
            {
                string ammoType = "Throwing Stones";

                ThrowingGloves glove = (ThrowingGloves)this;
                if (glove.GloveType == "Stones")
                {
                    ammoType = "Throwing Stones"; color = 0x961;
                }
                else if (glove.GloveType == "Axes")
                {
                    ammoType = "Throwing Axes";
                }
                else if (glove.GloveType == "Daggers")
                {
                    ammoType = "Throwing Daggers";
                }
                else if (glove.GloveType == "Darts")
                {
                    ammoType = "Throwing Darts";
                }
                else
                {
                    ammoType = "Throwing Stars";
                }

                foreach (Item i in attacker.Backpack.FindItemsByType(typeof(ThrowingWeapon), true))
                {
                    if (ammoType == "Throwing Stones")
                    {
                        ((ThrowingWeapon)i).ammo = "Throwing Stones"; i.ItemID = 0x10B6; i.Name = "throwing stone"; i.Hue = 0x961;
                    }
                    else if (ammoType == "Throwing Axes")
                    {
                        ((ThrowingWeapon)i).ammo = "Throwing Axes"; i.ItemID = 0x10B3; i.Name = "throwing axe"; i.Hue = 0;
                    }
                    else if (ammoType == "Throwing Daggers")
                    {
                        ((ThrowingWeapon)i).ammo = "Throwing Daggers"; i.ItemID = 0x10B7; i.Name = "throwing dagger"; i.Hue = 0;
                    }
                    else if (ammoType == "Throwing Darts")
                    {
                        ((ThrowingWeapon)i).ammo = "Throwing Darts"; i.ItemID = 0x10B5; i.Name = "throwing dart"; i.Hue = 0;
                    }
                    else
                    {
                        ((ThrowingWeapon)i).ammo = "Throwing Stars"; i.ItemID = 0x10B2; i.Name = "throwing star"; i.Hue = 0;
                    }
                    i.InvalidateProperties();
                }
            }

            if (attacker.Player)
            {
                BaseQuiver quiver = attacker.FindItemOnLayer(Layer.Cloak) as BaseQuiver;
                Container  pack   = attacker.Backpack;

                if (quiver == null || Utility.Random(100) >= quiver.LowerAmmoCost)
                {
                    // consume ammo
                    if (quiver != null && quiver.ConsumeTotal(AmmoType, 1))
                    {
                        quiver.InvalidateWeight();
                    }
                    else if (pack == null || !pack.ConsumeTotal(AmmoType, 1))
                    {
                        return(false);
                    }
                }
                else if (quiver.FindItemByType(AmmoType) == null && (pack == null || pack.FindItemByType(AmmoType) == null))
                {
                    // lower ammo cost should not work when we have no ammo at all
                    return(false);
                }
            }

            attacker.MovingEffect(defender, EffectID, 18, 1, false, false);

            Server.Gumps.QuickBar.RefreshQuickBar(attacker);

            return(true);
        }
Exemplo n.º 5
0
 public RefillQuiverEntry(BaseQuiver bq)
     : base(6230)
 {
     m_quiver = bq;
 }
Exemplo n.º 6
0
		public static ItemValue CheckQuiver( BaseQuiver item )
		{
			int value = 0;

			foreach( int i in Enum.GetValues(typeof( AosAttribute ) ) )
			{
				if ( item != null && item.Attributes[ (AosAttribute)i ] > 0 )
					value += 2;
			}

			//Start standard attributes

			if ( item.Attributes.AttackChance > 0 )
				value += item.Attributes.AttackChance * 2;

			if ( item.Attributes.BonusDex > 0 )
				value += item.Attributes.BonusDex * 4;

			if ( item.Attributes.BonusHits > 0 )
				value += item.Attributes.BonusHits * 2;

			if ( item.Attributes.BonusInt > 0 )
				value += item.Attributes.BonusInt * 4;

			if ( item.Attributes.BonusMana > 0 )
				value += item.Attributes.BonusMana * 2;

			if ( item.Attributes.BonusStam > 0 )
				value += item.Attributes.BonusStam * 2;

			if ( item.Attributes.BonusStr > 0 )
				value += item.Attributes.BonusStr * 4;

			if ( item.Attributes.CastRecovery > 0 )
				value += item.Attributes.CastRecovery * 10;

			if ( item.Attributes.CastSpeed > 0 )
				value += item.Attributes.CastSpeed * 10;

			if ( item.Attributes.DefendChance > 0 )
				value += item.Attributes.DefendChance * 2;

			if ( item.Attributes.EnhancePotions > 0 )
				value += item.Attributes.EnhancePotions;

			if ( item.Attributes.LowerManaCost > 0 )
				value += item.Attributes.LowerManaCost * 2;

			if ( item.Attributes.LowerRegCost > 0 )
				value += item.Attributes.LowerRegCost;

			if ( item.Attributes.Luck > 0 )
				value += item.Attributes.Luck / 2;

			if ( item.Attributes.NightSight > 0 )
				value += 10;

			if ( item.Attributes.ReflectPhysical > 0 )
				value += item.Attributes.ReflectPhysical * 2;

			if ( item.Attributes.RegenHits > 0 )
				value += item.Attributes.RegenHits * 10;

			if ( item.Attributes.RegenMana > 0 )
				value += item.Attributes.RegenMana * 10;

			if ( item.Attributes.RegenStam > 0 )
				value += item.Attributes.RegenStam * 10;

			if ( item.Attributes.SpellChanneling > 0 )
				value += 10;

			if ( item.Attributes.SpellDamage > 0 )
				value += item.Attributes.SpellDamage * 2;

			if ( item.Attributes.WeaponDamage > 0 )
				value += item.Attributes.WeaponDamage * 2;

			if ( item.Attributes.WeaponSpeed > 0 )
				value += item.Attributes.WeaponSpeed * 2;

			// Start Quiver Bonuses

			if ( item.DamageIncrease > 0 )
				value += item.DamageIncrease;

			if ( item.LowerAmmoCost > 0 )
				value += item.LowerAmmoCost;

			//Start Calculate

			if ( value <= 50 )
				return ItemValue.Common;

			if ( value <= 100 )
				return ItemValue.Uncommon;

			if ( value <= 200 )
				return ItemValue.Rare;

			if ( value <= 300 )
				return ItemValue.Epic;

			return ItemValue.Legendary;
		}