View Single Post
Old 05-31-2004, 11:37 PM   #1 (permalink)
Avangelon
*flop*
 
Avangelon's Avatar
 
Join Date: Mar 2004
Location: US, TX
Age: 23
Posts: 56
Send a message via AIM to Avangelon Send a message via MSN to Avangelon Send a message via Yahoo to Avangelon
Wink Complete Socketed Weapon System (B36+)

Summary:
This system allows you to have weapons on your shard that can be modified by installing different augmentations.
Every aspect of this system can easily be completely customized to your specifications. I have contained detailed
documentation as to how you can modify this system to your needs. Let me just tell you this, I have spent a great
deal of time balancing this system to work with the stock RunUO distro, it is recommended that if you create your
own weapons and augmentations that you keep that in mind. The documentation is available at the tail-end of this
file.

Description:
*******************************************
*SOCKETED WEAPON SCRIPT CUSTOMIZATION*
*******************************************

WEAPON SOCKET AMOUNT DETERMINATION

The amount of sockets each weapon has varies with its speed, as you can see in the weapon socket tables below:

Weapon Speed # Of Sockets
30 or less 4
31 to 40 3
41 to 50 2
51 to 60 1

Weapons typically will not have more than 4 sockets because of balance. You are able to change that though if you
choose to do so. The amount of sockets each weapon has is set via the script for that particular weapon, or you
can do it with the [props or [set commands.

CHANGING THE DROPRATES

Droprate Tables
(displayed as probability)

The default droprates for the weapons are as follows:

One socketed weapon: 1:400
Two socketed weapon: 1:800
Three socketed weapon: 1:1200
Four socketed weapon: 1:2400

The default droprates for the augmentations are as follows:

One socket augmentation: 1:200
One socket augmentation: 1:400
One socket augmentation: 1:800
One socket augmentation: 1:1600
Special socket augmentation: 1:4800

You are able to change the droprates in the following file: \*\RunUO\Scripts\Engines\AI\Creature\BaseCreature. cs

The only thing required to change the droprates is modifying one of the variables. I will give you an example so you
can have something to go by when you change the droprates if you so choose.

Let's say, for isntance, that you wanted to change the droprate for the "One Socketed Weapons". What you would
do is proceed to open the file: \*\RunUO\Scripts\Engines\AI\Creature\BaseCreature. cs and scroll down to the line
that contains the following code:

private int m_OneSocketRoll = Utility.Random( 400 );

The droprate for the "One Sockted Weapons" is 1:400 and all you would have to do is change that number 400 to
any number you choose. If you were to change it to 800, you would decrease the droprate, and if you lower the
number then you will increase the droprate. If you wanted double the droprate, you would change that variable to
look like the following:

private int m_OneSocketRoll = Utility.Random( 200 );

I hope that is enough information to get you started with customizing the script to match your shard. I personally
would recommend you leave the default values until you get familiar with the script running on your shard.

CREATING YOUR OWN SOCKETED WEAPONS

In order to get an idea as to how to create your own socketed weapons, I would recommend you take a look at
some of the weapons that come with this script. You can find those files in the following directory (it will vary
depending upon where you installed it):

\*\RunUO\Scripts\*\Socketed Weapon System\Socketed Weapons\

All of the socketed weapons use the original weapon as a base and we basically add the sockets from there and
rename the weapon to a socketed weapon. For example, the "Socketed Katana", if you were to look in the file for
that weapon it woud look like this:

PHP Code:
using System;
using Server.Network;
using Server.Items;

namespace Server.Items
{
    public class 
SocketedKatana Katana
    
{
        [
Constructable]
        public 
SocketedKatana()
        {
            
UsedSockets 0;
            
MaxSockets 2;
        }
        
        public 
override void GetPropertiesObjectPropertyList list )
        {
            
base.GetProperties(list);
            
            
SocketLabel "Sockets: " UsedSockets "/" MaxSockets AugmentList;
            list.
Add1042971SocketLabel );
        }

        public 
SocketedKatanaSerial serial ) : baseserial )
        {
        }
        
        public 
override void SerializeGenericWriter writer )
        {
            
base.Serializewriter );

            
writer.Write( (int) ); // version
            
writer.Write( (int) UsedSockets );
            
writer.Write( (int) MaxSockets );
        }

        public 
override void DeserializeGenericReader reader )
        {
            
base.Deserializereader );

            
int version reader.ReadInt();
            
UsedSockets reader.ReadInt();
            
MaxSockets reader.ReadInt();
        }
    }

If you notice, we are using the "Katana" as our base weapon to create our "Socketed Katana". You will see that
we are simply renaming the "katana" to a "Socketed Katana" with the following line of code:

public class SocketedKatana : Katana

The next thing that we are doing is adding the sockets, that is a couple more lines down. We have to set the max
amount of sockets. We do this with the following 2 lines of code:

UsedSockets = 0;
MaxSockets = 2;

That is basically how you create your own socketed weapons! I know it was breif, however you should not have a
general idea of how this is done. It is not very difficult by any means.

CREATING YOUR OWN AUGMENTATIONS

This is a little bit more difficult than creating a socketed weapon, however it is not extremely difficult. You should be
able to knock this one out pretty quick if you made it this far.

Creating your own augmentations has quite a few steps involved because they do a lot for your socketed weapons.
I would recommend you take a look at one of the current augmentations to get an idea of how they work, then we
can continue.

Let us look at the augmentation entitled "Accrual Of Reception", that file is available in the following directory (it will
vary depending upon where you installed it):

\*\RunUO\Scripts\*\Socketed Weapon System\Augmentations\

The augmentations can do many, many things; they are limited to what properties a weapon can have. If you log
into your shard you can do [props on any weapon and you can change any one of those peoperties with an
augmentation. You are even able to change the hue. We will not get into that really, let us look at a simple, straight-
forward example that will allow you to understand completely what is going on. I ask that you have the file for the
"Accrual Of Reception" open as a reference while looking at the following examples.

When a player finds an augmentation, they need to know what the augmentations name is, it is plainly obvoius where
that is defined. If you have custom augmentations, you may want them to have custom hues so they stand out from
the default augmentations. This is done, for example on line 21 of AccrualOfReception.cs. I will leave it up to you to
find out which hue number you want your augmentations to be, since there are so many different methods and hues.

The next thing is, informing the player of what the augmentation is capable of, and we do this starting on line 27:
PHP Code:
from.SendMessage"This augmentation modifies:" );
from.SendMessage"Spell Channeling" );
from.SendMessage"+25 Intelligence Requirement" );
from.SendMessage"+10 Leech Life" );
from.SendMessage"+1 Durability" );
from.SendMessage"-5 Intelligence" );
from.SendMessage"This augmentation takes up one socket." ); 
Each one of the above lines will display to the player upon double clicking the augmentation. We can put anything
that we want up there, but we want to keep it to where we are basically telling the player every single property that
the augmentation effects on the weapon. You can add or remove lines as necessary.

Now the game needs to know what properties of the weapon that we want to change on the weapon, so on line 93
you will see where we tell the game what this augmentation is effecting. All of this is only if the player succeeds in
combining the augmentation with the weapon, the code is as follows:
PHP Code:
Weapon.UsedSockets += 1;
Weapon.MaxHits += 1;
Weapon.Hits += 1;
Weapon.IntRequirement += 25;
Weapon.Attributes.BonusInt -= 5;
Weapon.Attributes.SpellChanneling += 1;
Weapon.WeaponAttributes.HitLeechHits += 10
As you can see in the code above, quite a few properties of the weapon are changed. You will most likely want to
change the above code to your liking.

We now want to add the augmentation to the list of installed augmentations so when people look at the stats of the
weapon they will know why the stats are modified in the manner that they are:

Weapon.AugmentList = Weapon.AugmentList + "\n" + m_Augmentation.Name;

For effect we will play the anvil sound so the player knows that it happened, audibly, as well as players nearby:

from.PlaySound( 0x2A ); // Anvil

After that, we want to let the player know that they were successful combining the augmentation with the weapon
so we will send them a system message, kind of like what we did when they double clicked on the augmentation:

from.SendMessage( "You have successfully enhanced the weapon!" );

Now we want to delete the augmentation of course, so that the player can never use it again:

m_Augmentation.Delete();

What if the player failed while trying to combine the augmentation with the weapon? Well, we have our messages
that we want to send to the player, plus we want to damage the weapon a little bit because the player is working
the weapon (line 110):
PHP Code:
from.SendMessage"You have failed to enhance the weapon!" );
from.SendMessage"The augmentation crumbles in your hand," );
from.SendMessage"you have damaged the weapon!" );
Weapon.MaxHits -= 3;
Weapon.Hits -= 3
Whenever a player tries to combine an augmentation with the weapon, we want them to risk losing the weapon
because they are making drastic changes and they need to be taking a risk, so we have the following code on line
118:
PHP Code:
from.SendMessage"You have failed to enhance the weapon!" );
from.SendMessage"You have cracked the blade in the process," );
from.SendMessage"the weapon is damaged beyond repair!" );
Weapon.Delete(); 
On line 124 we delete the augmention when the fail in any case:

m_Augmentation.Delete();

Although there are a lot of other little things included in each augmentation, I will not go over them in this tutorial
as you will learn them as you play with the system a little more. I hope this gives you enough information on how
to create your own augmentations for your socketed weapons.

ADDING YOUR CUSTOM AUGMENTATIONS AND SOCKETED WEAPONS TO CREATURE DROPS

Of course you want players to be able to get ahold of your fine work, so I will explain on how to implement your
custom augmentations and weapons into the drop system that is included in this script.

SOCKETED WEAPON

If you created a one socket socketed weapon you would want to add the following code to
\*\RunUO\Scripts\Engines\AI\Creature\BaseCreature. cs:
PHP Code:
//Find these lines:
                
else if ( m_OneSocketWeaponRoll == )
                {
                    
PackItem( new SocketedShortSpear() );
                }

//Add under them:
                
else if ( m_OneSocketWeaponRoll == )
                {
                    
PackItem( new SocketedYOUR_WEAPON_HERE() );
                } 
In the lines of code above, noticed I changed:
PHP Code:
                else if ( m_OneSocketWeaponRoll == )

//to the following:

                
else if ( m_OneSocketWeaponRoll == )

//and I changed:

                    
PackItem( new SocketedShortSpear() );

//to the following:

                    
PackItem( new SocketedYOUR_WEAPON_HERE() ); 
You will want to replace YOUR_WEAPON_HERE with the exact name of the socketed weapon that you created, and
you need to remember that it is case sensitive. The reason I changed the roll number is pretty obvious, I want it to
be a different number than any other number that is attached to any other weapon that is a one socketed weapon.

The next thing that you will want to change is the following:

PHP Code:
//Find this line:
        
private int m_OneSocketWeaponRoll Utility.Random);
//Change it to:
        
private int m_OneSocketWeaponRoll Utility.Random); 
What I did there was increment the weapon roll by one because we have one additional weapon that we are rolling
for to drop.

AUGMENTATION

If you created your own custom augmentation you will have to change to open the following file:
\*\RunUO\Scripts\Engines\AI\Creature\BaseCreature. cs. If your augmentation only takes up one socketd, then you
will want to modify the following code:

PHP Code:
//Find these lines:
                
else if ( m_OneSocketGetAugRoll == )
                {
                    
PackItem( new AccrualOfRuining() );
                }
//Add under them:
                
else if ( m_OneSocketGetAugRoll == )
                {
                    
PackItem( new YOUR_AUGMENTATION_HERE() );
                } 
In the above code you will notice I changed the following:
PHP Code:
                else if ( m_OneSocketGetAugRoll == )
//To the following:
                
else if ( m_OneSocketGetAugRoll == )
//And I changed:
                    
PackItem( new AccrualOfRuining() );
//To the following:
                    
PackItem( new YOUR_AUGMENTATION_HERE() ); 
You will want to replace YOUR_AUGMENTATION_HERE with the exact name of the socketed augmentation you created,
you need to remember that it is case sensitive. The reason I changed the roll number is pretty obvious, I want it to
be a different number than any other number that is attached to any other augmentation that takes up a single
socket.

The next thing that you will want to change is the following:
PHP Code:
//Find this line:
        
private int m_OneSocketGetAugRoll Utility.Random);

//Change it to:
        
private int m_OneSocketGetAugRoll Utility.Random); 
What I did there was increment the augmentation roll by one because we have one additional augmentation that we
are rolling for to drop.

THAT'S ALL FOLKS

That is all of the information that I can think of off the top of my head. If you still need more assistance, refer to
the contact information at the bottom of this text file.

********************************
*AUTHOR CONTACT INFORMATION*
********************************

Do you need additional assistance? Would you like to submit your custom augmentations for other users to download?

You can do all of that at the following URL: <URL removed due to user being banned REPEATEDLY for spamming this forum with that site>

We offer full support on any script we release. Thanks for your interest in our wonderful script!



Installation:
***********************
*SCRIPT INSTALLATION*
***********************

Installation is as simple as 1-2-3
  1. Drop the folder "Socketed Weapon System" into your \*\RunUO\Scripts\Custom folder.
  2. Make the below necessary changes to the files specified.
  3. You're done! Start up your RunUO server.
----------------------------------------------------------
|YOU WILL BE MODIFYING THE FOLLOWING FILES|
----------------------------------------------------------

\*\RunUO\Scripts\Items\Weapons\BaseWeapon.cs
\*\RunUO\Scripts\Engines\AI\Creature\BaseCreature. cs

-------------------------------------------------------------------------------------------------------
Open the file: \*\RunUO\Scripts\Items\Weapons\BaseWeapon.cs
-------------------------------------------------------------------------------------------------------
PHP Code:
//Find this line:
        
public override int EnergyResistanceget{ return m_AosWeaponAttributes.ResistEnergyBonus; } }

//Add under it:
        // <Socketed Weapon System>
        
private int m_UsedSocketsm_MaxSockets;
        private 
string m_SocketLabelm_AugmentList;
        
        [
CommandPropertyAccessLevel.GameMaster )]
        public 
string AugmentList
        
{
            
get{ return m_AugmentList; }
            
setm_AugmentList valueInvalidateProperties(); }
        }
        
        public 
virtual string SocketLabelget{ return m_SocketLabel; } setm_SocketLabel value; } }
        
        [
CommandPropertyAccessLevel.GameMaster )]
        public 
int UsedSockets
        
{
            
get{ return m_UsedSockets; }
            
setm_UsedSockets valueInvalidateProperties(); }
        }
        
        [
CommandPropertyAccessLevel.GameMaster )]
        public 
int MaxSockets
        
{
            
get{ return m_MaxSockets; }
            
setm_MaxSockets valueInvalidateProperties(); }
        }
        
// </Socketed Weapon System> 
----------------------------------------------------------------------------------------------------------------
Open the file: \*\RunUO\Scripts\Engines\AI\Creature\BaseCreature. cs
----------------------------------------------------------------------------------------------------------------
PHP Code:
//Find this line:
        
public virtual int TreasureMapLevelget{ return 0; } }

//Add under it:
        // <Socketed Weapon System>
        
private int m_OneSocketRoll Utility.Random400 );
        private 
int m_TwoSocketRoll Utility.Random800 );
        private 
int m_ThreeSocketRoll Utility.Random1200 );
        private 
int m_FourSocketRoll Utility.Random2400 );
        
        private 
int m_OneSocketWeaponRoll Utility.Random);
        private 
int m_TwoSocketWeaponRoll Utility.Random);
        private 
int m_ThreeSocketWeaponRoll Utility.Random13 );
        private 
int m_FourSocketWeaponRoll Utility.Random);

        private 
int m_OneSocketAugRoll Utility.Random200 );
        private 
int m_TwoSocketAugRoll Utility.Random400 );
        private 
int m_ThreeSocketAugRoll Utility.Random800 );
        private 
int m_FourSocketAugRoll Utility.Random1600 );
        private 
int m_SpecialSocketAugRoll Utility.Random4800 );

        private 
int m_OneSocketGetAugRoll Utility.Random);
        private 
int m_TwoSocketGetAugRoll Utility.Random);
        private 
int m_ThreeSocketGetAugRoll Utility.Random);
        private 
int m_FourSocketGetAugRoll Utility.Random);
        
// </Socketed Weapon System> 
----------------------------------------------------------------------------------------------------------------
PHP Code:
//Find these lines:
        
public override bool OnBeforeDeath()
        {

//Add under them:
            // <Socketed Weapon System>
            
if ( m_OneSocketRoll == )
            {
                if ( 
m_OneSocketWeaponRoll == )
                {
                    
PackItem( new SocketedDagger() );
                }
                else if ( 
m_OneSocketWeaponRoll == )
                {
                    
PackItem( new SocketedKryss() );
                }
                else if ( 
m_OneSocketWeaponRoll == )
                {
                    
PackItem( new SocketedShortSpear() );
                }
            }
            
            if ( 
m_TwoSocketRoll == )
            {
                if ( 
m_TwoSocketWeaponRoll == )
                {
                    
PackItem( new SocketedCrescentBlade() );
                }
                else if ( 
m_TwoSocketWeaponRoll == )
                {
                    
PackItem( new SocketedCutlass() );
                }
                else if ( 
m_TwoSocketWeaponRoll == )
                {
                    
PackItem( new SocketedKatana() );
                }
                else if ( 
m_TwoSocketWeaponRoll == )
                {
                    
PackItem( new SocketedDoubleBladedStaff() );
                }
                else if ( 
m_TwoSocketWeaponRoll == )
                {
                    
PackItem( new SocketedSpear() );
                }
                else if ( 
m_TwoSocketWeaponRoll == )
                {
                    
PackItem( new SocketedWarFork() );
                }
            }
            
            if ( 
m_ThreeSocketRoll == )
            {
                if ( 
m_ThreeSocketWeaponRoll == )
                {
                    
PackItem( new SocketedBoneHarvester() );
                }
                else if ( 
m_ThreeSocketWeaponRoll == )
                {
                    
PackItem( new SocketedBoneHarvester() );
                }
                else if ( 
m_ThreeSocketWeaponRoll == )
                {
                    
PackItem( new SocketedScimitar() );
                }
                else if ( 
m_ThreeSocketWeaponRoll == )
                {
                    
PackItem( new SocketedAxe() );
                }
                else if ( 
m_ThreeSocketWeaponRoll == )
                {
                    
PackItem( new SocketedBattleAxe() );
                }
                else if ( 
m_ThreeSocketWeaponRoll == )
                {
                    
PackItem( new SocketedDoubleAxe() );
                }
                else if ( 
m_ThreeSocketWeaponRoll == )
                {
                    
PackItem( new SocketedExecutionersAxe() );
                }
                else if ( 
m_ThreeSocketWeaponRoll == )
                {
                    
PackItem( new SocketedTwoHandedAxe() );
                }
                else if ( 
m_ThreeSocketWeaponRoll == )
                {
                    
PackItem( new SocketedWarAxe() );
                }
                else if ( 
m_ThreeSocketWeaponRoll == )
                {
                    
PackItem( new SocketedBladedStaff() );
                }
                else if ( 
m_ThreeSocketWeaponRoll == 10 )
                {
                    
PackItem( new SocketedPike() );
                }
                else if ( 
m_ThreeSocketWeaponRoll == 11 )
                {
                    
PackItem( new SocketedScythe() );
                }
                else if ( 
m_ThreeSocketWeaponRoll == 12 )
                {
                    
PackItem( new SocketedMace() );
                }
                else if ( 
m_ThreeSocketWeaponRoll == 13 )
                {
                    
PackItem( new SocketedMaul() );
                }
            }
            
            if ( 
m_FourSocketRoll == )
            {
                if ( 
m_FourSocketWeaponRoll == )
                {
                    
PackItem( new SocketedLongSword() );
                }
                else if ( 
m_FourSocketWeaponRoll == )
                {
                    
PackItem( new SocketedVikingSword() );
                }
                else if ( 
m_FourSocketWeaponRoll == )
                {
                    
PackItem( new SocketedLargeBattleAxe() );
                }
                else if ( 
m_FourSocketWeaponRoll == )
                {
                    
PackItem( new SocketedBardiche() );
                }
                else if ( 
m_FourSocketWeaponRoll == )
                {
                    
PackItem( new SocketedHalberd() );
                }
                else if ( 
m_FourSocketWeaponRoll == )
                {
                    
PackItem( new SocketedLance() );
                }
                else if ( 
m_FourSocketWeaponRoll == )
                {
                    
PackItem( new SocketedHammerPick() );
                }
                else if ( 
m_FourSocketWeaponRoll == )
                {
                    
PackItem( new SocketedScepter() );
                }
                else if ( 
m_FourSocketWeaponRoll == )
                {
                    
PackItem( new SocketedWarMace() );
                }
                else if ( 
m_FourSocketWeaponRoll == )
                {
                    
PackItem( new SocketedWarHammer() );
                }
            }

            if ( 
m_OneSocketAugRoll == )
            {
                if ( 
m_OneSocketGetAugRoll == )
                {
                    
PackItem( new AccrualOfReception() );
                }
                else if ( 
m_OneSocketGetAugRoll == )
                {
                    
PackItem( new AccrualOfRuining() );
                }
            }

            if ( 
m_TwoSocketAugRoll == )
            {
                if ( 
m_TwoSocketGetAugRoll == )
                {
                    
PackItem( new LesserAccrualOfReception() );
                }
                else if ( 
m_TwoSocketGetAugRoll == )
                {
                    
PackItem( new LesserAccrualOfRuining() );
                }
            }

            if ( 
m_ThreeSocketAugRoll == )
            {
                if ( 
m_ThreeSocketGetAugRoll == )
                {
                    
PackItem( new GreaterAccrualOfReception() );
                }
                else if ( 
m_ThreeSocketGetAugRoll == )
                {
                    
PackItem( new GreaterAccrualOfRuining() );
                }
            }

            if ( 
m_FourSocketAugRoll == )
            {
                if ( 
m_FourSocketGetAugRoll == )
                {
                    
PackItem( new HallowedAccrualOfDexterity() );
                }
                else if ( 
m_FourSocketGetAugRoll == )
                {
                    
PackItem( new HallowedAccrualOfStrength() );
                }
                else if ( 
m_FourSocketGetAugRoll == )
                {
                    
PackItem( new UnsanctifiedAccrualOfDexterity() );
                }
                else if ( 
m_FourSocketGetAugRoll == )
                {
                    
PackItem( new UnsanctifiedAccrualOfStrength() );
                }
            }
            
// </Socketed Weapon System> 
-------------------------------------------------------
|YOU ARE DONE MODIFYING THE RUNUO FILES|
-------------------------------------------------------
Attached Files
File Type: zip script4.zip (43.3 KB, 311 views)
__________________
boo!
AHHH
:confused:
Avangelon is offline   Reply With Quote