|
||
|
|||||||
| Custom Script Release Archive This is a pre-script database archive of what our users had released. |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Forum Expert
Join Date: Feb 2004
Age: 27
Posts: 1,834
|
Hope noone minds if I post this demo script.
There will be no support on this one from me, so do NOT install it on a life shard. *lol* This script is supposed to give ppl an example, of how set items ( Diablo style ) COULD be scripted. Code:
using System;
using Server;
namespace Server.Items
{
public class Kamuflarosneck : PlateGorget
{
public override int ArtifactRarity{ get{ return 12; } }
public override int InitMinHits{ get{ return 255; } }
public override int InitMaxHits{ get{ return 255; } }
[Constructable]
public Kamuflarosneck()
{
Name = "Vampire Protector";
Hue = 1862;
Attributes.Luck = 100;
PhysicalBonus = 10;
FireBonus = 5;
PoisonBonus = 5;
}
public override bool OnEquip( Mobile from )
{
int count = Count( from );
Boost( count );
Item kamuflaros = from.FindItemOnLayer( Layer.Bracelet );
if ( kamuflaros is Kamuflarosrolex )
((Kamuflarosrolex)kamuflaros).Boost( count );
kamuflaros = from.FindItemOnLayer( Layer.TwoHanded );
if ( kamuflaros is Kamuflarospistol )
((Kamuflarospistol)kamuflaros).Boost( count );
return base.OnEquip( from );
}
public override void OnRemoved( object parent )
{
if ( parent is Mobile )
{
Mobile m = (Mobile)parent;
int count = Count( m ) - 1;
Item kamuflaros = m.FindItemOnLayer( Layer.Bracelet );
if ( kamuflaros is Kamuflarosrolex )
((Kamuflarosrolex)kamuflaros).Boost( count );
kamuflaros = m.FindItemOnLayer( Layer.TwoHanded );
if ( kamuflaros is Kamuflarospistol )
((Kamuflarospistol)kamuflaros).Boost( count );
Neutralize();
}
base.OnRemoved( parent );
}
public int Count( Mobile from )
{
int c = 0;
if ( from.FindItemOnLayer( Layer.Bracelet ) is Kamuflarosrolex )
++c;
if ( from.FindItemOnLayer( Layer.TwoHanded ) is Kamuflarospistol )
++c;
return c;
}
public void Boost( int count )
{
Neutralize();
switch ( count )
{
case 1:
{
Attributes.Luck = 120;
break;
}
case 2:
{
Attributes.Luck = 150;
Attributes.RegenHits = 5;
break;
}
}
}
public void Neutralize()
{
Attributes.Luck = 100;
Attributes.RegenHits = 0;
}
public Kamuflarosneck( 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();
}
}
public class Kamuflarosrolex : GoldBracelet
{
public override int ArtifactRarity{ get{ return 12; } }
[Constructable]
public Kamuflarosrolex()
{
Name = "Unique Rolex";
Hue = 1281;
Attributes.CastRecovery = 1;
Attributes.CastSpeed = 1;
Attributes.RegenMana = 2;
Resistances.Energy = 5;
}
public override bool OnEquip( Mobile from )
{
int count = Count( from );
Boost( count );
Item kamuflaros = from.FindItemOnLayer( Layer.Neck );
if ( kamuflaros is Kamuflarosneck )
((Kamuflarosneck)kamuflaros).Boost( count );
kamuflaros = from.FindItemOnLayer( Layer.TwoHanded );
if ( kamuflaros is Kamuflarospistol )
((Kamuflarospistol)kamuflaros).Boost( count );
return base.OnEquip( from );
}
public override void OnRemoved( object parent )
{
if ( parent is Mobile )
{
Mobile m = (Mobile)parent;
int count = Count( m ) - 1;
Item kamuflaros = m.FindItemOnLayer( Layer.Neck );
if ( kamuflaros is Kamuflarosneck )
((Kamuflarosneck)kamuflaros).Boost( count );
kamuflaros = m.FindItemOnLayer( Layer.TwoHanded );
if ( kamuflaros is Kamuflarospistol )
((Kamuflarospistol)kamuflaros).Boost( count );
Neutralize();
}
base.OnRemoved( parent );
}
public int Count( Mobile from )
{
int c = 0;
if ( from.FindItemOnLayer( Layer.Neck ) is Kamuflarosneck )
++c;
if ( from.FindItemOnLayer( Layer.TwoHanded ) is Kamuflarospistol )
++c;
return c;
}
public void Boost( int count )
{
Neutralize();
switch ( count )
{
case 1:
{
Resistances.Energy = 10;
break;
}
case 2:
{
Resistances.Energy = 15;
Attributes.CastSpeed = 2;
break;
}
}
}
public void Neutralize()
{
Attributes.CastSpeed = 1;
Resistances.Energy = 5;
}
public Kamuflarosrolex( 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();
}
}
public class Kamuflarospistol : RepeatingCrossbow
{
public override int ArtifactRarity{ get{ return 12; } }
public override int InitMinHits{ get{ return 255; } }
public override int InitMaxHits{ get{ return 255; } }
[Constructable]
public Kamuflarospistol()
{
Name = "WerewolfSlayer";
Hue = 1150;
Slayer = SlayerName.Silver;
Attributes.WeaponDamage = 50;
Attributes.WeaponSpeed = 50;
}
public override bool OnEquip( Mobile from )
{
int count = Count( from );
Boost( count );
Item kamuflaros = from.FindItemOnLayer( Layer.Bracelet );
if ( kamuflaros is Kamuflarosrolex )
((Kamuflarosrolex)kamuflaros).Boost( count );
kamuflaros = from.FindItemOnLayer( Layer.Neck );
if ( kamuflaros is Kamuflarosneck )
((Kamuflarosneck)kamuflaros).Boost( count );
return base.OnEquip( from );
}
public override void OnRemoved( object parent )
{
if ( parent is Mobile )
{
Mobile m = (Mobile)parent;
int count = Count( m ) - 1;
Item kamuflaros = m.FindItemOnLayer( Layer.Bracelet );
if ( kamuflaros is Kamuflarosrolex )
((Kamuflarosrolex)kamuflaros).Boost( count );
kamuflaros = m.FindItemOnLayer( Layer.Neck );
if ( kamuflaros is Kamuflarosneck )
((Kamuflarosneck)kamuflaros).Boost( count );
Neutralize();
}
base.OnRemoved( parent );
}
public int Count( Mobile from )
{
int c = 0;
if ( from.FindItemOnLayer( Layer.Bracelet ) is Kamuflarosrolex )
++c;
if ( from.FindItemOnLayer( Layer.Neck ) is Kamuflarosneck )
++c;
return c;
}
public void Boost( int count )
{
Neutralize();
switch ( count )
{
case 1:
{
Attributes.WeaponSpeed = 60;
break;
}
case 2:
{
Attributes.WeaponSpeed = 75;
WeaponAttributes.HitFireArea = 75;
break;
}
}
}
public void Neutralize()
{
Attributes.WeaponSpeed = 50;
WeaponAttributes.HitFireArea = 0;
}
public Kamuflarospistol( 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();
}
}
}
|
|
|
|
|
#2 (permalink) |
|
Account Terminated
Join Date: Apr 2004
Location: Titusville PA
Age: 26
Posts: 975
|
Will you give some type of support if someone tried to use this to make something? I like this idea I do wonder if it would lag the server though. Anyhow yeah I am glad you gave this example it just might get me rolling on something seeing as I was making minor artifact sets and wanted to do something like this originally but no one seemed to know how to do it and I had no example to work with.
|
|
|
|
|
#3 (permalink) |
|
Forum Expert
|
ah-ha ! wow there are quite modifications done never played diablo thoe .. very bloody game..
but thoe the socket sistem my bro. bought some tips from the blizzard site long time ago what kind of attributes does the modification of your support also in base armour and weapon doesnt there needed to be modifed all so ? |
|
|
|
|
#4 (permalink) |
|
Forum Expert
Join Date: Feb 2004
Age: 27
Posts: 1,834
|
The set items are stand alone and do not need changes to any system files to be working.
And they only eat up aditional resources, if you equip/unequip them. that's the price you pay... I just didn't see another way. If anyone tries to script anything at all, he can visit the support forum. Lots of ppl there will be willing to help you. In this thread it's less. ![]() No support maybe sounded a bit harsh, but hey, it's only meant to be an example and I didn't test cases like item gets destroyed/deleted, just the normal dress, undress. |
|
|
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|