RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Hi all :D My first scripts <-- Imbuing system

JEEG84

Sorceror
Hi DreamSeeker i have a question for you :

- Is the value of % success Chance real and same OSI or Not ??

- Is the value of Ingredient same OSI ??
 

Dreamseeker

Sorceror
- Is the value of % success Chance real and same OSI or Not ??
The Success % isn't 'Exactly' the same formula as OSI, I have used the same base difficulty (49.9% at 0 skill for 1 intensity weight).. but the increase in difficulty isn't spot on, but is as close as I could be bothered with. - So.. yeah, quite close.

- Is the value of Ingredient same OSI ??
This is to exact OSI specifications (Maybe slight differences due to the way they are calculated - I used (IngredientsMax / 100 ) * Prop weight ) But other than that it needs the same as OSI.

I've just released an Abyss MiniChamp system which drops the Essenses in the same way as OSI too :p
 

Iraq-

Sorceror
Any intended further updates to the system? Particularly for the Brittle property and the Soul Reinforcement.

I've managed to get the Brittle property to add just fine, simple stuff really. But for the life of me, TimesImbued cannot be called in PowderOfTemperament. As you know, I'm sure, Brittle items cannot be fortified.


Hello Avachel, to get your power of fortification to properly block "Brittle" items, properly place this code:
Code:
if( item is BaseArmor )
                    {
                        BaseArmor Ti = (BaseArmor)item as BaseArmor;
                        if( Ti.TimesImbued > 0)
                        {
                            from.SendLocalizedMessage( 1049083 ); // You cannot use the powder on that item.
                            return;
                        }
                    }
                    else if( item is BaseJewel )
                    {
                        BaseJewel Ti = (BaseJewel)item as BaseJewel;
                        if( Ti.TimesImbued > 0)
                        {
                            from.SendLocalizedMessage( 1049083 ); // You cannot use the powder on that item.
                            return;
                        }
                    }
                    else if( item is BaseHat )
                    {
                        BaseHat Ti = (BaseHat)item as BaseHat;
                        if( Ti.TimesImbued > 0)
                        {
                            from.SendLocalizedMessage( 1049083 ); // You cannot use the powder on that item.
                            return;
                        }
                    }
                    else if( item is BaseWeapon )
                    {
                        BaseWeapon Ti = (BaseWeapon)item as BaseWeapon;
                        if( Ti.TimesImbued > 0)
                        {
                            from.SendLocalizedMessage( 1049083 ); // You cannot use the powder on that item.
                            return;
                        }
                    }
after:
Code:
if ( !wearable.CanFortify )
                    {
                        from.SendLocalizedMessage( 1049083 ); // You cannot use the powder on that item.
                        return;
                    }
 

Pakko

Traveler
What %success chance issues are there?
It has like a huge percentage of creating the item, im only new to the imbuing theme, so any info on this package would be great! Standing near soulforge in termur i can unravel and all works well, though in the imbue gump when i goto craft it has a 200+% success chance to add 100 properties, as i said im new to imbuing and have read little bits here and there on how it works, same issues are mentioned on page 2.
 

rondelin

Sorceror
Item Id skill is nice. Im having trouble scripting an Item Id wand or staff [equipable item] so players can get around the skill requirement. Dont want it to be a basewand but want it to have charges. Any ideas on how to script such an item. It needs to act as 100% skill bonus on D-click not equip and consume charges.
 

Iraq-

Sorceror
Item Id skill is nice. Im having trouble scripting an Item Id wand or staff [equipable item] so players can get around the skill requirement. Dont want it to be a basewand but want it to have charges. Any ideas on how to script such an item. It needs to act as 100% skill bonus on D-click not equip and consume charges.
Here try this:
Code:
using System;
using Server;
using Server.Mobiles;
using Server.Items;
using Server.Targeting;
 
namespace Server.Items;
{
    public class IDItem : GnarledStaff //BaseWand
    {
        [CommandProperty( AccessLevel.GameMaster )]
        public int Charges{ get{ return m_Charges; } set{ m_Charges = value; InvalidateProperties(); if( m_DeleteOnEmptyUses && m_Charges <= 0 ){ this.Delete(); } } }
        [CommandProperty( AccessLevel.GameMaster )]
        public bool DeleteOnEmptyUses{ get{ return m_DeleteOnEmptyUses; } set{ m_DeleteOnEmptyUses = value; InvalidateProperties(); } }
 
        private int m_Charges;
        private bool m_DeleteOnEmptyUses = true;
 
        [Constructable]
        public IDItem() : this( 50, true )
        {
        }
 
        [Constructable]
        public IDItem( int charges ) : this( charges, true )
        {
            m_Charges = charges;
        }
 
        [Constructable]
        public IDItem( int charges, bool deleteonemptyuses )
        {
            m_DeleteOnEmptyUses = deleteonemptyuses;
            m_Charges = charges;
        }
 
        public IDItem( Serial serial ) : base( serial )
        {
        }
 
        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );
 
            writer.Write( (int) 0 ); // version
 
            writer.Write( (int)m_Charges );
            writer.Write( (bool)m_DeleteOnEmptyUses );
        }
 
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );
 
            int version = reader.ReadInt();
 
            switch( version )
            {
                case 0:
                {
                    m_Charges = reader.ReadInt();
                    m_DeleteOnEmptyUses = reader.ReadBool();
                    break;
                }
            }
        }
 
        public override void GetProperties(ObjectPropertyList list)
        {
            base.GetProperties(list);
 
            if (m_Charges > 0)
                list.Add("Charges: {0}", m_Charges.ToString());
            else if( m_Charges == 0 )
                list.Add("No Charges");
        }
 
        public override void OnDoubleClick(Mobile from)
        {
            PlayerMobile pm = from as PlayerMobile;
 
            if (!IsChildOf(from.Backpack) && ( RootParent != null && (Mobile)RootParent != from ) )
            {
                from.SendMessage("This item must be equipped or in your pack before you are able to use it");
            }
            else
            {
                if ( m_Charges <= 0 )
                {
                    from.SendMessage("Out of charges!");
                }
                else
                {
                    from.SendMessage("Which item do you wish to unravel?");
                    from.Target = new InternalTarget( this );
                }
            }
        }
 
        private class InternalTarget : Target
        {
            private IDItem m_IDItem;
 
            public InternalTarget( IDItem iditem )
                : base(8, false, TargetFlags.None)
            {
                AllowNonlocal = true;
   
                m_IDItem = iditem;
            }
 
            protected override void OnTarget(Mobile from, object o)
            {
                int oInt = 0;
                double oDo = 0;
                int oMods = 0;
   
                if( m_IDItem == null || m_IDItem.Deleted )
                    return;
   
                if( o == null )
                    return;
       
                Item targ = o as Item;
   
                if (!m_IDItem.IsChildOf(from.Backpack) || m_IDItem.RootParent == null || !( m_IDItem.RootParent != null && (Mobile)m_IDItem.RootParent == from ) )
                {
                    from.SendMessage("The staff must be equipped or in your pack before you are able to use it.");
                    return;
                }
                else if( targ != null && !Utility.InRange( targ.GetWorldLocation(), from.Location, 4 ) )
                {       
                    from.SendMessage( "That is too far away!" );
                    return;
                }
                else if( m_IDItem.Charges <= 0 )
                {
                    from.SendMessage( "The staff is out of charges." );
                    return;
                }
   
                if (o is BaseWeapon || o is BaseArmor || o is BaseJewel || o is BaseHat)
                {
                    if (o is BaseWeapon)
                    {
                        BaseWeapon w = o as BaseWeapon;
                        if (o is BaseRanged)
                        {
                            BaseRanged r = o as BaseRanged;
                            if (r.Velocity > 0) { oDo += (130 / 50) * r.Velocity; oMods += 1; }
                            if (r.Balanced == true) { oDo += 150; oMods += 1; }
                            if (w.Attributes.DefendChance > 0) { oDo += (130 / 25) * w.Attributes.DefendChance; oMods += 1; }
                            if (w.Attributes.AttackChance > 0) { oDo += (130 / 25) * w.Attributes.AttackChance; oMods += 1; }
                            if (w.Attributes.Luck > 0) { oDo += (100 / 120) * w.Attributes.Luck; oMods += 1; }
                            if (w.WeaponAttributes.ResistPhysicalBonus > 0) { oDo += (100 / 18) * w.WeaponAttributes.ResistPhysicalBonus; oMods += 1; }
                            if (w.WeaponAttributes.ResistFireBonus > 0) { oDo += (100 / 18) * w.WeaponAttributes.ResistFireBonus; oMods += 1; }
                            if (w.WeaponAttributes.ResistColdBonus > 0) { oDo += (100 / 18) * w.WeaponAttributes.ResistColdBonus; oMods += 1; }
                            if (w.WeaponAttributes.ResistPoisonBonus > 0) { oDo += (100 / 18) * w.WeaponAttributes.ResistPoisonBonus; oMods += 1; }
                            if (w.WeaponAttributes.ResistEnergyBonus > 0) { oDo += (100 / 18) * w.WeaponAttributes.ResistEnergyBonus; oMods += 1; }
                        }
                        else if(o is BaseMeleeWeapon)
                        {
                            if (w.Attributes.DefendChance > 0) { oDo += (130 / 15) * w.Attributes.DefendChance; oMods += 1; }
                            if (w.Attributes.AttackChance > 0) { oDo += (130 / 15) * w.Attributes.AttackChance; oMods += 1; }
                            if (w.Attributes.Luck > 0) { oDo += w.Attributes.Luck; oMods += 1; }
                            if (w.WeaponAttributes.ResistPhysicalBonus > 0) { oDo += (100 / 15) * w.WeaponAttributes.ResistPhysicalBonus; oMods += 1; }
                            if (w.WeaponAttributes.ResistFireBonus > 0) { oDo += (100 / 15) * w.WeaponAttributes.ResistFireBonus; oMods += 1; }
                            if (w.WeaponAttributes.ResistColdBonus > 0) { oDo += (100 / 15) * w.WeaponAttributes.ResistColdBonus; oMods += 1; }
                            if (w.WeaponAttributes.ResistPoisonBonus > 0) { oDo += (100 / 15) * w.WeaponAttributes.ResistPoisonBonus; oMods += 1; }
                            if (w.WeaponAttributes.ResistEnergyBonus > 0) { oDo += (100 / 15) * w.WeaponAttributes.ResistEnergyBonus; oMods += 1; }
                        }
 
                        if (w.Attributes.RegenHits > 0) { oDo += (50 * w.Attributes.RegenHits); oMods += 1; }
                        if (w.Attributes.RegenStam > 0) { oDo += (33.33 * w.Attributes.RegenStam); oMods += 1; }
                        if (w.Attributes.RegenMana > 0) { oDo += (50 * w.Attributes.RegenMana); oMods += 1; }
                        if (w.Attributes.BonusStr > 0) { oDo += (110 / 8) * w.Attributes.BonusStr; oMods += 1; }
                        if (w.Attributes.BonusDex > 0) { oDo += (110 / 8) * w.Attributes.BonusDex; oMods += 1; }
                        if (w.Attributes.BonusInt > 0) { oDo += (110 / 8) * w.Attributes.BonusInt; oMods += 1; }
                        if (w.Attributes.BonusHits > 0) { oDo += 22 * w.Attributes.BonusHits; oMods += 1; }
                        if (w.Attributes.BonusStam > 0) { oDo += (100 / 8) * w.Attributes.BonusStam; oMods += 1; }
                        if (w.Attributes.BonusMana > 0) { oDo += (110 / 8) * w.Attributes.BonusMana; oMods += 1; }
                        if (w.Attributes.WeaponDamage > 0) { oDo += (2 * w.Attributes.WeaponDamage); oMods += 1; }
                        if (w.Attributes.WeaponSpeed > 0) { oDo += (110 / 30) * w.Attributes.WeaponSpeed; oMods += 1; }
                        if (w.Attributes.SpellDamage > 0) { oDo += (100 / 12) * w.Attributes.SpellDamage; oMods += 1; }
                        if (w.Attributes.CastRecovery > 0) { oDo += (40 * w.Attributes.CastRecovery); oMods += 1; }
                        if (w.Attributes.LowerManaCost > 0) { oDo += (110 / 8) * w.Attributes.LowerManaCost; oMods += 1; }
                        if (w.Attributes.LowerRegCost > 0) { oDo += (5 * w.Attributes.LowerRegCost); oMods += 1; }
                        if (w.Attributes.ReflectPhysical > 0) { oDo += (100 / 15) * w.Attributes.ReflectPhysical; oMods += 1; }
                        if (w.Attributes.EnhancePotions > 0) { oDo += (4 * w.Attributes.EnhancePotions); oMods += 1; }
                        if (w.Attributes.SpellChanneling > 0)
                        {
                            oDo += 100; oMods += 1;
                            if (w.Attributes.CastSpeed == 0) { oDo += 140; oMods += 1; }
                            if (w.Attributes.CastSpeed == 1) { oDo += 280; oMods += 1; }
                        }
                        else if (w.Attributes.CastSpeed > 0) { oDo += (140 * w.Attributes.CastSpeed); oMods += 1; }
                        if (w.Attributes.NightSight > 0) { oDo += 50; oMods += 1; }
 
                        if (w.WeaponAttributes.LowerStatReq > 0) { oDo += w.WeaponAttributes.LowerStatReq; oMods += 1; }
                        if (w.WeaponAttributes.HitLeechHits > 0) { oDo += (110 / 50) * w.WeaponAttributes.HitLeechHits; oMods += 1; }
                        if (w.WeaponAttributes.HitLeechStam > 0) { oDo += 2 * w.WeaponAttributes.HitLeechStam; oMods += 1; }
                        if (w.WeaponAttributes.HitLeechMana > 0) { oDo += (110 / 50) * w.WeaponAttributes.HitLeechMana; oMods += 1; }
                        if (w.WeaponAttributes.HitLowerAttack > 0) { oDo += (110 / 50) * w.WeaponAttributes.HitLowerAttack; oMods += 1; }
                        if (w.WeaponAttributes.HitLowerDefend > 0) { oDo += (130 / 50) * w.WeaponAttributes.HitLowerDefend; oMods += 1; }
                        if (w.WeaponAttributes.HitColdArea > 0) { oDo += (2 * w.WeaponAttributes.HitColdArea); oMods += 1; }
                        if (w.WeaponAttributes.HitFireArea > 0) { oDo += (2 * w.WeaponAttributes.HitFireArea); oMods += 1; }
                        if (w.WeaponAttributes.HitPoisonArea > 0) { oDo += (2 * w.WeaponAttributes.HitPoisonArea); oMods += 1; }
                        if (w.WeaponAttributes.HitEnergyArea > 0) { oDo += (2 * w.WeaponAttributes.HitEnergyArea); oMods += 1; }
                        if (w.WeaponAttributes.HitPhysicalArea > 0) { oDo += (2 * w.WeaponAttributes.HitPhysicalArea); oMods += 1; }
                        if (w.WeaponAttributes.HitMagicArrow > 0) { oDo += 2.4 * w.WeaponAttributes.HitMagicArrow; oMods += 1; }
                        if (w.WeaponAttributes.HitHarm > 0) { oDo += (110 / 50) * w.WeaponAttributes.HitHarm; oMods += 1; }
                        if (w.WeaponAttributes.HitFireball > 0) { oDo += 2.4 * w.WeaponAttributes.HitFireball; oMods += 1; }
                        if (w.WeaponAttributes.HitLightning > 0) { oDo += 2.4 * w.WeaponAttributes.HitLightning; oMods += 1; }
                        if (w.WeaponAttributes.HitDispel > 0) { oDo += (2 * w.WeaponAttributes.HitDispel); oMods += 1; }
                        if (w.WeaponAttributes.UseBestSkill > 0) { oDo += 150; oMods += 1; }
                        if (w.WeaponAttributes.MageWeapon > 0) { oDo += (20 * w.WeaponAttributes.MageWeapon); oMods += 1; }
                        if (w.WeaponAttributes.DurabilityBonus > 0) { oDo += w.WeaponAttributes.DurabilityBonus; oMods += 1; }
                        if (w.Slayer == SlayerName.Silver || w.Slayer == SlayerName.Repond || w.Slayer == SlayerName.ReptilianDeath || w.Slayer == SlayerName.Exorcism || w.Slayer == SlayerName.ArachnidDoom || w.Slayer == SlayerName.ElementalBan || w.Slayer == SlayerName.Fey) { oDo += 130; oMods += 1; }
                        else if (w.Slayer != SlayerName.None) { oDo += 110; oMods += 1; }
                        if (w.Slayer2 == SlayerName.Silver || w.Slayer2 == SlayerName.Repond || w.Slayer2 == SlayerName.ReptilianDeath || w.Slayer2 == SlayerName.Exorcism || w.Slayer2 == SlayerName.ArachnidDoom || w.Slayer2 == SlayerName.ElementalBan || w.Slayer2 == SlayerName.Fey) { oDo += 130; oMods += 1; }
                        else if (w.Slayer2 != SlayerName.None) { oDo += 110; oMods += 1; }
 
                        if (w.SkillBonuses.GetBonus(0) > 0) { oDo += (140 / 15) * w.SkillBonuses.GetBonus(0); oMods += 1; }
                        if (w.SkillBonuses.GetBonus(1) > 0) { oDo += (140 / 15) * w.SkillBonuses.GetBonus(1); oMods += 1; }
                        if (w.SkillBonuses.GetBonus(2) > 0) { oDo += (140 / 15) * w.SkillBonuses.GetBonus(2); oMods += 1; }
                        if (w.SkillBonuses.GetBonus(3) > 0) { oDo += (140 / 15) * w.SkillBonuses.GetBonus(3); oMods += 1; }
                        if (w.SkillBonuses.GetBonus(4) > 0) { oDo += (140 / 15) * w.SkillBonuses.GetBonus(4); oMods += 1; }
                        oDo = Math.Round(oDo, 1);
                        oInt += Convert.ToInt32(oDo);
                    }
                    if (o is BaseArmor)
                    {
                        BaseArmor w = o as BaseArmor;
 
                        if (w.Attributes.DefendChance > 0) { oDo += (130 / 15) * w.Attributes.DefendChance; oMods += 1; }
                        if (w.Attributes.AttackChance > 0) { oDo += (130 / 15) * w.Attributes.AttackChance; oMods += 1; }
                        if (w.Attributes.Luck > 0) { oDo += w.Attributes.Luck; oMods += 1; }
                        if (w.Attributes.RegenHits > 0) { oDo += (50 * w.Attributes.RegenHits); oMods += 1; }
                        if (w.Attributes.RegenStam > 0) { oDo += (33.33 * w.Attributes.RegenStam); oMods += 1; }
                        if (w.Attributes.RegenMana > 0) { oDo += (50 * w.Attributes.RegenMana); oMods += 1; }
                        if (w.Attributes.BonusStr > 0) { oDo += (110 / 8) * w.Attributes.BonusStr; oMods += 1; }
                        if (w.Attributes.BonusDex > 0) { oDo += (110 / 8) * w.Attributes.BonusDex; oMods += 1; }
                        if (w.Attributes.BonusInt > 0) { oDo += (110 / 8) * w.Attributes.BonusInt; oMods += 1; }
                        if (w.Attributes.BonusHits > 0) { oDo += 22 * w.Attributes.BonusHits; oMods += 1; }
                        if (w.Attributes.BonusStam > 0) { oDo += (100 / 8) * w.Attributes.BonusStam; oMods += 1; }
                        if (w.Attributes.BonusMana > 0) { oDo += (110 / 8) * w.Attributes.BonusMana; oMods += 1; }
                        if (w.Attributes.WeaponDamage > 0) { oDo += (2 * w.Attributes.WeaponDamage); oMods += 1; }
                        if (w.Attributes.WeaponSpeed > 0) { oDo += (110 / 30) * w.Attributes.WeaponSpeed; oMods += 1; }
                        if (w.Attributes.SpellDamage > 0) { oDo += (100 / 12) * w.Attributes.SpellDamage; oMods += 1; }
                        if (w.Attributes.CastRecovery > 0) { oDo += (40 * w.Attributes.CastRecovery); oMods += 1; }
                        if (w.Attributes.LowerManaCost > 0) { oDo += (110 / 8) * w.Attributes.LowerManaCost; oMods += 1; }
                        if (w.Attributes.LowerRegCost > 0) { oDo += (5 * w.Attributes.LowerRegCost); oMods += 1; }
                        if (w.Attributes.ReflectPhysical > 0) { oDo += (100 / 15) * w.Attributes.ReflectPhysical; oMods += 1; }
                        if (w.Attributes.EnhancePotions > 0) { oDo += (4 * w.Attributes.EnhancePotions); oMods += 1; }
                        if (w.Attributes.SpellChanneling > 0)
                        {
                            oDo += 100; oMods += 1;
                            if (w.Attributes.CastSpeed == 0) { oDo += 140; oMods += 1; }
                            if (w.Attributes.CastSpeed == 1) { oDo += 280; oMods += 1; }
                        }
                        else if (w.Attributes.CastSpeed > 0) { oDo += (140 * w.Attributes.CastSpeed); oMods += 1; }
                        if (w.Attributes.NightSight > 0) { oDo += 50; oMods += 1; }
 
                        if (w.ArmorAttributes.LowerStatReq > 0) { oDo += w.ArmorAttributes.LowerStatReq; oMods += 1; }
                        if (w.ArmorAttributes.MageArmor > 0) { oDo += 140; oMods += 1; }
                        if (w.ArmorAttributes.DurabilityBonus > 0) { oDo += w.ArmorAttributes.DurabilityBonus; oMods += 1; }
 
                        if (w.Quality != ArmorQuality.Exceptional)
                        {
                            if (w.PhysicalBonus > 0) { oDo += (100 / 15) * w.PhysicalBonus; oMods += 1; }
                            if (w.FireBonus > 0) { oDo += (100 / 15) * w.FireBonus; oMods += 1; }
                            if (w.ColdBonus > 0) { oDo += (100 / 15) * w.ColdBonus; oMods += 1; }
                            if (w.PoisonBonus > 0) { oDo += (100 / 15) * w.PoisonBonus; oMods += 1; }
                            if (w.EnergyBonus > 0) { oDo += (100 / 15) * w.EnergyBonus; oMods += 1; }
                        }
 
                        if (w.SkillBonuses.GetBonus(0) > 0) { oDo += (140 / 15) * w.SkillBonuses.GetBonus(0); oMods += 1; }
                        if (w.SkillBonuses.GetBonus(1) > 0) { oDo += (140 / 15) * w.SkillBonuses.GetBonus(1); oMods += 1; }
                        if (w.SkillBonuses.GetBonus(2) > 0) { oDo += (140 / 15) * w.SkillBonuses.GetBonus(2); oMods += 1; }
                        if (w.SkillBonuses.GetBonus(3) > 0) { oDo += (140 / 15) * w.SkillBonuses.GetBonus(3); oMods += 1; }
                        if (w.SkillBonuses.GetBonus(4) > 0) { oDo += (140 / 15) * w.SkillBonuses.GetBonus(4); oMods += 1; }
                        oDo = Math.Round(oDo, 1);
                        oInt += Convert.ToInt32(oDo);
                    }
 
                    if (o is BaseJewel)
                    {
                        BaseJewel w = o as BaseJewel;
 
                        if (w.Attributes.DefendChance > 0) { oDo += (130 / 15) * w.Attributes.DefendChance; oMods += 1; }
                        if (w.Attributes.AttackChance > 0) { oDo += (130 / 15) * w.Attributes.AttackChance; oMods += 1; }
                        if (w.Attributes.Luck > 0) { oDo += w.Attributes.Luck; oMods += 1; }
                        if (w.Attributes.RegenHits > 0) { oDo += (50 * w.Attributes.RegenHits); oMods += 1; }
                        if (w.Attributes.RegenStam > 0) { oDo += (33.33 * w.Attributes.RegenStam); oMods += 1; }
                        if (w.Attributes.RegenMana > 0) { oDo += (50 * w.Attributes.RegenMana); oMods += 1; }
                        if (w.Attributes.BonusStr > 0) { oDo += (110 / 8) * w.Attributes.BonusStr; oMods += 1; }
                        if (w.Attributes.BonusDex > 0) { oDo += (110 / 8) * w.Attributes.BonusDex; oMods += 1; }
                        if (w.Attributes.BonusInt > 0) { oDo += (110 / 8) * w.Attributes.BonusInt; oMods += 1; }
                        if (w.Attributes.BonusHits > 0) { oDo += 22 * w.Attributes.BonusHits; oMods += 1; }
                        if (w.Attributes.BonusStam > 0) { oDo += (100 / 8) * w.Attributes.BonusStam; oMods += 1; }
                        if (w.Attributes.BonusMana > 0) { oDo += (110 / 8) * w.Attributes.BonusMana; oMods += 1; }
                        if (w.Attributes.WeaponDamage > 0) { oDo += (2 * w.Attributes.WeaponDamage); oMods += 1; }
                        if (w.Attributes.WeaponSpeed > 0) { oDo += (110 / 30) * w.Attributes.WeaponSpeed; oMods += 1; }
                        if (w.Attributes.SpellDamage > 0) { oDo += (100 / 12) * w.Attributes.SpellDamage; oMods += 1; }
                        if (w.Attributes.CastRecovery > 0) { oDo += (40 * w.Attributes.CastRecovery); oMods += 1; }
                        if (w.Attributes.LowerManaCost > 0) { oDo += (110 / 8) * w.Attributes.LowerManaCost; oMods += 1; }
                        if (w.Attributes.LowerRegCost > 0) { oDo += (5 * w.Attributes.LowerRegCost); oMods += 1; }
                        if (w.Attributes.ReflectPhysical > 0) { oDo += (100 / 15) * w.Attributes.ReflectPhysical; oMods += 1; }
                        if (w.Attributes.EnhancePotions > 0) { oDo += (4 * w.Attributes.EnhancePotions); oMods += 1; }
                        if (w.Attributes.SpellChanneling > 0)
                        {
                            oDo += 100; oMods += 1;
                            if (w.Attributes.CastSpeed == 0) { oDo += 140; oMods += 1; }
                            if (w.Attributes.CastSpeed == 1) { oDo += 280; oMods += 1; }
                        }
                        else if (w.Attributes.CastSpeed > 0) { oDo += (140 * w.Attributes.CastSpeed); oMods += 1; }
                        if (w.Attributes.NightSight > 0) { oDo += 50; oMods += 1; }
 
                        if (w.Resistances.Physical > 0) { oDo += (100 / 15) * w.Resistances.Physical; oMods += 1; }
                        if (w.Resistances.Fire > 0) { oDo += (100 / 15) * w.Resistances.Fire; oMods += 1; }
                        if (w.Resistances.Cold > 0) { oDo += (100 / 15) * w.Resistances.Cold; oMods += 1; }
                        if (w.Resistances.Poison > 0) { oDo += (100 / 15) * w.Resistances.Poison; oMods += 1; }
                        if (w.Resistances.Energy > 0) { oDo += (100 / 15) * w.Resistances.Energy; oMods += 1; }
 
                        if (w.SkillBonuses.GetBonus(0) > 0) { oDo += (140 / 15) * w.SkillBonuses.GetBonus(0); oMods += 1; }
                        if (w.SkillBonuses.GetBonus(1) > 0) { oDo += (140 / 15) * w.SkillBonuses.GetBonus(1); oMods += 1; }
                        if (w.SkillBonuses.GetBonus(2) > 0) { oDo += (140 / 15) * w.SkillBonuses.GetBonus(2); oMods += 1; }
                        if (w.SkillBonuses.GetBonus(3) > 0) { oDo += (140 / 15) * w.SkillBonuses.GetBonus(3); oMods += 1; }
                        if (w.SkillBonuses.GetBonus(4) > 0) { oDo += (140 / 15) * w.SkillBonuses.GetBonus(4); oMods += 1; }
                        oDo = Math.Round(oDo, 1);
                        oInt += Convert.ToInt32(oDo);
                    }
                    if (o is BaseHat)
                    {
                        BaseHat w = o as BaseHat;
 
                        if (w.Attributes.DefendChance > 0) { oDo += (130 / 15) * w.Attributes.DefendChance; oMods += 1; }
                        if (w.Attributes.AttackChance > 0) { oDo += (130 / 15) * w.Attributes.AttackChance; oMods += 1; }
                        if (w.Attributes.Luck > 0) { oDo += w.Attributes.Luck; oMods += 1; }
                        if (w.Attributes.RegenHits > 0) { oDo += (50 * w.Attributes.RegenHits); oMods += 1; }
                        if (w.Attributes.RegenStam > 0) { oDo += (33.33 * w.Attributes.RegenStam); oMods += 1; }
                        if (w.Attributes.RegenMana > 0) { oDo += (50 * w.Attributes.RegenMana); oMods += 1; }
                        if (w.Attributes.BonusStr > 0) { oDo += (110 / 8) * w.Attributes.BonusStr; oMods += 1; }
                        if (w.Attributes.BonusDex > 0) { oDo += (110 / 8) * w.Attributes.BonusDex; oMods += 1; }
                        if (w.Attributes.BonusInt > 0) { oDo += (110 / 8) * w.Attributes.BonusInt; oMods += 1; }
                        if (w.Attributes.BonusHits > 0) { oDo += 22 * w.Attributes.BonusHits; oMods += 1; }
                        if (w.Attributes.BonusStam > 0) { oDo += (100 / 8) * w.Attributes.BonusStam; oMods += 1; }
                        if (w.Attributes.BonusMana > 0) { oDo += (110 / 8) * w.Attributes.BonusMana; oMods += 1; }
                        if (w.Attributes.WeaponDamage > 0) { oDo += (2 * w.Attributes.WeaponDamage); oMods += 1; }
                        if (w.Attributes.WeaponSpeed > 0) { oDo += (110 / 30) * w.Attributes.WeaponSpeed; oMods += 1; }
                        if (w.Attributes.SpellDamage > 0) { oDo += (100 / 12) * w.Attributes.SpellDamage; oMods += 1; }
                        if (w.Attributes.CastRecovery > 0) { oDo += (40 * w.Attributes.CastRecovery); oMods += 1; }
                        if (w.Attributes.LowerManaCost > 0) { oDo += (110 / 8) * w.Attributes.LowerManaCost; oMods += 1; }
                        if (w.Attributes.LowerRegCost > 0) { oDo += (5 * w.Attributes.LowerRegCost); oMods += 1; }
                        if (w.Attributes.ReflectPhysical > 0) { oDo += (100 / 15) * w.Attributes.ReflectPhysical; oMods += 1; }
                        if (w.Attributes.EnhancePotions > 0) { oDo += (4 * w.Attributes.EnhancePotions); oMods += 1; }
                        if (w.Attributes.SpellChanneling > 0)
                        {
                            oDo += 100; oMods += 1;
                            if (w.Attributes.CastSpeed == 0) { oDo += 140; oMods += 1; }
                            if (w.Attributes.CastSpeed == 1) { oDo += 280; oMods += 1; }
                        }
                        else if (w.Attributes.CastSpeed > 0) { oDo += (140 * w.Attributes.CastSpeed); oMods += 1; }
                        if (w.Attributes.NightSight > 0) { oDo += 50; oMods += 1; }
 
 
                            if (w.Resistances.Physical > 0) { oDo += (100 / 15) * w.Resistances.Physical; oMods += 1; }
                            if (w.Resistances.Fire > 0) { oDo += (100 / 15) * w.Resistances.Fire; oMods += 1; }
                            if (w.Resistances.Cold > 0) { oDo += (100 / 15) * w.Resistances.Cold; oMods += 1; }
                            if (w.Resistances.Poison > 0) { oDo += (100 / 15) * w.Resistances.Poison; oMods += 1; }
                            if (w.Resistances.Energy > 0) { oDo += (100 / 15) * w.Resistances.Energy; oMods += 1; }
 
                        if (w.SkillBonuses.GetBonus(0) > 0) { oDo += (140 / 15) * w.SkillBonuses.GetBonus(0); oMods += 1; }
                        if (w.SkillBonuses.GetBonus(1) > 0) { oDo += (140 / 15) * w.SkillBonuses.GetBonus(1); oMods += 1; }
                        if (w.SkillBonuses.GetBonus(2) > 0) { oDo += (140 / 15) * w.SkillBonuses.GetBonus(2); oMods += 1; }
                        if (w.SkillBonuses.GetBonus(3) > 0) { oDo += (140 / 15) * w.SkillBonuses.GetBonus(3); oMods += 1; }
                        if (w.SkillBonuses.GetBonus(4) > 0) { oDo += (140 / 15) * w.SkillBonuses.GetBonus(4); oMods += 1; }
                        oDo = Math.Round(oDo, 1);
                        oInt += Convert.ToInt32(oDo);
                    }
 
                    if (oInt > 0 && oInt <= 200)
                    {
                        from.LocalOverheadMessage(MessageType.Regular, 2499, true, "You conclude that item will magically unravel into: Magical Residue");
                        if (from.Skills[SkillName.Imbuing].Base >= 100.0)
                            from.LocalOverheadMessage(MessageType.Regular, 2499, true, String.Format("Item Intensity: {0}", oInt));
               
                        m_IDItem.Charges--;
                    }
                    else if (oInt > 200 && oInt < 480)
                    {
                        if (from.Skills[SkillName.Imbuing].Base >= 45.0)
                        {
                            from.LocalOverheadMessage(MessageType.Regular, 2499, true, "You conclude that item will magically unravel into: Enchanted Essence");
                            if (from.Skills[SkillName.Imbuing].Base >= 100.0)
                                from.LocalOverheadMessage(MessageType.Regular, 2499, true, String.Format("Item Intensity: {0}", oInt));
                   
                            m_IDItem.Charges--;
                        }
                        else
                        {
                            from.LocalOverheadMessage(MessageType.Regular, 2499, true, "Your Imbuing skill is not high enough to identify the imbuing ingredient.");
                        }
                    }
                    else if (oInt >= 480)
                    {
                        if (from.Skills[SkillName.Imbuing].Base >= 95.0)
                        {
                            from.LocalOverheadMessage(MessageType.Regular, 2499, true, "You conclude that item will magically unravel into: Relic Fragment");
                            if (from.Skills[SkillName.Imbuing].Base >= 100.0)
                                from.LocalOverheadMessage(MessageType.Regular, 2499, true, String.Format("Item Intensity: {0}", oInt));
                   
                            m_IDItem.Charges--;
                        }
                        else
                        {
                            from.LocalOverheadMessage(MessageType.Regular, 2499, true, "Your Imbuing skill is not high enough to identify the imbuing ingredient.");
                        }
                    }
                    else
                    {
                        from.LocalOverheadMessage(MessageType.Regular, 2499, true, "You conclude that item cannot be magically unraveled. It appears to possess little to no magic.");
                    }
                }
                else if (o is Mobile)
                {
                    ((Mobile)o).OnSingleClick(from);
                }
                else
                {
                    from.LocalOverheadMessage(MessageType.Regular, 2499, true, "You conclude that item cannot be magically unraveled.");
                }
            }
        }
    }
}
 

Attachments

  • IDItem.cs
    24.2 KB · Views: 10

rondelin

Sorceror
RunUO - [www.runuo.com] Version 2.2, Build 4543.30170
Core: Running on .NET Framework Version 2.0.50727
Core: Optimizing for 2 64-bit processors
Scripts: Compiling C# scripts...failed (1 errors, 26 warnings)
Errors:
+ Expansions/Stygian Abyss/SFImbuing/IDItem.cs:
CS0103: Line 111: The name 'm_IDItem' does not exist in the current context
CS0103: Line 120: The name 'm_IDItem' does not exist in the current context
CS0103: Line 120: The name 'm_IDItem' does not exist in the current context
CS0103: Line 128: The name 'm_IDItem' does not exist in the current context
CS0103: Line 128: The name 'm_IDItem' does not exist in the current context
CS0103: Line 128: The name 'm_IDItem' does not exist in the current context
CS0103: Line 128: The name 'm_IDItem' does not exist in the current context
CS0103: Line 138: The name 'm_IDItem' does not exist in the current context
CS0103: Line 386: The name 'MessageType' does not exist in the current conte
xt
CS0103: Line 388: The name 'MessageType' does not exist in the current conte
xt
CS0103: Line 390: The name 'm_IDItem' does not exist in the current context
CS0103: Line 396: The name 'MessageType' does not exist in the current conte
xt
CS0103: Line 398: The name 'MessageType' does not exist in the current conte
xt
CS0103: Line 400: The name 'm_IDItem' does not exist in the current context
CS0103: Line 404: The name 'MessageType' does not exist in the current conte
xt
CS0103: Line 411: The name 'MessageType' does not exist in the current conte
xt
CS0103: Line 413: The name 'MessageType' does not exist in the current conte
xt
CS0103: Line 415: The name 'm_IDItem' does not exist in the current context
CS0103: Line 419: The name 'MessageType' does not exist in the current conte
xt
CS0103: Line 424: The name 'MessageType' does not exist in the current conte
xt
CS0103: Line 433: The name 'MessageType' does not exist in the current conte
xt
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.

All I change was made base GnarledStaff since I didn't want to mess with BaseWand

Thankyou, this does look good just some tweakin needed.
 

Attachments

  • IDItem.cs
    24.3 KB · Views: 8

Iraq-

Sorceror
Err sorry it was late last night when I wrote it.. change
Code:
private IDItem iditem;
in the InternalTarget to
Code:
private IDItem m_IDItem;

* I modified my initial post to contain the correct file/code
 

rondelin

Sorceror
This works but you cant equip and use it must be in the pack. I wanna make it so you must equip to use only, but this is great thanx for your help. Appreciate your work.
 

Iraq-

Sorceror
This works but you cant equip and use it must be in the pack. How can I make it so you must equip to use only.

Sorry, I guess I misunderstood what you meant when you said
... [equipable item] ... on D-click not equip....

This code is where it's currently checking for backpack and/or on the player:
Code:
if (!IsChildOf(from.Backpack) && ( RootParent != null && (Mobile)RootParent != from ) )
            {
                from.SendMessage("This item must be equipped or in your pack before you are able to use it");
            }

the
Code:
!IsChildOf(from.Backpack)
means thjat the object is not a child of (within) the clicker's main backpack (Mobiles have a .Backpack property to represent their main backpack).

the
Code:
( RootParent != null && (Mobile)RootParent != from )
is the condition that says "is the object's RootParent (sort of the opposite of IsChildOf) the Mobile named "from" (aka the clicker)". An Item's RootParent is a Mobile when the object is either on the player, or within it's Backpack, or within it's Bankbox (Bankbox is actually just another layer of a Mobile... for more information on what constitutes "on a Mobile" type [viewequip and click a Mobile in-game).

The combination of these two conditions make it so that the object must either be equipped or within the players backpack in order to use the item.

If what you are wanting is that the IDItem can only be used when equipped, then I'll tell you that all Mobiles have a property called Weapon which is linked to their currently held weapon.

You can do:
Code:
if( from.Weapon == null || from.Weapon.Deleted || from.Weapon != m_IDItem )    // note that m_IDItem is for use within the InternalTarget private class, when called from the OnDoubleClick method you would use "this" to refer to the current class (the object of type IDItem that the Mobile "from" is clicking)
{
    from.SendMessage( "You must equip the staff in order to use it." );
    return;
}
 

rondelin

Sorceror
Here is the IdItem slightly modified, if anyone wants to use it 'Originally posted by Sham Bam Pow'. Used a Runed Switch as the graphic and must be in your pack to use it; comes with 50 charges. All messages reflect its use.
Thanx again for the script... awesome!
 

Attachments

  • IDItem.cs
    24.4 KB · Views: 16

Dreamseeker

Sorceror
Thanks for updating and adding bits & bobs folks.. I'm in the middle of a crazy situation and will be back on the ball at some point soon. :D
 

Dreamseeker

Sorceror
Any chance the ingredients will be updated? I noticed that some of the required ingredients are off by quite a bit. For example:
Hit Physical Area on OSI requires a Diamond, a Blue Diamond, and Magical Residue.

Apparently it's Raptor Teeth not Blue Diamonds on the sites, they might of changed it on OSI (Thats thier problem :p).. but you are right about the Diamonds instead of Emeralds. Good catch dude
*EDIT* The other on-hit props were out on the minor gems too, must've been lazy that day :D **
I made this system as my learning C# project so some discrepancies are to be expected. Anyone got a solution to the Brittle property? I'd like to add that at some point, doesn't feel quite right without it ;(
 

Dreamseeker

Sorceror
Is it possible to edit the recipes to use two of ONE particular resource, instead of needing to use one of each type?

Huh? You mean have Diamond x2 + Diamond x2 .. yeah that's called addition, I reckon you must be winding me up :eek: I bet you study politics LOL (If not, post an example and I'll bring the solution)

The brittle property not being able to use P.O.F is only a piece of the jigsaw.. (btw Thx Iraq :D) I wanna get the Items durability to degrade over time and display the 'Brittle' title (The property name is simple and I'm stumbling onto a solution as I write this, I've been working with timers so may be able to rig up something when I get the inclination) Jewels get durability (i.e 50/50) when imbued, this is set up already in BaseJewel.cs .. just wondering if jewels take damage in combat without modding.

- Here's the updated script with the ingredient corrections.. will add it to the main zip when I finish a few more things, but not now (I'm working on adding the Smooth Sailing script that fwiffo has posted :D Wicked Awesome)
 

Attachments

  • ImbuingC.cs
    98 KB · Views: 28

Dreamseeker

Sorceror
Ahhh I see what you mean ;) My bad

ImbuingC.cs

Yeah it's not too hard, just add modify the m_B in the property resource list to ' m_B = "Emerald"; '

then add this to the resource list/identifiers ' if (m_B == "Emerald") { res_b = typeof(Emerald); } '

if you wanna change the amount needed, stick this into ' public int GetMANo(int Max, int Inc, double Mv) '

just after ' double mno = 0; '

if (m_B == "Emerald" || m_B == "Other Resources Etc...")
{
if (Max == 100) { mno = Mv / 10; }
if (Max == 50) { mno = 1 * (Mv / 5); }
if (Max == 40 && Inc == 5) { mno = 1 * (Mv / 4); }
if (Max == 30 && Inc == 5) { mno = 1 * (Mv / 3); }
if (Max == 20 && Inc == 1) { mno = 1 * (Mv / 2); }
if (Max == 15 && Inc == 1) { mno = 1 * (Mv / 1.5); }
if (Max == 12 && Inc == 1) { mno = Mv; }
if (Max == 10 && Inc == 1) { mno = Mv; }
if (Max == 8 && Inc == 1) { mno = Mv; }
if (Max == 5 && Inc == 1) { mno = Mv * 2; }
if (Max == 3 && Inc == 1) { mno = Mv * 3; }
if (Max == 2 && Inc == 1) { mno = Mv * 5; }
if (i_Mod == 16 || i_Mod == 22 || i_Mod == 23 || i_Mod == 40 || i_Mod == 41 || i_Mod == 49) { mno = 10; }
if (i_Mod >= 100 && i_Mod <= 126) { mno = 10; }
}
else
{
put the original lines in brackets but leave the next bit outside at the end
}
if (mno < 0) { mno = 0; }
mno = Math.Round(mno);
int oInt = Convert.ToInt32(mno);
return oInt;

And that should be it, any problems inbox me and I'll have another look :cool:
 
Top