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!

XmlSockets

poetawd

Wanderer
I´m sorry, this is probaly a newbie error, but is not working , i did just like u said.


Code:
		[Constructable]
		public PlateChest() : base( 0x1415 )
		{
			Weight = 10.0;
            XmlAttach.AttachTo(this, new XmlSocketable(4, SkillName.Tinkering, 100.0, typeof(IronIngot), 100));
     	}

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


:confused: :confused: :confused:
 

ArteGordon

Wanderer
poetawd said:
I´m sorry, this is probaly a newbie error, but is not working , i did just like u said.


Code:
		[Constructable]
		public PlateChest() : base( 0x1415 )
		{
			Weight = 10.0;
            XmlAttach.AttachTo(this, new XmlSocketable(4, SkillName.Tinkering, 100.0, typeof(IronIngot), 100));
     	}

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


:confused: :confused: :confused:


You did it correctly, but note that you added the 'socketable' attachment, which simply allows the item to be socketed with up to 4 sockets, where the requirement for adding each sockets is a minimum of 100 tinkering skill and the use of 100 iron ingots.

You would use a magical socketing hammer to do that, or you could allow them to use the [addsocket command.

If you just wanted to add the 4 sockets directly, use the 'xmlsockets' attachment instead. Like

Code:
XmlAttach.AttachTo(this, new XmlSockets(4));

Look at the testsocketdweapon.cs for examples of combining the XmlSockets, and XmlSocketable attachments to have items with different numbers of starting sockets and also different potential for expanding the number of sockets.
 

poetawd

Wanderer
ArteGordon said:
You did it correctly, but note that you added the 'socketable' attachment, which simply allows the item to be socketed with up to 4 sockets, where the requirement for adding each sockets is a minimum of 100 tinkering skill and the use of 100 iron ingots.

You would use a magical socketing hammer to do that, or you could allow them to use the [addsocket command.

If you just wanted to add the 4 sockets directly, use the 'xmlsockets' attachment instead. Like

Code:
XmlAttach.AttachTo(this, new XmlSockets(4));

Look at the testsocketdweapon.cs for examples of combining the XmlSockets, and XmlSocketable attachments to have items with different numbers of starting sockets and also different potential for expanding the number of sockets.


Arte,


That is EXaCTLY what I want, but I´ll require 100 of BS and 10 valorite to make a socket, I want all the plates to socketable in my shard, but the error I´m getting is in the script, RUNUO won´t load with that !!


Thanx
 

poetawd

Wanderer
poetawd said:
Arte,


That is EXaCTLY what I want, but I´ll require 100 of BS and 10 valorite to make a socket, I want all the plates to socketable in my shard, but the error I´m getting is in the script, RUNUO won´t load with that !!


Thanx


This is my plate script:

Code:
using System;
using Server.Items;

namespace Server.Items
{
	[FlipableAttribute( 0x1415, 0x1416 )]
	public class PlateChest : BaseArmor
	{
		public override int BasePhysicalResistance{ get{ return 5; } }
		public override int BaseFireResistance{ get{ return 3; } }
		public override int BaseColdResistance{ get{ return 2; } }
		public override int BasePoisonResistance{ get{ return 3; } }
		public override int BaseEnergyResistance{ get{ return 2; } }

		public override int InitMinHits{ get{ return 50; } }
		public override int InitMaxHits{ get{ return 65; } }

		public override int AosStrReq{ get{ return 95; } }
		public override int OldStrReq{ get{ return 60; } }

		public override int OldDexBonus{ get{ return -8; } }

		public override int ArmorBase{ get{ return 40; } }

		public override ArmorMaterialType MaterialType{ get{ return ArmorMaterialType.Plate; } }

		[Constructable]
		public PlateChest() : base( 0x1415 )
		{
			Weight = 10.0;z
            XmlAttach.AttachTo(this, new XmlSocketable(4, SkillName.Tinkering, 100.0, typeof(IronIngot), 100));
        }

		public PlateChest( Serial serial ) : base( serial )
		{
		}
		
		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
			writer.Write( (int) 0 );
		}
		
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();

			if ( Weight == 1.0 )
				Weight = 10.0;	
        }
	}
}
 

ArteGordon

Wanderer
poetawd said:
This is my plate script:

Code:
using System;
using Server.Items;

namespace Server.Items
{
	[FlipableAttribute( 0x1415, 0x1416 )]
	public class PlateChest : BaseArmor
	{
		public override int BasePhysicalResistance{ get{ return 5; } }
		public override int BaseFireResistance{ get{ return 3; } }
		public override int BaseColdResistance{ get{ return 2; } }
		public override int BasePoisonResistance{ get{ return 3; } }
		public override int BaseEnergyResistance{ get{ return 2; } }

		public override int InitMinHits{ get{ return 50; } }
		public override int InitMaxHits{ get{ return 65; } }

		public override int AosStrReq{ get{ return 95; } }
		public override int OldStrReq{ get{ return 60; } }

		public override int OldDexBonus{ get{ return -8; } }

		public override int ArmorBase{ get{ return 40; } }

		public override ArmorMaterialType MaterialType{ get{ return ArmorMaterialType.Plate; } }

		[Constructable]
		public PlateChest() : base( 0x1415 )
		{
			Weight = 10.0;z
            XmlAttach.AttachTo(this, new XmlSocketable(4, SkillName.Tinkering, 100.0, typeof(IronIngot), 100));
        }

		public PlateChest( Serial serial ) : base( serial )
		{
		}
		
		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
			writer.Write( (int) 0 );
		}
		
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();

			if ( Weight == 1.0 )
				Weight = 10.0;	
        }
	}
}


you just need to add a reference to the namespace that the attachment system lives in at the beginning of the script.

Code:
using System;
using Server.Items;
using Server.Engines.XmlSpawner2;

(edit)

also, if you want to make the socketing depend on BS and valorite instead of tinkering and ironingots, you will want to change those arguments to the XmlSocketable constructor.

Code:
new XmlSocketable(4, [color=red]SkillName.Tinkering[/color], 100.0, [color=red]typeof(IronIngot)[/color], 100)
 

poetawd

Wanderer
:( :( :( :( :( :( :(


Still not compiling....


Code:
using System;
using Server.Items;
using Server.Engines.XmlSpawner2;

namespace Server.Items
{
	[FlipableAttribute( 0x1415, 0x1416 )]
	public class PlateChest : BaseArmor
	{
		public override int BasePhysicalResistance{ get{ return 5; } }
		public override int BaseFireResistance{ get{ return 3; } }
		public override int BaseColdResistance{ get{ return 2; } }
		public override int BasePoisonResistance{ get{ return 3; } }
		public override int BaseEnergyResistance{ get{ return 2; } }

		public override int InitMinHits{ get{ return 50; } }
		public override int InitMaxHits{ get{ return 65; } }

		public override int AosStrReq{ get{ return 95; } }
		public override int OldStrReq{ get{ return 60; } }

		public override int OldDexBonus{ get{ return -8; } }

		public override int ArmorBase{ get{ return 40; } }

		public override ArmorMaterialType MaterialType{ get{ return ArmorMaterialType.Plate; } }

		[Constructable]
		public PlateChest() : base( 0x1415 )
		{
			Weight = 10.0;z
            XmlAttach.AttachTo(this, new XmlSocketable(4, SkillName.Tinkering, 100.0, typeof(IronIngot), 100));
		}

		public PlateChest( Serial serial ) : base( serial )
		{
		}
		
		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
			writer.Write( (int) 0 );
		}
		
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();

			if ( Weight == 1.0 )
				Weight = 10.0;	
        }
	}
}


What´s wrong with that,.,,, :(
 

ArteGordon

Wanderer
poetawd said:
:( :( :( :( :( :( :(


Still not compiling....


Code:
using System;
using Server.Items;
using Server.Engines.XmlSpawner2;

namespace Server.Items
{
	[FlipableAttribute( 0x1415, 0x1416 )]
	public class PlateChest : BaseArmor
	{
		public override int BasePhysicalResistance{ get{ return 5; } }
		public override int BaseFireResistance{ get{ return 3; } }
		public override int BaseColdResistance{ get{ return 2; } }
		public override int BasePoisonResistance{ get{ return 3; } }
		public override int BaseEnergyResistance{ get{ return 2; } }

		public override int InitMinHits{ get{ return 50; } }
		public override int InitMaxHits{ get{ return 65; } }

		public override int AosStrReq{ get{ return 95; } }
		public override int OldStrReq{ get{ return 60; } }

		public override int OldDexBonus{ get{ return -8; } }

		public override int ArmorBase{ get{ return 40; } }

		public override ArmorMaterialType MaterialType{ get{ return ArmorMaterialType.Plate; } }

		[Constructable]
		public PlateChest() : base( 0x1415 )
		{
			Weight = 10.0;z
            XmlAttach.AttachTo(this, new XmlSocketable(4, SkillName.Tinkering, 100.0, typeof(IronIngot), 100));
		}

		public PlateChest( Serial serial ) : base( serial )
		{
		}
		
		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
			writer.Write( (int) 0 );
		}
		
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();

			if ( Weight == 1.0 )
				Weight = 10.0;	
        }
	}
}


What´s wrong with that,.,,, :(


if you could post your errors that would help, but I do see a typo

Code:
Weight = 10.0;[color=red]z[/color]

get rid of the 'z'
 

poetawd

Wanderer
ArteGordon said:
if you could post your errors that would help, but I do see a typo

Code:
Weight = 10.0;[color=red]z[/color]

get rid of the 'z'


WHOA !!!


I just saw THAT !! what %$%$%¨ :p


Thank you GORDON !! you are the best

I´ve just add the socketable comand to all the armors....

Thank YOU !!
 

ArteGordon

Wanderer
poetawd said:
WHOA !!!


I just saw THAT !! what %$%$%¨ :p


Thank you GORDON !! you are the best

I´ve just add the socketable comand to all the armors....

Thank YOU !!

If you wanted all armor to be socketable like that, you could also just add that line to the BaseArmor constructor in BaseArmor.cs and that way it would show up on all armor without having to modify the individual armor scripts.
 

poetawd

Wanderer
Damn !!!!


I did´nt know THAT !!!

That would save me a lot of TIME !!

I´ll try and put the results here !

Tnx !

P.S ( I´m sorry for me being so newbie at scripting, but I´ve started learning last week and I hope ONE day I can help this community just like you do ! please keep up with your EXCEPTIONAL work )

:D :D :D :D
 

poetawd

Wanderer
Sorry about the double message, I just wanted to know, if you could suggest me a good way to give the players the gens to insert in a ITEM.


An if is a EASY way to do it.
 

ArteGordon

Wanderer
poetawd said:
Sorry about the double message, I just wanted to know, if you could suggest me a good way to give the players the gens to insert in a ITEM.


An if is a EASY way to do it.

There is a copy of lootpack.cs and loot.cs included in the SocketsLootMod-v105.zip that will automatically add loot drops of random augmentations.
Just replace your current versions of those scripts with the ones included and they will start dropping. The overall drop rate is about the same as instruments and the more powerful augmentations are less common.
Of course, you can adjust those rates.

Here is the description from xmlsockets.txt
I have added modified distro 1.0.0 versions of Loot.cs and LootPack.cs that will give random lootpack drops of augmentations. The frequency of drop is low (about the same as instruments), and the definitions include the rune augmentations (if you dont have runeaugments.cs installed then comment out the sections referring to the runes). To use them, either replace the distro Scripts/Misc/LootPack.cs and Scripts/Misc/Loot.cs with the versions in the SocketsLootMod.zip file (always make backups of your original scripts), or just look in those files for the changes marked "ARTEGORDONMOD", and incorporate them into your existing lootpack.cs and loot.cs files.
Note, I intentionally renamed the files with ._cs extensions so that they wouldnt cause problems if you extracted them into your scripts area. The extensions need to be changed to .cs if you wish to use them as replacements for the distro loot.cs and lootpack.cs scripts.
 

brainless

Wanderer
I installed XMLSockets and got it to compile finally but now I'm really confused... I don't seem to get any sockets added by using the hammer, it just says "this item cannot be socketed" and it's just a regular katana. I can't get any gump to open when using item identification on any item which makes adding augmentations quite hard... I'm pretty lost with this and almost removed whole system already, but decided to ask if you guys know what might be wrong? I just threw the socket system to custom folder and modified the loot.cs and lootpack.cs as instructed. Exciting shard launch and testing and... nothing really happened. I'm sure I'm doing something terribly wrong I just can't figure out what...

EDIT: Nevermind I removed the system. I couldn't get it to work properly. No matter what I did I couldn't get any gump to open with item identification or add any sockets with the hammer. Only way I managed to make sockets was to add them manually, but players can't do that, therefore I pretty much gave up.
 

ArteGordon

Wanderer
brainless said:
I installed XMLSockets and got it to compile finally but now I'm really confused... I don't seem to get any sockets added by using the hammer, it just says "this item cannot be socketed" and it's just a regular katana. I can't get any gump to open when using item identification on any item which makes adding augmentations quite hard... I'm pretty lost with this and almost removed whole system already, but decided to ask if you guys know what might be wrong? I just threw the socket system to custom folder and modified the loot.cs and lootpack.cs as instructed. Exciting shard launch and testing and... nothing really happened. I'm sure I'm doing something terribly wrong I just can't figure out what...

EDIT: Nevermind I removed the system. I couldn't get it to work properly. No matter what I did I couldn't get any gump to open with item identification or add any sockets with the hammer. Only way I managed to make sockets was to add them manually, but players can't do that, therefore I pretty much gave up.


By default, objects have to be 'socketable' for players to be able to add sockets to them with a socket hammer. You can set it up so that there is a random chance that dropped items will be socketable as well as come with sockets already added. That is what the loot and lootpack mods do. The chance is fairly low so you might not see it unless you look at a lot of drops.

If you want anything to be socketable then change these settings in xmlsockets.cs to your liking. Just set CanSocketByDefault to true.

Code:
		// if CanSocketByDefault is set to true, then any object can be socketed using the default settings.  If the XmlSocketable attachment is present, it
		// will override these defaults regardless of the CanSocketByDefault setting.  
		// If this is set to false, then ONLY objects with the XmlSocketable attachment can be socketed.
		[color=red]public static bool CanSocketByDefault = false;[/color]

		// The following default settings will be applied when CanSocketByDefault is true
		//
		// DefaultMaxSockets determines the default maximum number of sockets and item can have.
		// A value of -1 means that any item can have an unlimited number of sockets.  
		// To set it up so that items by default cannot have sockets added to them set this to zero.  
		// That way, only items that have the XmlSocketLimit attachment will be allowed to be socketed.  This is the same as setting CanSocketByDefault to false.
		// You can also assign any other value here to set the default number of sockets allowed when no XmlSocketLimit attachment is present.
		public static int DefaultMaxSockets = -1;

		// DefaultSocketDifficulty is the default minimum skill required to socket.
		// This can be overridden with the XmlSocketLimit attachment on specific items (100 by default)
		public static double DefaultSocketDifficulty = 100.0;
 

sec_goat

Squire
I know this is a long shot, But I will try anyway. I m trying ot get this to work with XMLSpawner2 for RunUO 2.1

I have one error that I cannot figure out how to fix on this code:

Code:
public static new void Initialize()
        {
            Server.Commands.Register( "AddSocket", AccessLevel.Player, new CommandEventHandler( AddSocket_OnCommand ) );
        }

Code:
Error    1    The type or namespace name 'Register' does not exist in the namespace 'Server.Commands' (are you missing an assembly reference?)    XmlSockets.cs    133    29    Server
 

Pure Insanity

Sorceror
Should be CommandSystem.Register, do that and see how it goes. You may also want to put using Server.Commands; at the top if it's not there.
 

sec_goat

Squire
Should be CommandSystem.Register, do that and see how it goes. You may also want to put using Server.Commands; at the top if it's not there.

That has got me going again, thanks. How, where, why? What I mean to say is how would I have ever found that? Using Visual Studio Express 2010?

Any way Now I am on to some new errors, List<> insead of ArrayList I beleive

Code:
Error    1    'Server.Items.BaseTransmutationContainer.GetContextMenuEntries(Server.Mobile, System.Collections.ArrayList)': no suitable method found to override

From this line

Code:
 public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)


I think i have to make the appropriate changes to the container class but changing it over to List<> from arraylist is giving me some problems. . .
 

Attachments

  • BaseTransmutationContainer.cs
    14.6 KB · Views: 4

Pure Insanity

Sorceror
Which version of RunUO are you running? I didn't have this problem with mine, I never needed to make a change. I'm running the SA svn though, I'll take a look at my container class and post it. You should probably post your's and any errors you get when you try to make the needed edits.
 

sec_goat

Squire
Which version of RunUO are you running? I didn't have this problem with mine, I never needed to make a change. I'm running the SA svn though, I'll take a look at my container class and post it. You should probably post your's and any errors you get when you try to make the needed edits.
I'm not really positive what version I am running, it is also a SA SVN (i believe). Is there an easy way to tell this?
 
Top