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!

FULL Diablo 2 Style Socket System =)

LordHogFred

Knight
FULL Diablo 2 Style Socket System =)

Just for the record I am no longer supporting this system any more.

Summary:
This is a full Dibalo II style socket system for RunUO v1.0

EDIT: Updated the Loot.cs in the Loot Packs zip file to contain a Loot.cs compatible with RUO 1.0, also removed some custom items in it. I will upgrade the entire system to RunUO 1.0 when I have the time as I have my exams coming up soon and don't have much spare time on my hands, but it will be done :p

EDIT: Added the missing Loot.cs required to use the LootPack.cs and also updated the 'How To' text file to show how to edit the lootpacks if you have a custom one. Also removed the code sown pasted into BaseCreature.cs because with the Loot Packs it is now useless. Sorry :eek: :p

NEW: Updated system to support the crafting of the socketed items. All socket items require between 95 and 135 skill and all require 5x the amount of resources. I personally think this is a better way than adding the weapons and armour, etc into the LootPack.
Enjoy!

NEW: Lootpacks have finally been added, you can remove the gems from your basecreature.cs now. However I am still working on adding the socketed weapons so leave the weapons, armour and shields in your basecreature.cs for the moment. Download the altered lootpack.cs and just replace your old one, additions are clearly marked if oyu are using your own lootpack.

Enjoy :)

Is as close to D2 socket system as possible.

Description:
Ok, I have been working non-stop for the past two days on this (I'm pretty new to scripting but I'm quite impressed with myself :p)

It is a FULL Diablo II style socket system for use with RUO 1.0 it includes:

* Every type of gem: Amethyst, Sapphire, Emerald, Ruby, Topaz, Diamond and Skull.

* Different types of each gem: Chipped, Flawed, Plain, Flawless and Perfect.

* Each gem and skull gives attributes as close to D2 as possible.

* The enhancement results are different depending on whether you have added the gem or skull to a weapon, shield or piece of armor.

* When you enhance an item with a gem or skull it gives the enhanced item a hue close to that gem.

Everything is here, the only thing I haven't added are the different runes yet, I am working on them as I type this :D

The one thing that I think may need changing slightly is the drop rate of the gems and socketed items and also the chance of getting 1, 2 and 3 sockets on an item. If you change it and find that it works well then please say, also if you want to know how to change those variables say and I will tell you how :)

Anyway I hope you all enjoy this system,
Happy socketing :)


PS. I would like to point out that the original Weapon Socket system was NOT mine, however I took it upon myself to expand it and turn it into the full socket system. The amount of work I have put into this system is huge and I take full credit for all my work HOWEVER I also give the original author of the Weapon Socket system credit becuase without him/her I would have had no basis to work from. If you know how they are then please tell me and I will add their name here,

Thanks :)

EDIT: The original author was Xeus and I thank him making such a system to allow me to make what I have done. Thanks :D




Installation:
Follow the How To.txt included.

If needed I will upload the altered files.
 

Attachments

  • FULL D2 Socket System - Zip 2.zip
    91.5 KB · Views: 2,482
  • FULL D2 Socket System - Zip 1.zip
    63.7 KB · Views: 2,151
  • Socket Craft.zip
    7.4 KB · Views: 1,221
  • How To.txt
    12.6 KB · Views: 1,439
  • Loot Packs.zip
    11 KB · Views: 609
Hah there it be. I've got an early version of this somewhere that someone had submitted... but this will do me just fine.

Good job next time work faster :p (just kindding of course hehe)
 

LordHogFred

Knight
hehe :p

I wasn't aware that a full system had been done before, thats why I did this :p

Oh well, doesn't look to me like it's on the forums now so here it is :)
 
Nono I do believe we probably worked off the same original. Only I never got around to doing all that much with it after I... euh... decided to unfreeze and wipe skara brae just because it was ugly.

Now time to make a test server just for this script :p

Oh Ps unless I missed it you might as well want to add a changed version of the distro files you need to change. It makes it easier for people to throw up a test server and see what your script does.

Saves complaints too if you can say: 'runs as is'
 
System test completed:

Test statistics:

Server: Runuo 1.0 RC0 server

Installation: Easy


Installation was painless, follow all the instructions they are clear and save a few obvious typos without mistakes.

Tested the system with various weapons and enhancements (not a full system test)

System is 'slightly' powerful for regular OSI shards.

A good addition would be a short description of how to change power and drop rates of the enhancements as well as enhancement fail rate.


Excellent script otherwise.
 

LordHogFred

Knight
Hey thanks man :D

Ok I will add how to change power and drop rates :)

To change power of the enhancements go to the "Socket Gems" folder and then go to the folder of the gem you want to change ie; Amethyst. Then select which type of Amethyst you want to change ie; ChippedAmethyst.

Then in the script you will find lines like these:

Code:
			                  Weapon.UsedSockets += 1;
			                  Weapon.Attributes.WeaponDamage += 8;
						Weapon.Hue = 316;

The line(s) in between the UsedSockets and the Hue are the ones that apply the different attributes.

If you want to change an items enhancement on Armor scroll down till you find:

Code:
			                  Armor.UsedSockets += 1;
			                  Armor.Attributes.BonusStr += 3;
						Armor.Hue = 316;

Again the lines between UsedSockets and Hue are the ones that apply the bonuses.

Shield is the same again except these are the lines needed:

Code:
			                  Shield.UsedSockets += 1;
			                  Shield.Attributes.DefendChance += 8;
						Shield.Hue = 316;


Ok I hope that helps with how to change the bonuses on a gem.


Now to change the drop rates go to BaseCreature.cs and find these lines:

Code:
		private int m_WeaponSocketRoll = Utility.Random( 50 );
		private int m_ArmorSocketRoll = Utility.Random( 50 );
		private int m_ShieldSocketRoll = Utility.Random( 50 );

Just change the 50 to a lower number to increase the drop rate or make it a higher number to decrease the drop rate.

The same goes for the Socket Gems except you use these lines:

Code:
		private int m_ChippedSocketGemRoll = Utility.Random( 20 );
		private int m_FlawedSocketGemRoll = Utility.Random( 40 );
		private int m_PlainSocketGemRoll = Utility.Random( 80 );
		private int m_FlawlessSocketGemRoll = Utility.Random( 150 );
		private int m_PerfectSocketGemRoll = Utility.Random( 200 );

DO NOT touch the other lines near these as it will probably screw everything up :p

I hope that explains everything, just say if I've missed anythin out :)
 
Well I guess this is enough reason to make a horardric cube that will transform regular gems into enhancement gems and enhancement gems into better gems.


Anyone else getting the feeling that they're standing in a desert town or that odd desire to go chipped gem hunting?
 

LordHogFred

Knight
Well I have to say I couldn't agree more. I would love to make a Horadric Cube but alas I wou;dn't know where to start. If someone could get the basic code to me (placing X items in a container to form Y item) I would be more than happy to work on one and get it sorrted. :D
 

Avangelon

Wanderer
Xeus is the original author of the socketed weapon script and he is passing on the following to both the author, and the person who wrote this script.

Originally said by Xeus
The person who originally wrote this script is me, Xeus. You can find the original script at the following URL:

<URL Deleted due to user being banned REPEATEDLY for spamming this forum with that site>

In the future please request the author's permission before modifying the script and submitting it. You can not possibly say that you do not know who the original author was because there are several documents in the same zip file as the socketed weapon script that contain author contact information.

And to those of you who downloaded his script, and would like to contribute to the original project which is balanced more toward the average UO shard, please visit the URL of the original script and contribute your ideas, weapons, and augmentations.

Thank you all for taking the time to read this, and to check my script out which this script originated from. I looked over this author's script and he did do quite a few modifications to it, and I congratulate him, however he did some things that caused the script to be completely be unbalanced; things such as making weapons have a random amount of sockets. In my script, the amount of sockets is based upon the speed of the weapon.

Xeus
 

zedar

Wanderer
i ve got a probleme

Compiling failed 2 errors :eek:

BaseShield.cs line13, colum 3 " Modifiers cannot be placed on property or event accessor declarations"
and
BaseShield.cs line13, colum 11 "a get or set accessor expected"

baseShield.cs


Code:
using System;
using System.Collections;
using Server;
using Server.Network;


namespace Server.Items
{
	public class BaseShield : BaseArmor
	{
		public override ArmorMaterialType MaterialType{ get{ return ArmorMaterialType.Plate; } 
// <Socketed Shield System> diablo 2 system
		private int m_UsedSockets, m_MaxSockets; // line 13
		private string m_SocketLabel, m_AugmentList;
		
		[CommandProperty( AccessLevel.GameMaster )]
		public string AugmentList
		{
			get{ return m_AugmentList; }
			set{ m_AugmentList = value; InvalidateProperties(); }
		}
		
		public virtual string SocketLabel{ get{ return m_SocketLabel; } set{ m_SocketLabel = value; } }
		
		[CommandProperty( AccessLevel.GameMaster )]
		public int UsedSockets
		{
			get{ return m_UsedSockets; }
			set{ m_UsedSockets = value; InvalidateProperties(); }
		}
		
		[CommandProperty( AccessLevel.GameMaster )]
		public int MaxSockets
		{
			get{ return m_MaxSockets; }
			set{ m_MaxSockets = value; InvalidateProperties(); }
		}
// </Socketed Shield System> diablo 2 system


		public BaseShield( int itemID ) : base( itemID )
		{
		}

		public BaseShield( 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 double ArmorRating
		{
			get
			{
				Mobile m = this.Parent as Mobile;
				double ar = base.ArmorRating;

				if ( m != null )
					return ( ( m.Skills[SkillName.Parry].Value * ar ) / 200.0 ) + 1.0;
				else
					return ar;
			}
		}

		public override int OnHit( BaseWeapon weapon, int damage )
		{
			Mobile owner = this.Parent as Mobile;
			if ( owner == null )
				return damage;
			
			double ar = this.ArmorRating;
			double chance = ( owner.Skills[SkillName.Parry].Value - ( ar * 2.0 ) ) / 100.0;

			if ( chance < 0.01 )
				chance = 0.01;
			/*
			FORMULA: Displayed AR = ((Parrying Skill * Base AR of Shield) ÷ 200) + 1 

			FORMULA: % Chance of Blocking = parry skill - (shieldAR * 2)

			FORMULA: Melee Damage Absorbed = (AR of Shield) / 2 | Archery Damage Absorbed = AR of Shield 
			*/
			if ( owner.CheckSkill( SkillName.Parry, chance ) )
			{
				if ( weapon.Skill == SkillName.Archery )
					damage -= (int)ar;
				else 
					damage -= (int)(ar / 2.0);

				if ( damage < 0 )
					damage = 0;

				owner.FixedEffect( 0x37B9, 10, 16 );

				if ( Utility.Random( 3 ) == 0 )
					HitPoints -= Utility.Random( 2 );
			}

			return damage;
		}
	}
}
i think that my baseShield.cs is good ...... i must look my basecreature ?
 
zedar said:
Compiling failed 2 errors :eek:

BaseShield.cs line13, colum 3 " Modifiers cannot be placed on property or event accessor declarations"
and
BaseShield.cs line13, colum 11 "a get or set accessor expected"

baseShield.cs


Code:
using System;
using System.Collections;
using Server;
using Server.Network;


namespace Server.Items
{
	public class BaseShield : BaseArmor
	{
		public override ArmorMaterialType MaterialType{ get{ return ArmorMaterialType.Plate; } 
// <Socketed Shield System> diablo 2 system
		private int m_UsedSockets, m_MaxSockets; // line 13
		private string m_SocketLabel, m_AugmentList;
		
}


Check the amount of braces you have: public override ArmorMaterialType MaterialType{ get{ return ArmorMaterialType.Plate; }

seems to be missing a brace '}' at the end of that line.

Try adding it and see if it helps, looks like you accidentally deleted the '}'.
 

flipside

Wanderer
I tried modifying the PerfectSkull.cs to enchance both weapons and shields to give spell channeling, fast cast and fast cast recovery, here my the code I used followed by errors,
Code:
		               	  int EnhanceChance = Utility.Random( 1 );
		               	  int DestroyChance = Utility.Random( 500 );
		               	  
		               	  if ( EnhanceChance == 0 ) // Success
				    {
			                  Weapon.UsedSockets += 1;
			                  Weapon.WeaponAttributes.HitLeechHits += 4;
			                  Weapon.WeaponAttributes.SpellChanneling += 1;
					  Weapon.WeaponAttributes.CastSpeed += 1;
					  Weapon.WeaponAttributes.CastRecovery += 1;
						Weapon.Hue = 1109;
			                  
			                  Weapon.AugmentList = Weapon.AugmentList + "\n" + m_Augmentation.Name;
			                  from.PlaySound( 0x2A ); // Anvil
			                  from.SendMessage( "You have successfully enhanced the weapon!" );
			                  m_Augmentation.Delete();
			          }
errors said:
Scripts: Compiling C# scripts...failed (8 errors, 0 warnings)
- Error: Scripts\Custom\Diablo 2\Sockets\Socket Gems\Amethysts\FlawedAmethyst.c
s: CS1502: (line 80, column 41) The best overloaded method match for 'Server.Uti
lity.Random(int)' has some invalid arguments
- Error: Scripts\Custom\Diablo 2\Sockets\Socket Gems\Amethysts\FlawedAmethyst.c
s: CS1503: (line 80, column 57) Argument '1': cannot convert from 'double' to 'i
nt'
- Error: Scripts\Custom\Diablo 2\Sockets\Socket Gems\Skulls\PerfectSkull.cs: CS
0117: (line 87, column 22) 'Server.AosWeaponAttributes' does not contain a defin
ition for 'SpellChanneling'
- Error: Scripts\Custom\Diablo 2\Sockets\Socket Gems\Skulls\PerfectSkull.cs: CS
0117: (line 88, column 8) 'Server.AosWeaponAttributes' does not contain a defini
tion for 'CastSpeed'
- Error: Scripts\Custom\Diablo 2\Sockets\Socket Gems\Skulls\PerfectSkull.cs: CS
0117: (line 89, column 8) 'Server.AosWeaponAttributes' does not contain a defini
tion for 'CastRecovery'
- Error: Scripts\Custom\Diablo 2\Sockets\Socket Gems\Skulls\PerfectSkull.cs: CS
0246: (line 150, column 22) The type or namespace name 'Weapon' could not be fou
nd (are you missing a using directive or an assembly reference?)
- Error: Scripts\Custom\Diablo 2\Sockets\Socket Gems\Skulls\PerfectSkull.cs: CS
0246: (line 151, column 8) The type or namespace name 'Weapon' could not be foun
d (are you missing a using directive or an assembly reference?)
- Error: Scripts\Custom\Diablo 2\Sockets\Socket Gems\Skulls\PerfectSkull.cs: CS
0246: (line 152, column 8) The type or namespace name 'Weapon' could not be foun
d (are you missing a using directive or an assembly reference?)
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.
It says it doesn't contain a definition for those three things, but if that's the case what would I use to add those features?
 

LordHogFred

Knight
Ok first problem I can see is that faster cast and spell channeling, etc are NOT weapon attributes therefore in your code you do not need
Code:
Weapon.WeaponAttribute

It just needs to be
Code:
Weapon.Attribute

Also you must make sure that you have eidted the correct part of the code for the shields and weapons. the start of weapon code begins with
Code:
if ( targeted is BaseWeapon )

and the beginning of the shield code begins with
Code:
if ( targeted is BaseShield )

also in the shield code you need to have
Code:
Shield.Attribute
not
Code:
Weapon.Attribute

I hope that this helps,

PS. Hit Leech Hits is a weaponattribute you don't need to change that :)
 
Top