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:

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();
        }
    }
}
 
The errors tell you that IDamageable does not have these functions, so you would need to cast / convert the defender to a mobile again. This was a change in some publish because there were suddenly Items that could be attacked.

This should work as expected:

C#:
        public override void OnHit(Mobile attacker, IDamageable defender, double Damagebonus)
        {
            if(defender is Mobile)
            {
                Mobile defMobile = (Mobile)defender ;
                if (defMobile.Region.Name == "The Paintball Arena")
                {
                    if (defMobile.Player)
                    {
                        Item paintrobe = defMobile.FindItemOnLayer(Layer.OuterTorso );
                        defMobile.SendMessage( "You feel wet paint on you" );
                        if ( paintrobe == null)
                        {
                            //defMobile.SendMessage( "You have NO Robe on!" );

                            ArrayList list = new ArrayList();
                            foreach ( Item item in World.Items.Values )
                            {
                                if( item.RootParent == defMobile)
                                {
                                    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();
                            defMobile.SendMessage( "You have been eliminated for not wearing the robe. The paintball equipment has been removed from your pack." );

                            defMobile.X = 5705;
                            defMobile.Y = 662;
                            defMobile.Z = 0;
                            defMobile.Map = Map.Felucca;
                            Effects.SendLocationEffect(defMobile.Location, defMobile.Map, 0x3728, 10, 10);
                            defMobile.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;
                            //defMobile.SendMessage( "You have been hit 5 times!" );
                            ArrayList list = new ArrayList();
                            foreach ( Item item in World.Items.Values )
                            {
                                if( item.RootParent == defMobile)
                                {
                                    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();
                            defMobile.X = 5705;
                            defMobile.Y = 662;
                            defMobile.Z = 0;
                            defMobile.Map = Map.Felucca;
                            Effects.SendLocationEffect(defMobile.Location, defMobile.Map, 0x3728, 10, 10);
                            defMobile.PlaySound (510);
                            defMobile.SendMessage( "You have been hit 5 times and been eliminated. The paintball equipment has been removed from your pack." );
                            this.Name = this.Name + "/";
                        }
                        else
                        {
                            //defMobile.SendMessage( "You are not wearing the proper robe!" );
                            ArrayList list = new ArrayList();
                            foreach ( Item item in World.Items.Values )
                            {
                                if( item.RootParent == defMobile)
                                {
                                    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();
                            defMobile.X = 5705;
                            defMobile.Y = 662;
                            defMobile.Z = 0;
                            defMobile.Map = Map.Felucca;
                            Effects.SendLocationEffect(defMobile.Location, defMobile.Map, 0x3728, 10, 10);
                            defMobile.PlaySound (510);
                            defMobile.SendMessage( "You have been eliminated for not wearing the proper robe. All paintball equipment has been removed from your pack." );
                        }
                    }
                    else
                    {
                        attacker.SendMessage( "You stunned the bot for a moment" );
                        defMobile.Freeze( TimeSpan.FromSeconds( 30.0 ) );
                    }

                damageBonus = -10;
            }
            base.OnHit( attacker, defender, damageBonus );
        }
 
Thanks so much!!! Just seems one last error in the system. It's throwing out this error

Errors:
+ Custom/Events/Paint Ball/PaintBallGunBase.cs:
CS0106: Line 144: The modifier 'public' is not valid for this item
CS1001: Line 144: Identifier expected
CS1002: Line 144: ; expected
CS1513: Line 144: } expected
CS1002: Line 144: ; expected
CS1513: Line 146: } expected
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.

Which is weird.... cause it's just a generic serialization that one would use for any item.

public PaintBallGunBase( Serial serial ) : base( serial )
{
}

Any thoughts on why that would appear all the sudden?
 
Looks like I missed a bracket there
C#:
        public override void OnHit(Mobile attacker, IDamageable defender, double Damagebonus)
        {
            if(defender is Mobile)
            {
                Mobile defMobile = (Mobile)defender;
                if (defMobile.Region.Name == "The Paintball Arena")
                {
                    if (defMobile.Player)
                    {
                        Item paintrobe = defMobile.FindItemOnLayer(Layer.OuterTorso );
                        defMobile.SendMessage( "You feel wet paint on you" );
                        if ( paintrobe == null)
                        {
                            //defMobile.SendMessage( "You have NO Robe on!" );

                            ArrayList list = new ArrayList();
                            foreach ( Item item in World.Items.Values )
                            {
                                if( item.RootParent == defMobile)
                                {
                                    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();
                            defMobile.SendMessage( "You have been eliminated for not wearing the robe. The paintball equipment has been removed from your pack." );

                            defMobile.X = 5705;
                            defMobile.Y = 662;
                            defMobile.Z = 0;
                            defMobile.Map = Map.Felucca;
                            Effects.SendLocationEffect(defMobile.Location, defMobile.Map, 0x3728, 10, 10);
                            defMobile.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;
                            //defMobile.SendMessage( "You have been hit 5 times!" );
                            ArrayList list = new ArrayList();
                            foreach ( Item item in World.Items.Values )
                            {
                                if( item.RootParent == defMobile)
                                {
                                    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();
                            defMobile.X = 5705;
                            defMobile.Y = 662;
                            defMobile.Z = 0;
                            defMobile.Map = Map.Felucca;
                            Effects.SendLocationEffect(defMobile.Location, defMobile.Map, 0x3728, 10, 10);
                            defMobile.PlaySound (510);
                            defMobile.SendMessage( "You have been hit 5 times and been eliminated. The paintball equipment has been removed from your pack." );
                            this.Name = this.Name + "/";
                        }
                        else
                        {
                            //defMobile.SendMessage( "You are not wearing the proper robe!" );
                            ArrayList list = new ArrayList();
                            foreach ( Item item in World.Items.Values )
                            {
                                if( item.RootParent == defMobile)
                                {
                                    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();
                            defMobile.X = 5705;
                            defMobile.Y = 662;
                            defMobile.Z = 0;
                            defMobile.Map = Map.Felucca;
                            Effects.SendLocationEffect(defMobile.Location, defMobile.Map, 0x3728, 10, 10);
                            defMobile.PlaySound (510);
                            defMobile.SendMessage( "You have been eliminated for not wearing the proper robe. All paintball equipment has been removed from your pack." );
                        }
                    }
                    else
                    {
                        attacker.SendMessage( "You stunned the bot for a moment" );
                        defMobile.Freeze( TimeSpan.FromSeconds( 30.0 ) );
                    }
                }
                damageBonus = -10;
            }
            base.OnHit( attacker, defender, damageBonus );
        }
 
Last edited:
Ok, your changes got most of the errors out. just a couple last ones. So I am seeing i have to convert the defender to a mobile but what would the new term for damagebonus be then? defMobile.damagebonus? These are the last few errors. Thanks again PyrO really appreciate the help.

Errors:
+ Custom/Events/Paint Ball/PaintBallGunBase.cs:
CS0103: Line 139: The name 'damageBonus' does not exist in the current context
CS0103: Line 141: The name 'damageBonus' does not exist in the current context
CS0165: Line 51: Use of unassigned local variable 'defMobile'
Scripts: One or more scripts failed to compile or no script files were found.

and this is the entire script again.

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 is Mobile)
            {
                Mobile defMobile = (Mobile)defMobile;
                if (defMobile.Region.Name == "The Paintball Arena")
                {
                    if (defMobile.Player)
                    {
                        Item paintrobe = defMobile.FindItemOnLayer(Layer.OuterTorso );
                        defMobile.SendMessage( "You feel wet paint on you" );
                        if ( paintrobe == null)
                        {
                            //defMobile.SendMessage( "You have NO Robe on!" );

                            ArrayList list = new ArrayList();
                            foreach ( Item item in World.Items.Values )
                            {
                                if( item.RootParent == defMobile)
                                {
                                    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();
                            defMobile.SendMessage( "You have been eliminated for not wearing the robe. The paintball equipment has been removed from your pack." );

                            defMobile.X = 5705;
                            defMobile.Y = 662;
                            defMobile.Z = 0;
                            defMobile.Map = Map.Felucca;
                            Effects.SendLocationEffect(defMobile.Location, defMobile.Map, 0x3728, 10, 10);
                            defMobile.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;
                            //defMobile.SendMessage( "You have been hit 5 times!" );
                            ArrayList list = new ArrayList();
                            foreach ( Item item in World.Items.Values )
                            {
                                if( item.RootParent == defMobile)
                                {
                                    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();
                            defMobile.X = 5705;
                            defMobile.Y = 662;
                            defMobile.Z = 0;
                            defMobile.Map = Map.Felucca;
                            Effects.SendLocationEffect(defMobile.Location, defMobile.Map, 0x3728, 10, 10);
                            defMobile.PlaySound (510);
                            defMobile.SendMessage( "You have been hit 5 times and been eliminated. The paintball equipment has been removed from your pack." );
                            this.Name = this.Name + "/";
                        }
                        else
                        {
                            //defMobile.SendMessage( "You are not wearing the proper robe!" );
                            ArrayList list = new ArrayList();
                            foreach ( Item item in World.Items.Values )
                            {
                                if( item.RootParent == defMobile)
                                {
                                    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();
                            defMobile.X = 5705;
                            defMobile.Y = 662;
                            defMobile.Z = 0;
                            defMobile.Map = Map.Felucca;
                            Effects.SendLocationEffect(defMobile.Location, defMobile.Map, 0x3728, 10, 10);
                            defMobile.PlaySound (510);
                            defMobile.SendMessage( "You have been eliminated for not wearing the proper robe. All paintball equipment has been removed from your pack." );
                        }
                    }
                    else
                    {
                        attacker.SendMessage( "You stunned the bot for a moment" );
                        defMobile.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();
        }
    }
}
 
Didnt see that the parameters name changed, it should not be Damagebonus but damageBonus
so it should be that.
C#:
public override void OnHit(Mobile attacker, IDamageable defender, double damageBonus)

additionally it appears that the edit I threw in since I saw a small replacement mistake, didnt take effect after all .. odd
so the line:
C#:
Mobile defMobile = (Mobile)defMobile;
should be:
C#:
Mobile defMobile = (Mobile)defender;
 
Back