|
||
|
|||||||
| Script Support Get support for modifying RunUO Scripts, or writing your own! |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Forum Expert
|
Hello All:
Im pretty new to scripting but without internet Ive managed to tear appart all the other scripts in the game and get a pretty good feel for how they work. Nothing amazing but an understanding of their function. But Im stumped on one script Idea.... I wanted to Make a race, and at the beginning each player puts on a bombbelt. Their are challenges both have to face, and at the end of each racers path is a detonator. Who ever gets to the end of the coarse and double clicks the detonator first and blows his enemy up first wins. What I want is to Use an Obi as a bomb belt, and a Sigil as a detonator. Have both on spawners at either end of the coase so anyone can run up and play it. ( automated) Just put it on, and get on the coase run it, and double click the sigil, it nukes the belt and new one spawns ready for next player This is the code I have for the belt so far. I admit this is horrible but its cause Ive been stuck on how to link two items. I havent focused much on anything more. I got a belt that when double clicked will blow and kill the wearer. using System; using Server.Items; namespace Server.Items { [Flipable( 0x27A0, 0x27EB )] public class BombBelt : BaseWaist { [Constructable] public BombBelt() : this( 0 ) { } [Constructable] public BombBelt( int hue ) : base( 0x27A0, hue ) { Name = " A String of Dynomite "; Weight = 1.0; Hue = 39; } public BombBelt( 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 void Use( Mobile from, bool firstStage ) { from.Damage( 255, from ); Effects.SendLocationParticles( EffectItem.Create( from.Location, from.Map, EffectItem.DefaultDuration ), 0, 0, 0, 0, 0, 5060, 0 ); Effects.PlaySound( from.Location, from.Map, 775 ); Effects.SendMovingParticles( new Entity( Serial.Zero, new Point3D( from.X - 6, from.Y - 6, from.Z + 15 ), from.Map ), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100 ); Effects.SendMovingParticles( new Entity( Serial.Zero, new Point3D( from.X - 4, from.Y - 6, from.Z + 15 ), from.Map ), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100 ); Effects.SendMovingParticles( new Entity( Serial.Zero, new Point3D( from.X - 6, from.Y - 4, from.Z + 15 ), from.Map ), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100 ); Effects.SendTargetParticles( from, 0x375A, 35, 90, 0x00, 0x00, 9502, (EffectLayer)255, 0x100 ); Delete(); } public override void OnDoubleClick( Mobile from ) { Use( from, true ); } } } This is my first post on these boards so please be kind if Ive made some errors or anything of that nature. Id love some feedback, cause as soon as I get this game running Im going live with my shard, and there is alot of fun things to see on it, 6 factions, all with special abilities. Thanks for your time, have a good one.. Father Time Father Times Haven shard |
|
|
|
|
|
#3 (permalink) |
|
Forum Expert
|
Simply this
In a simple item script. using System; using Server; namespace Server.Items { public class Ruby : Item { [Constructable] public Ruby() : this( 1 ) { } [Constructable] public Ruby( int amount ) : base( 0xF13 ) { Stackable = true; Weight = 0.1; Amount = amount; } public Ruby( Serial serial ) : base( serial ) { } public override Item Dupe( int amount ) { return base.Dupe( new Ruby( amount ), amount ); } 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(); } } } What would I have to add to make it so if I double clicked this gem, it would detonate this vest... using System; using Server.Items; namespace Server.Items { [Flipable( 0x27A0, 0x27EB )] public class BombBelt : BaseWaist { [Constructable] public BombBelt() : this( 0 ) { } [Constructable] public BombBelt( int hue ) : base( 0x27A0, hue ) { Name = " A String of Dynomite "; Weight = 1.0; Hue = 39; } public BombBelt( 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 void Use( Mobile from, bool firstStage ) { from.Damage( 255, from ); Effects.SendLocationParticles( EffectItem.Create( from.Location, from.Map, EffectItem.DefaultDuration ), 0, 0, 0, 0, 0, 5060, 0 ); Effects.PlaySound( from.Location, from.Map, 775 ); Effects.SendMovingParticles( new Entity( Serial.Zero, new Point3D( from.X - 6, from.Y - 6, from.Z + 15 ), from.Map ), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100 ); Effects.SendMovingParticles( new Entity( Serial.Zero, new Point3D( from.X - 4, from.Y - 6, from.Z + 15 ), from.Map ), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100 ); Effects.SendMovingParticles( new Entity( Serial.Zero, new Point3D( from.X - 6, from.Y - 4, from.Z + 15 ), from.Map ), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100 ); Effects.SendTargetParticles( from, 0x375A, 35, 90, 0x00, 0x00, 9502, (EffectLayer)255, 0x100 ); Delete(); } public override void OnDoubleClick( Mobile from ) { Use( from, true ); } } } Instead of: public override void OnDoubleClick( Mobile from ) { Use( from, true ); } Take that out and somehow by serial or something associate the two scripts with each other so when the gem is double clicked the vest will blow up. This is beyond me and I could really use the advice of an expert. Thanks guys. |
|
|
|
|
|
#4 (permalink) |
|
Forum Expert
Join Date: Oct 2003
Location: Minnesota... somewhere in the boonies
Age: 29
Posts: 1,168
|
Take a look at BraceletOfBinding.cs, it shows how it links 2 bracelets and when one is used, the other one reacts. Pay close attention to the if ( Bound ) to make sure that the jacket is not deleted etc.
P.S. please use [code] [/code]tags around the scripts.
__________________
Signatures are tools of the devil... |
|
|
|
|
|
#5 (permalink) |
|
Forum Expert
|
Awsome thanks!, I didnt even think of looking at bracelets of binding, I was looking at everything I could think of too. your a genious thanks man. Ill let ya know if it works, take care.
Father Time Father Times Haven shard P S thanks about the how to display code too, was wondering how to do that ![]() |
|
|
|
|
|
#6 (permalink) |
|
Forum Expert
|
That script was a little too over my heard to tear appart and grab what I needed. Give me enough time and Ill get it. but for now Its not gonna happen. But I had another idea. Isnt there a Global command, So say I have a gem, and on a double click it gives a command on a global scale to all bomb belts, use, And on use the bombbelts have
Code:
{
from.Damage( 255, from );
Effects.SendLocationParticles( EffectItem.Create( from.Location, from.Map, EffectItem.DefaultDuration ), 0, 0, 0, 0, 0, 5060, 0 );
Effects.PlaySound( from.Location, from.Map, 775 );
Effects.SendMovingParticles( new Entity( Serial.Zero, new Point3D( from.X - 6, from.Y - 6, from.Z + 15 ), from.Map ), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100 );
Effects.SendMovingParticles( new Entity( Serial.Zero, new Point3D( from.X - 4, from.Y - 6, from.Z + 15 ), from.Map ), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100 );
Effects.SendMovingParticles( new Entity( Serial.Zero, new Point3D( from.X - 6, from.Y - 4, from.Z + 15 ), from.Map ), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100 );
Effects.SendTargetParticles( from, 0x375A, 35, 90, 0x00, 0x00, 9502, (EffectLayer)255, 0x100 );
Delete();
}
Thanks for your help everyone your really giving me an outside look on this, Ive been stuck on it for some time Father time Father times haven shard |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|