Hello all

I have a pre-aos server and would like to add runic hammers that will give pre-aos attributes instead. I've seen this done elsewhere but could not locate any other threads on the matter. Does anyone know how this is done?
 
You can use the ParagonChests or TreasureChests as inspiration, they contain code to generate random ruin/vanq etc weapons/armor.

Or you can edit your BaseWeapon/BaseArmor and modify the OnCraft method, just change the lines that say
if (Core.AOS)
to
if(false)
in the OnCraft methods
and it will use the pre AOS style.
 
Well BaseArmor.cs and BaseWeapon.cs look slightly different in the OnCraft method area. I started with BaseWeapon and edited as you suggested, but that seemed to have no result.

Next I tried changing to match my own expansion (LBR) and that had limited success. It would occasionally make a slayer weapon and some of the weapons came out without their metal color, suggesting that they would have been successes if it it was displaying right, but it didn't.

BaseArmor, as I mentioned, says something slightly different so I only changed it to my own expansion, but this had absolutely no effect.

Copies of the current scripts are attached.
 

Attachments

  • BaseArmor.cs
    48.2 KB · Views: 6
  • BaseWeapon.cs
    105.9 KB · Views: 3
ah sorry your right the code for pre aos armor isnt included in the BaseArmor on craft any more.

What i said above works for baseweapon though.

You would need to modify your oncraft inside basearmor to modify the crafted item depending on resource/hammer as you see fit.
 

Attachments

  • [ServUO.com]-BaseWeapon.cs
    105.1 KB · Views: 10
The only difference I can see between the BaseWeapon.cs I posted (from runuo v2.6) and the one you posted (ServUO) seems to be the part where it adds a bonus for armslore. I see no where in your script version where it says if (Core.AOS) under OnCraft and as I mentioned before, I tried what you suggested in my version and it did not work. I don't mean to argue, so I'm sorry, but I'm just not seeing what you're seeing I guess.
 
Ok loaded that version and tried it. No joy. Crafted 30 weapons and nothing.I think I was closer with what I did because that occasionally produced slayers.
 
Heres the entire function for BaseWeapon. ive added comments so you can follow along.
Much better to understand whats going on so you can then do a similar thing your self in BaseArmor rather than just copy pasting.


Code:
public int OnCraft( int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue )
        {
	 //We get the quality of the weapon, low, normal or excep
            Quality = (WeaponQuality)quality;

	//If this item allows makers mark lets add that
            if ( makersMark )
                Crafter = from;
		// Lets mark it player constructed
            PlayerConstructed = true;
	//Get the resource used to craft this item.
            Type resourceType = typeRes;
//If the resource is blank get the resource used from the craft system
            if ( resourceType == null )
                resourceType = craftItem.Resources.GetAt( 0 ).ItemType;
//If we are using a runic hammer
            if ( tool is BaseRunicTool )
            {
	//Get a refrence to the CraftResource, using the Type we gathered above
                CraftResource thisResource = CraftResources.GetFromType( resourceType );
// If the resource type of the hammer is the same as the ore,  do this
                if ( thisResource == ((BaseRunicTool)tool).Resource )
                {
                    Resource = thisResource;

                    CraftContext context = craftSystem.GetContext( from );

                    if ( context != null && context.DoNotColor )
                        Hue = 0;
			// Apply buffs based on resource type. Valorite provides better than DC etc
                    switch ( thisResource )
                    {
                        case CraftResource.DullCopper:
                        {
                            Identified = true;
                            DurabilityLevel = WeaponDurabilityLevel.Durable;
                            AccuracyLevel = WeaponAccuracyLevel.Accurate;
                            break;
                        }
                        case CraftResource.ShadowIron:
                        {
                            Identified = true;
                            DurabilityLevel = WeaponDurabilityLevel.Durable;
                            DamageLevel = WeaponDamageLevel.Ruin;
                            break;
                        }
                        case CraftResource.Copper:
                        {
                            Identified = true;
                            DurabilityLevel = WeaponDurabilityLevel.Fortified;
                            DamageLevel = WeaponDamageLevel.Ruin;
                            AccuracyLevel = WeaponAccuracyLevel.Surpassingly;
                            break;
                        }
                        case CraftResource.Bronze:
                        {
                            Identified = true;
                            DurabilityLevel = WeaponDurabilityLevel.Fortified;
                            DamageLevel = WeaponDamageLevel.Might;
                            AccuracyLevel = WeaponAccuracyLevel.Surpassingly;
                            break;
                        }
                        case CraftResource.Gold:
                        {
                            Identified = true;
                            DurabilityLevel = WeaponDurabilityLevel.Indestructible;
                            DamageLevel = WeaponDamageLevel.Force;
                            AccuracyLevel = WeaponAccuracyLevel.Eminently;
                            break;
                        }
                        case CraftResource.Agapite:
                        {
                            Identified = true;
                            DurabilityLevel = WeaponDurabilityLevel.Indestructible;
                            DamageLevel = WeaponDamageLevel.Power;
                            AccuracyLevel = WeaponAccuracyLevel.Eminently;
                            break;
                        }
                        case CraftResource.Verite:
                        {
                            Identified = true;
                            DurabilityLevel = WeaponDurabilityLevel.Indestructible;
                            DamageLevel = WeaponDamageLevel.Power;
                            AccuracyLevel = WeaponAccuracyLevel.Exceedingly;
                            break;
                        }
                        case CraftResource.Valorite:
                        {
                            Identified = true;
                            DurabilityLevel = WeaponDurabilityLevel.Indestructible;
                            DamageLevel = WeaponDamageLevel.Vanq;
                            AccuracyLevel = WeaponAccuracyLevel.Supremely;
                            break;
                        }
                    }
                }
            }

            return quality;
        }
 
Ty for trying to help DarkLotus. I do understand the script. I tested it this morning (the one you attached previously) and it does not return the desired result. Are you getting different results than me?
 
The code does exactly what it says it will, your going to need to explain more indepth what you want, or write it your self if the existing system doesnt do what you want.


The above does exactly what it says, if you craft a copper sword with a copper hammer it gets
Code:
DurabilityLevel = WeaponDurabilityLevel.Fortified;
                            DamageLevel = WeaponDamageLevel.Ruin;
                            AccuracyLevel = WeaponAccuracyLevel.Surpassingly;
those props set on it.
 
I have done this on my shard and it works great. I am running a modified RunUO 2.4 so your mileage may vary, but this is my code of the OnCraft method at the end of BaseWeapon.cs.

Code:
 #region ICraftable Members

 public int OnCraft( int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue )
 {
 Quality = (WeaponQuality)quality;

 if ( makersMark )
 Crafter = from;

 PlayerConstructed = true;

 Type resourceType = typeRes;

 if ( resourceType == null )
 resourceType = craftItem.Resources.GetAt( 0 ).ItemType;

// if ( Core.AOS )
 {
 Resource = CraftResources.GetFromType( resourceType );

 CraftContext context = craftSystem.GetContext( from );

 if ( context != null && context.DoNotColor )
 Hue = 0;

 if ( tool is BaseRunicTool )
 ((BaseRunicTool)tool).ApplyAttributesTo( this );

 if ( Quality == WeaponQuality.Exceptional )
 {
 if ( Attributes.WeaponDamage > 35 )
 Attributes.WeaponDamage -= 20;
 else
 Attributes.WeaponDamage = 15;

 if( Core.ML )
 {
 Attributes.WeaponDamage += (int)(from.Skills.ArmsLore.Value / 20);

 if ( Attributes.WeaponDamage > 50 )
 Attributes.WeaponDamage = 50;

 from.CheckSkill( SkillName.ArmsLore, 0, 100 );
 }
 }
 }

 if ( tool is BaseRunicTool )
 {
 CraftResource thisResource = CraftResources.GetFromType( resourceType );

 if ( thisResource == ((BaseRunicTool)tool).Resource && ( Quality == WeaponQuality.Exceptional ) ) 
 {
 Resource = thisResource;

 CraftContext context = craftSystem.GetContext( from );

 if ( context != null && context.DoNotColor )
 Hue = 0;

 switch ( thisResource )
 {
 case CraftResource.DullCopper:
 {
 Identified = true;
 DurabilityLevel = WeaponDurabilityLevel.Durable;
 AccuracyLevel = WeaponAccuracyLevel.Accurate;
 break;
 }
 case CraftResource.ShadowIron:
 {
 Identified = true;
 DurabilityLevel = WeaponDurabilityLevel.Durable;
 DamageLevel = WeaponDamageLevel.Ruin;
 break;
 }
 case CraftResource.Copper:
 {
 Identified = true;
 DurabilityLevel = WeaponDurabilityLevel.Fortified;
 DamageLevel = WeaponDamageLevel.Ruin;
 AccuracyLevel = WeaponAccuracyLevel.Surpassingly;
 break;
 }
 case CraftResource.Bronze:
 {
 Identified = true;
 DurabilityLevel = WeaponDurabilityLevel.Fortified;
 DamageLevel = WeaponDamageLevel.Might;
 AccuracyLevel = WeaponAccuracyLevel.Surpassingly;
 break;
 }
 case CraftResource.Gold:
 {
 Identified = true;
 DurabilityLevel = WeaponDurabilityLevel.Indestructible;
 DamageLevel = WeaponDamageLevel.Force;
 AccuracyLevel = WeaponAccuracyLevel.Eminently;
 break;
 }
 case CraftResource.Agapite:
 {
 Identified = true;
 DurabilityLevel = WeaponDurabilityLevel.Indestructible;
 DamageLevel = WeaponDamageLevel.Power;
 AccuracyLevel = WeaponAccuracyLevel.Eminently;
 break;
 }
 case CraftResource.Verite:
 {
 Identified = true;
 DurabilityLevel = WeaponDurabilityLevel.Indestructible;
 DamageLevel = WeaponDamageLevel.Power;
 AccuracyLevel = WeaponAccuracyLevel.Exceedingly;
 break;
 }
 case CraftResource.Valorite:
 {
 Identified = true;
 DurabilityLevel = WeaponDurabilityLevel.Indestructible;
 DamageLevel = WeaponDamageLevel.Vanq;
 AccuracyLevel = WeaponAccuracyLevel.Supremely;
 break;
 }
 case CraftResource.Heartwood:
 {
 Identified = true;
 DurabilityLevel = WeaponDurabilityLevel.Indestructible;
 DamageLevel = WeaponDamageLevel.Vanq;
 AccuracyLevel = WeaponAccuracyLevel.Supremely;
 break;
 }
 case CraftResource.Bloodwood:
 {
 Identified = true;
 DurabilityLevel = WeaponDurabilityLevel.Indestructible;
 DamageLevel = WeaponDamageLevel.Vanq;
 AccuracyLevel = WeaponAccuracyLevel.Supremely;
 break;
 }
 case CraftResource.Frostwood:
 {
 Identified = true;
 DurabilityLevel = WeaponDurabilityLevel.Indestructible;
 DamageLevel = WeaponDamageLevel.Vanq;
 AccuracyLevel = WeaponAccuracyLevel.Supremely;
 break;
 }
 }
 }
 }

 return quality;
 }

 #endregion
[doublepost=1481202732][/doublepost]And this is the same from the end of my BaseArmor.cs

Code:
 #region ICraftable Members

 public int OnCraft( int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue )
 {
 Quality = (ArmorQuality)quality;

 if ( makersMark )
 Crafter = from;

 Type resourceType = typeRes;

 if ( resourceType == null )
 resourceType = craftItem.Resources.GetAt( 0 ).ItemType;

 Resource = CraftResources.GetFromType( resourceType );
 PlayerConstructed = true;

 CraftContext context = craftSystem.GetContext( from );

 if ( context != null && context.DoNotColor )
 Hue = 0;

 if( Quality == ArmorQuality.Exceptional )
 {
 if ( !( Core.ML && this is BaseShield )) // Guessed Core.ML removed exceptional resist bonuses from crafted shields
 DistributeBonuses( (tool is BaseRunicTool ? 6 : Core.SE ? 15 : 14) ); // Not sure since when, but right now 15 points are added, not 14.

 if( Core.ML && !(this is BaseShield) )
 {
 int bonus = (int)(from.Skills.ArmsLore.Value / 20);

 for( int i = 0; i < bonus; i++ )
 {
 switch( Utility.Random( 5 ) )
 {
 case 0: m_PhysicalBonus++; break;
 case 1: m_FireBonus++; break;
 case 2: m_ColdBonus++; break;
 case 3: m_EnergyBonus++; break;
 case 4: m_PoisonBonus++; break;
 }
 }

 from.CheckSkill( SkillName.ArmsLore, 0, 100 );
 }
 }
// David: Turn on runic tool armorcrafting and give the metals their properties.
// if ( Core.AOS && tool is BaseRunicTool )
 if ( tool is BaseRunicTool )
 {
 ((BaseRunicTool)tool).ApplyAttributesTo( this );
 
 CraftResource thisResource = CraftResources.GetFromType( resourceType );
 
 Resource = thisResource;

 if ( Quality == ArmorQuality.Exceptional && (thisResource == ((BaseRunicTool)tool).Resource ) )
 {

 switch ( thisResource )
 {
 case CraftResource.DullCopper:
 {
 Identified = true;
 m_Durability = ArmorDurabilityLevel.Durable;
 ProtectionLevel = ArmorProtectionLevel.Hardening;
 break;
 }
 case CraftResource.ShadowIron:
 {
 Identified = true;
 m_Durability = ArmorDurabilityLevel.Massive;
 ProtectionLevel = ArmorProtectionLevel.Hardening;
 break;
 }
 case CraftResource.Copper:
 {
 Identified = true;
 m_Durability = ArmorDurabilityLevel.Massive;
 ProtectionLevel = ArmorProtectionLevel.Hardening;
 break;
 }
 case CraftResource.Bronze:
 {
 Identified = true;
 m_Durability = ArmorDurabilityLevel.Fortified;
 ProtectionLevel = ArmorProtectionLevel.Fortification;
 break;
 }
 case CraftResource.Gold:
 {
 Identified = true;
 m_Durability = ArmorDurabilityLevel.Fortified;
 ProtectionLevel = ArmorProtectionLevel.Fortification;
 break;
 }
 case CraftResource.Agapite:
 {
 Identified = true;
 m_Durability = ArmorDurabilityLevel.Indestructible;
 ProtectionLevel = ArmorProtectionLevel.Fortification;
 break;
 }
 case CraftResource.Verite:
 {
 Identified = true;
 m_Durability = ArmorDurabilityLevel.Indestructible;
 ProtectionLevel = ArmorProtectionLevel.Invulnerability;
 break;
 }
 case CraftResource.Valorite:
 {
 Identified = true;
 m_Durability = ArmorDurabilityLevel.Indestructible;
 ProtectionLevel = ArmorProtectionLevel.Invulnerability;
 break;
 }
 case CraftResource.SpinedLeather:
 {
 Identified = true;
 m_Durability = ArmorDurabilityLevel.Indestructible;
 ProtectionLevel = ArmorProtectionLevel.Invulnerability;
 break;
 }
 case CraftResource.HornedLeather:
 {
 Identified = true;
 m_Durability = ArmorDurabilityLevel.Indestructible;
 ProtectionLevel = ArmorProtectionLevel.Invulnerability;
 break;
 }
 case CraftResource.BarbedLeather:
 {
 Identified = true;
 m_Durability = ArmorDurabilityLevel.Indestructible;
 ProtectionLevel = ArmorProtectionLevel.Invulnerability;
 break;
 }
 }
 
 }

 }

 return quality;

 }

 #endregion
 
So i've added and tweaked some things to get runic sewing kits to craft runic armor enums and i get this error

error.png
 

Attachments

  • BaseArmor.cs
    121.8 KB · Views: 0
This may be a stupid question. But in Pre-AOS the modifiers would never show until you identified the item. Are you setting Identified = true; on the item the Runic creates/enhances? I am not sure if ServUO has this restriction, but RunUO did.
 
I could be wrong but will these attributes even work in Renaissance naturally? I think you would have to go into the scripts for all this stuff and remove the era checks for it to show up and work properly. Hopefully, someone older can confirm this but I believe it all has era checks in the files.
 
So weapons will give attributes but armor still doesn't seem to give the attributes. If im remembering right the runic sewing kits would put armor durability and protection levels on crafted leather armor. Maybe you can take a look ( this is the base file no modifications )
 

Attachments

  • BaseArmor.cs
    122.5 KB · Views: 3
Like I said; you need to remove the checks for Core.AOS in the references to BaseRunicTool which are preventing the attributes from being given.

That's line 3142 in your code.

Also just under that is a check for Core.ML which I think is adding the resource attributes which make things like Barbed Leather better than ordinary leather
 
Back