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!

[EXAMPLE] Random MAGICAL Viking Sword

Ryan

RunUO Founder
Staff member
[EXAMPLE] Random MAGICAL Viking Sword

[code:1]
using System;
using Server.Network;
using Server.Items;

namespace Server.Scripts.Items.Weapons.Swords
{
public class RandomMagicVikingSword : BaseSword
{
[Constructable]
public RandomMagicVikingSword() : base( 6, 34, 30, 0x237, 0x23A, 1, SkillName.Swords, WeaponType.Slashing, WeaponAnimation.Slash1H, 0x13B9, Layer.OneHanded )
{
Weight = 6.0;
this.DamageLevel = (WeaponDamageLevel)Utility.Random( 0, 5 );
this.DurabilityLevel = (WeaponDurabilityLevel)Utility.Random( 0, 5 );
}

public RandomMagicVikingSword( 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();
}
}
}
[/code:1]

This will be good for loot :)

from.AddToBackpack( new RandomMagicVikingSword() );

This will yield any combo of viking sword possible, even the chance of a regular viking... its quite nice!
 

Phantom

Knight
Thank You Ryan

I suppose it is possible, but this code has some other things that it could be used for.

Instead of alot of different items, we can only make a few different kinds of weapons. perhaps having a chance of all 5 levels is sort of "extreme" look forward to a "Magic" Weapon release from yours truly.

ETA

One Week
 

Redleer

Wanderer
whit that script mayby yes but you can easily change it :D
this.DamageLevel = (WeaponDamageLevel)Utility.Random( 0, 5 );
just change that 5 to 4 so you can't get vang... you can make other similar script to bigger monsters whit that 5 so can get vang... i don't know is there other way... mayby there is but my scripting skills sux :D so i don't know...
 

Phantom

Knight
Yes that would make it go from

Type 0 Normal
Type 1 Next level
Type 2 Next Level
Type 3 Next Level
Type 4 Next Level

Thats what I am going to be working on. However, want to figure out some things first.
 
Top