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!

Rune Crafting & Enchanting system

svnstrms

Sorceror
This looks like the same issue I was having when I tried to run this for the first time on RunUO 2.1. SpookyRobert helped me out with it you can scroll up to view the replies I got. Also I posted my updated files which worked for my server.
 
yea i seen it after i posted thank it did help was something i missed a bit tired today been workin on addin things past few days without luck havin to reinstall a few times this was the first one i got to work so far other then the runuo server been tryin to get new mounts an stuff to work still no luck with that yet im sure in time ill get it
 

JerrodWofford

Sorceror
So yeah i realize this is a dead post, buuut in case you or somone else is to see this, can we also add the ability to put slayer enchants to weapons as well.. like orc slaying or dragon slaying, but with a maximum of one of these enchantment types per weapon?
 

JerrodWofford

Sorceror
here is what i have tried so far .. if anyone wants to point me in the right direction let me know. :D Just trying to make a rune that adds LizardSlaying to a weapon just like it would add fireball in this crafting system in this post.

Code:
using System;
using System.Collections;
using System.Collections.Generic;
using Server.Multis;
using Server.Mobiles;
using Server.Network;
using Server.ContextMenus;
using Server.Spells;
using Server.Targeting;
using Server.Misc;

namespace Server.Items
{
    public class LizardSlayingRune : Item
    {
        [Constructable]
        public LizardSlayingRune() : base( 0x1F14 )
        {
            Weight = 0.2;  // ?
            Name = "Lizard Slaying Rune";
            Hue = 1001;
        }

        public override void OnDoubleClick( Mobile from )
        {
            double minSkill = 70.0;

            PlayerMobile pm = from as PlayerMobile;

            if ( !IsChildOf( from.Backpack ) )
            {
                from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
            }

            else if ( pm == null || from.Skills[SkillName.Inscribe].Base < 70.0 )
            {
                from.SendMessage( "You are not skilled enough to attempt this enhancement." );
            }

                else if( from.InRange( this.GetWorldLocation(), 1 ) )
                {
                double maxSkill = minSkill + 40.0;

                if ( !from.CheckSkill( SkillName.Inscribe, minSkill, maxSkill ) )
                {
                    from.SendMessage( "The rune shatters, releasing the magic energy." );
                    from.PlaySound( 65 );
                    from.PlaySound( 0x1F8 );
                    Delete();
                    return;
                }
                else
                {
                    from.SendMessage( "Select the item to enhance." );
                    from.Target = new InternalTarget( this );
                }
                }

                else
                {
                    from.SendLocalizedMessage( 500446 ); // That is too far away.
                }
        }

        private class InternalTarget : Target
        {
            private LizardSlayingRune m_LizardSlayingRune;

            public InternalTarget( LizardSlayingRune runeaug ) : base( 1, false, TargetFlags.None )
            {
                m_LizardSlayingRune = runeaug;
            }

            protected override void OnTarget( Mobile from, object targeted )
            {
                int scalar;
                double mageSkill = from.Skills[SkillName.Inscribe].Value;

                if ( mageSkill >= 100.0 )
                    scalar = 3;
                else if ( mageSkill >= 90.0 )
                    scalar = 2;
                else
                    scalar = 1;

                    if ( targeted is BaseWeapon )
                {
                          BaseWeapon Weapon = targeted as BaseWeapon;

                    if ( !from.InRange( ((Item)targeted).GetWorldLocation(), 1 ) )
                    {
                              from.SendLocalizedMessage( 500446 ); // That is too far away.
                          }

                    else if (( ((Item)targeted).Parent != null ) && ( ((Item)targeted).Parent is Mobile

) )
                          {
                              from.SendMessage( "You cannot enhance that in it's current location." );
                          }

                    else
                          {
                        int DestroyChance = Utility.Random( 5 );

                        if ( DestroyChance > 0 ) // Success
                        {
                            int augment = ( ( Utility.Random( 3 ) ) * scalar ) + 1;
                            int augmentper = ( ( Utility.Random( 5 ) ) * scalar ) + 5;

                            Weapon.WeaponAttributes.Slayer = SlayerName.Lizardslaying; +=

augmentper; from.SendMessage( "The Lizard Slaying Rune enhances your weapon." );

                                      from.PlaySound( 0x1F5 );
                                      m_LizardSlayingRune.Delete();
                              }

                        else // Fail
                        {
                              from.SendMessage( "You have failed to enhance the weapon!" );
                            from.SendMessage( "The weapon is damaged beyond repair!" );
                            from.PlaySound( 42 );
                              Weapon.Delete();
                            m_LizardSlayingRune.Delete();
                          }
                    }
                }
 
                    //else
                    //{
                          from.SendMessage( "You cannot enhance that." );
                    }
              }

        }

        public override bool DisplayLootType{ get{ return false; } }  // ha ha!

        public LizardSlayingRune( Serial serial ) : base( serial )
        {
        }

        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );

            writer.Write( (int) 0 ); // version
        }

        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();
        }
        public override void AddNameProperty( ObjectPropertyList list )
        {
            base.AddNameProperty(list);
            list.Add( "Slayer = SlayerName.Lizardslaying" );
        }
    }
}

And here are the errors i get when i try to load it up...

Code:
RunUO - [www.runuo.com] Version 2.0, Build 2959.20979
Core: Running on .NET Framework Version 2.0.50727
Core: Optimizing for 6 64-bit processors
Scripts: Compiling C# scripts...failed (1 errors, 0 warnings)
Errors:
+ Custom/Rune Crafting/Runes/LizardSlayingRune.cs:
    CS1518: Line 135: Expected class, delegate, enum, interface, or struct
    CS1518: Line 137: Expected class, delegate, enum, interface, or struct
    CS1518: Line 141: Expected class, delegate, enum, interface, or struct
    CS1518: Line 148: Expected class, delegate, enum, interface, or struct
    CS1518: Line 154: Expected class, delegate, enum, interface, or struct
    CS1022: Line 160: Type or namespace definition, or end-of-file expected
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.

thanks for your time and effort in advance.
 

Pakko

Traveler
This is great system hands down, though \\\Beware/// there is a bad exploit that can be fixed, all i know is that i found it! If you have a rune and put item on ground in your house and login with all ya characters then you can each click the rune and then use it that amount of times :) ive seen 1 rune used 9 times! by otgher players comming to these events and helping out by clicking and adding properties to theitems aswell.
 

Ely666

Sorceror
Pakko, the bug you mentiond isent all bad as it brings players together to work as a team. I played on a shard with a modified version of this system that required the imbu skill, 3-4 ppl with 3 accts on 115-120 imbuers, with hours of fun as we tried to create better pieces gor ourselves and the rest of guild. Also the joy of pushing the number of mods close to the higher breacking point was great fum when they succeeded. Then the shard I played changed the imbu system to a clone of the osi one and I realy missed the imbu nights.
 

Eleazar-uo

Traveler
Errors:
+ Engines / Harvest / Mining.cs:
CS1513: Line 123: Expected}
CS1002: Line 123: Expected;
CS1002: Line 124: Expected;
CS1514: Line 125: Expected {
 
Top