Kaniva
Member
Hello everyone! I am new to ServUO (from RunUO) and I am trying to get a script I love that worked great on RunUO working on ServUO but I am unsure what changes need to be made. Can anyone help me out and point me in the right direction? Thank you!!
Here is the errors I am getting:
Here is the script:
Here is the errors I am getting:
C#:
Errors:
+ Custom/Events/Paint Ball/PaintBallGunBase.cs:
CS1061: Line 49: 'IDamageable' does not contain a definition for 'Player' and no accessible extension method 'Player' accepting a first argument of type 'IDamageable' could be found (are you missing a using directive or an assembly reference?)
CS1061: Line 49: 'IDamageable' does not contain a definition for 'Region' and no accessible extension method 'Region' accepting a first argument of type 'IDamageable' could be found (are you missing a using directive or an assembly reference?)
CS0411: Line 51: The type arguments for method 'MobileExtUtility.FindItemOnLayer<TItem>(Mobile, Layer)' cannot be inferred from the usage. Try specifying the type arguments explicitly.
CS1061: Line 52: 'IDamageable' does not contain a definition for 'SendMessage' and no accessible extension method 'SendMessage' accepting a first argument of type 'IDamageable' could be found (are you missing a using directive or an assembly reference?)
CS1061: Line 68: 'IDamageable' does not contain a definition for 'SendMessage' and no accessible extension method 'SendMessage' accepting a first argument of type 'IDamageable' could be found (are you missing a using directive or an assembly reference?)
CS0200: Line 70: Property or indexer 'IPoint2D.X' cannot be assigned to -- it is read only
CS0200: Line 71: Property or indexer 'IPoint2D.Y' cannot be assigned to -- it is read only
CS0200: Line 72: Property or indexer 'IPoint3D.Z' cannot be assigned to -- it is read only
CS0200: Line 96: Property or indexer 'IPoint2D.X' cannot be assigned to -- it is read only
CS0200: Line 97: Property or indexer 'IPoint2D.Y' cannot be assigned to -- it is read only
CS0200: Line 98: Property or indexer 'IPoint3D.Z' cannot be assigned to -- it is read only
CS1061: Line 102: 'IDamageable' does not contain a definition for 'SendMessage' and no accessible extension method 'SendMessage' accepting a first argument of type 'IDamageable' could be found (are you missing a using directive or an assembly reference?)
CS0200: Line 119: Property or indexer 'IPoint2D.X' cannot be assigned to -- it is read only
CS0200: Line 120: Property or indexer 'IPoint2D.Y' cannot be assigned to -- it is read only
CS0200: Line 121: Property or indexer 'IPoint3D.Z' cannot be assigned to -- it is read only
CS1061: Line 125: 'IDamageable' does not contain a definition for 'SendMessage' and no accessible extension method 'SendMessage' accepting a first argument of type 'IDamageable' could be found (are you missing a using directive or an assembly reference?)
CS1061: Line 129: 'IDamageable' does not contain a definition for 'Region' and no accessible extension method 'Region' accepting a first argument of type 'IDamageable' could be found (are you missing a using directive or an assembly reference?)
CS1061: Line 132: 'IDamageable' does not contain a definition for 'Freeze' and no accessible extension method 'Freeze' accepting a first argument of type 'IDamageable' could be found (are you missing a using directive or an assembly reference?)
CS0103: Line 135: The name 'damageBonus' does not exist in the current context
CS0103: Line 137: The name 'damageBonus' does not exist in the current context
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.
Here is the script:
C#:
using System;
using Server.Network;
using Server.Items;
using System.Collections;
namespace Server.Items
{
public class PaintBallGunBase : BaseRanged
{
public override int EffectID{ get{ return 0x1BFE; } }
public override Type AmmoType{ get{ return typeof( PaintBallPellets ); } }
public override Item Ammo{ get{ return new PaintBallPellets(); } }
public override WeaponAbility PrimaryAbility{ get{ return WeaponAbility.Block; } }
public override WeaponAbility SecondaryAbility{ get{ return WeaponAbility.ForceOfNature; } }
public override float MlSpeed{ get{ return 2.50f; } }
public override int AosStrengthReq{ get{ return 0; } }
public override int AosMinDamage{ get{ return 1; } }
public override int AosMaxDamage{ get{ return 1; } }
public override int AosSpeed{ get{ return 25; } }
public override int OldStrengthReq{ get{ return 0; } }
public override int OldMinDamage{ get{ return 1; } }
public override int OldMaxDamage{ get{ return 1; } }
public override int OldSpeed{ get{ return 25; } }
public override int DefMaxRange{ get{ return 10; } }
public override int InitMinHits{ get{ return 0; } }
public override int InitMaxHits{ get{ return 0; } }
public override SkillName DefSkill{ get{ return SkillName.Forensics; } }
[Constructable]
public PaintBallGunBase() : base( 3920 )
{
WeaponAttributes.SelfRepair = 20;
//Attributes.NightSight = 1;
Weight = 1.0;
Hue = Utility.RandomMetalHue();
SkillBonuses.SetValues(0, SkillName.Forensics, 100);
}
public override void OnHit(Mobile attacker, IDamageable defender, double Damagebonus)
{
if (defender.Player && defender.Region.Name == "The Paintball Arena" )
{
Item paintrobe = defender.FindItemOnLayer(Layer.OuterTorso );
defender.SendMessage( "You feel wet paint on you" );
if ( paintrobe == null)
{
//defender.SendMessage( "You have NO Robe on!" );
ArrayList list = new ArrayList();
foreach ( Item item in World.Items.Values )
{
if( item.RootParent == defender)
{
if ( item is PaintBallPellets ) list.Add( item );
else if ( item is PaintBallRobe ) list.Add( item );
else if ( item is PaintBallGunBase ) list.Add( item );
}
}
foreach ( Item item in list ) item.Delete();
defender.SendMessage( "You have been eliminated for not wearing the robe. The paintball equipment has been removed from your pack." );
defender.X = 5705;
defender.Y = 662;
defender.Z = 0;
defender.Map = Map.Felucca;
Effects.SendLocationEffect(defender.Location, defender.Map, 0x3728, 10, 10);
defender.PlaySound (510);
}
else if ( paintrobe.Hue == 6) paintrobe.Hue = 11;
else if ( paintrobe.Hue == 11) paintrobe.Hue = 21;
else if ( paintrobe.Hue == 21) paintrobe.Hue = 31;
else if ( paintrobe.Hue == 31) paintrobe.Hue = 38;
else if ( paintrobe.Hue == 38)
{
paintrobe.Hue = 6;
//defender.SendMessage( "You have been hit 5 times!" );
ArrayList list = new ArrayList();
foreach ( Item item in World.Items.Values )
{
if( item.RootParent == defender)
{
if ( item is PaintBallPellets ) list.Add( item );
else if ( item is PaintBallRobe ) list.Add( item );
else if ( item is PaintBallGunBase ) list.Add( item );
}
}
foreach ( Item item in list ) item.Delete();
defender.X = 5705;
defender.Y = 662;
defender.Z = 0;
defender.Map = Map.Felucca;
Effects.SendLocationEffect(defender.Location, defender.Map, 0x3728, 10, 10);
defender.PlaySound (510);
defender.SendMessage( "You have been hit 5 times and been eliminated. The paintball equipment has been removed from your pack." );
this.Name = this.Name + "/";
}
else
{
//defender.SendMessage( "You are not wearing the proper robe!" );
ArrayList list = new ArrayList();
foreach ( Item item in World.Items.Values )
{
if( item.RootParent == defender)
{
if ( item is PaintBallPellets ) list.Add( item );
else if ( item is PaintBallRobe ) list.Add( item );
else if ( item is PaintBallGunBase ) list.Add( item );
}
}
foreach ( Item item in list ) item.Delete();
defender.X = 5705;
defender.Y = 662;
defender.Z = 0;
defender.Map = Map.Felucca;
Effects.SendLocationEffect(defender.Location, defender.Map, 0x3728, 10, 10);
defender.PlaySound (510);
defender.SendMessage( "You have been eliminated for not wearing the proper robe. All paintball equipment has been removed from your pack." );
}
}
else if ( defender.Region.Name == "The Paintball Arena" )
{
attacker.SendMessage( "You stunned the bot for a moment" );
defender.Freeze( TimeSpan.FromSeconds( 30.0 ) );
}
damageBonus = -10;
base.OnHit( attacker, defender, damageBonus );
}
public PaintBallGunBase( 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();
}
}
}