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!

Can anyone "define" this ?

Sachin Esha

Wanderer
This new script i am attempting to add keeps giving me this one crazy error i have pictured below, i do apologize that i didnt code it, couldnt get it to "copy" so sorry. Anyhow it keeps screaming "ind" error. Any suggestions on how to fix this small error, the script looks very good and i would love to add it for the family. Thanks for input and suggestions.
 

Attachments

  • Untitled.jpg
    32.2 KB · Views: 13
Im going to take a guess and say that on that line they intended to type int and instead put ind.

If that is not it you will need to post the script in code blocks so we can take a look at it.
 

Hammerhand

Knight
Yeah, the lines should read..
Code:
        public override void GetDamageTypes( Mobile wielder, out int phys, out int fire, out int cold,
                                            out int pois, out int nrgy, out int chaos, out int direct )
 

Sachin Esha

Wanderer
Ok , fix one simple error and now BAM ! EVERYthing blows up ! (Pic 1, again sorry about using a pic) Seems there is quiet a few, (3 to be exact...For now) errors, going to go over each one and look for obvious misspelling's and OBVIOUS mis-code, the kind even a cave man can see lol. Anyhow, input and suggestions always welcome !

Ok i found the "common" link.....
Code:
public class ArrowsOfDarkness : Item, ICommodity

So now to figure out the the ICommodity is causing a error in each of the item files its present in...
Ok back to my VS..
 

Attachments

  • Untitled.jpg
    91.6 KB · Views: 3
  • Quests By Fikus Ver 7.0 RC2, ML.zip
    145.7 KB · Views: 1

Hammerhand

Knight
This is the coding from ArrowOfDarkness... you can remove this part from all 3 scripts that are throwing the error.
Code:
        string ICommodity.Description
        {
            get
            {
                return String.Format( Amount == 1 ? "{0} arrow of darkness" : "{0} arrows of darkness", Amount );
            }
        }
And then add this..
Code:
bool ICommodity.IsDeedable { get { return true;
Making that part of the script look like so..
Code:
        int ICommodity.DescriptionNumber { get { return LabelNumber; } }
        bool ICommodity.IsDeedable { get { return true; } }
and see if that helps any.
 

Sachin Esha

Wanderer
Ok those errors went away but not this file below on line 216 keepts throwing the error :

+Misc/Customs/Quest By Fikus/Items/CraftableItems/CursedFishingNet.cs:
CS0246: Line 216: The Type or namespace name "Tile" could not be found <are you missing a using directive or an assembly reference?>

Here is the code
Code:
/// Fikus's Dark Arts Quest
/// 3/25/2008
///
/// The cursed fishing net and cursed fabled fishing net are based off of the special fishing
/// nets are are set up the same way.  I have just changed the names around and added my 
/// monsters in place of the ones that are on OSI.  The cursed fishing net is craftable using
/// the Dark Arts Scepter.  The fabled fishing net is only obtained by killing the Dark Arts
/// Deep Sea Serpent.  Ingrediants needed to make this item are snake entrails and yarn.
///
///
///
///
///
///
///

using System;
using Server;
using Server.Mobiles;
using Server.Targeting;

namespace Server.Items
{
    public class CursedFishingNet : Item
    {
        public override int LabelNumber{ get{ return 1041079; } } // a special fishing net

        private bool m_InUse;

        [Constructable]
        public CursedFishingNet() : base( 0x0DCA )
        {
            Weight = 1.0;
            Hue = 1153;
            Name = "A Cursed Fishing Net";
        }

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

        public override void GetProperties( ObjectPropertyList list )
        {
            base.GetProperties( list );

            // as if the name wasn't enough..
            list.Add( 1017410 ); // Special Fishing Net
        }

        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );

            writer.Write( (int) 1 ); // version

            writer.Write( m_InUse );
        }

        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            switch ( version )
            {
                case 1:
                {
                    m_InUse = reader.ReadBool();

                    if ( m_InUse )
                        Delete();

                    break;
                }
            }

            Stackable = false;
        }

        public override void OnDoubleClick( Mobile from )
        {
            if ( m_InUse )
            {
                from.SendLocalizedMessage( 1010483 ); // Someone is already using that net!
            }
            else if ( IsChildOf( from.Backpack ) )
            {
                from.SendLocalizedMessage( 1010484 ); // Where do you wish to use the net?
                from.BeginTarget( -1, true, TargetFlags.None, new TargetCallback( OnTarget ) );
            }
            else
            {
                from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
            }
        }

        public void OnTarget( Mobile from, object obj )
        {
            if ( Deleted || m_InUse )
                return;

            IPoint3D p3D = obj as IPoint3D;

            if ( p3D == null )
                return;

            Map map = from.Map;

            if ( map == null || map == Map.Internal )
                return;

            int x = p3D.X, y = p3D.Y;

            if ( !from.InRange( p3D, 6 ) )
            {
                from.SendLocalizedMessage( 500976 ); // You need to be closer to the water to fish!
            }
            else if ( FullValidation( map, x, y ) )
            {
                Point3D p = new Point3D( x, y, map.GetAverageZ( x, y ) );

                for ( int i = 1; i < Amount; ++i ) // these were stackable before, doh
                    from.AddToBackpack(new CursedFishingNet());

                m_InUse = true;
                Movable = false;
                MoveToWorld( p, map );

                from.Animate( 12, 5, 1, true, false, 0 );

                Timer.DelayCall( TimeSpan.FromSeconds( 1.5 ), TimeSpan.FromSeconds( 1.0 ), 20, new TimerStateCallback( DoEffect ), new object[]{ p, 0, from } );

                from.SendLocalizedMessage( 1010487 ); // You plunge the net into the sea...
            }
            else
            {
                from.SendLocalizedMessage( 1010485 ); // You can only use this net in deep water!
            }
        }

        private void DoEffect( object state )
        {
            if ( Deleted )
                return;

            object[] states = (object[])state;

            Point3D p = (Point3D)states[0];
            int index = (int)states[1];
            Mobile from = (Mobile)states[2];

            states[1] = ++index;

            if ( index == 1 )
            {
                Effects.SendLocationEffect( p, Map, 0x352D, 16, 4 );
                Effects.PlaySound( p, Map, 0x364 );
            }
            else if ( index <= 10 || index == 20 )
            {
                for ( int i = 0; i < 3; ++i )
                {
                    int x, y;

                    switch ( Utility.Random( 8 ) )
                    {
                        default:
                        case 0: x = -1; y = -1; break;
                        case 1: x = -1; y =  0; break;
                        case 2: x = -1; y = +1; break;
                        case 3: x =  0; y = -1; break;
                        case 4: x =  0; y = +1; break;
                        case 5: x = +1; y = -1; break;
                        case 6: x = +1; y =  0; break;
                        case 7: x = +1; y = +1; break;
                    }

                    Effects.SendLocationEffect( new Point3D( p.X + x, p.Y + y, p.Z ), Map, 0x352D, 16, 4 );
                }

                Effects.PlaySound( p, Map, 0x364 );

                if ( index == 20 )
                    FinishEffect( p, Map, from );
                else
                    this.Z -= 1;
            }
        }

        protected virtual int GetSpawnCount()
        {
            int count = Utility.RandomMinMax( 1, 3 );

            if ( Hue != 0x8A0 )
                count += Utility.RandomMinMax( 1, 2 );

            return count;
        }

        protected void Spawn( Point3D p, Map map, BaseCreature spawn )
        {
            if ( map == null )
            {
                spawn.Delete();
                return;
            }

            int x = p.X, y = p.Y;

            for ( int j = 0; j < 20; ++j )
            {
                int tx = p.X - 2 + Utility.Random( 5 );
                int ty = p.Y - 2 + Utility.Random( 5 );

                Tile t = map.Tiles.GetLandTile( tx, ty );

                if ( t.Z == p.Z && ( (t.ID >= 0xA8 && t.ID <= 0xAB) || (t.ID >= 0x136 && t.ID <= 0x137) ) && !Spells.SpellHelper.CheckMulti( new Point3D( tx, ty, p.Z ), map ) )
                {
                    x = tx;
                    y = ty;
                    break;
                }
            }

            spawn.MoveToWorld( new Point3D( x, y, p.Z ), map );

            if ( spawn is Kraken && 0.2 > Utility.RandomDouble() )
                spawn.PackItem( new MessageInABottle( map == Map.Felucca ? Map.Felucca : Map.Trammel ) );
        }

        protected virtual void FinishEffect( Point3D p, Map map, Mobile from )
        {
            from.RevealingAction();

            int count = GetSpawnCount();

            for ( int i = 0; map != null && i < count; ++i )
            {
                BaseCreature spawn;

                switch ( Utility.Random( 4 ) )
                {
                    default:
                    case 0: spawn = new Leviathan(); break;
                    case 1: spawn = new DarkArtsDeepSeaSerpent(); break;
                    case 2: spawn = new DarkArtsDeepSeaSerpent(); break;
                    case 3: spawn = new Kraken(); break;
                }

                Spawn( p, map, spawn );

                spawn.Combatant = from;
            }

            Delete();
        }

        public static bool FullValidation( Map map, int x, int y )
        {
            bool valid = ValidateDeepWater( map, x, y );

            for ( int j = 1, offset = 5; valid && j <= 5; ++j, offset += 5 )
            {
                if ( !ValidateDeepWater( map, x + offset, y + offset ) )
                    valid = false;
                else if ( !ValidateDeepWater( map, x + offset, y - offset ) )
                    valid = false;
                else if ( !ValidateDeepWater( map, x - offset, y + offset ) )
                    valid = false;
                else if ( !ValidateDeepWater( map, x - offset, y - offset ) )
                    valid = false;
            }

            return valid;
        }

        private static int[] m_WaterTiles = new int[]
            {
                0x00A8, 0x00AB,
                0x0136, 0x0137
            };

        private static bool ValidateDeepWater( Map map, int x, int y )
        {
            int tileID = map.Tiles.GetLandTile( x, y ).ID;
            bool water = false;

            for( int i = 0; !water && i < m_WaterTiles.Length; i += 2 )
                water = (tileID >= m_WaterTiles[i] && tileID <= m_WaterTiles[i + 1]);

            return water;
        }
    }

    public class CursedFabledFishingNet : CursedFishingNet
    {
        public override int LabelNumber{ get{ return 1063451; } } // a fabled fishing net

        [Constructable]
        public CursedFabledFishingNet()
        {
            Hue = 1160;
            Name = "A Cursed Fabled Fishing Net";
        }

        protected override int GetSpawnCount()
        {
            return base.GetSpawnCount() + 4;
        }

        protected override void FinishEffect( Point3D p, Map map, Mobile from )
        {
            Spawn( p, map, new DarkArtsSeaHorse() );

            base.FinishEffect( p, map, from );
        }

        public CursedFabledFishingNet(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();
        }
    }
}

Nothing seems misspelled and the directives look correct , so lost for a minute while i ponder this new error.
Suggestions and comments always welcome of course.
Thank you very much and have a Great day !
 

Sachin Esha

Wanderer
Ok now keep in mind, i am LEARNING but i did this below :

Code:
//Tile t = map.Tiles.GetLandTile( tx, ty );

Then it threw a error about about about Line 218 : say t was not a valid reference, soo...... i did this:
Code:
 //if ( t.Z == p.Z && ( (t.ID >= 0xA8 && t.ID <= 0xAB) || (t.ID >= 0x136 && t.ID <= 0x137) ) && !Spells.SpellHelper.CheckMulti( new Point3D( tx, ty, p.Z ), map ) )

and Shazaam.............it compiled with NO errors, HOWEVER, i have yet to test the quest, by doing the two things i have done i may have "taken out" something that is required or i may have corrupted the quest so now it want work or might even result in server crash, going to put it out and test it. Wish me luck and as always .........Suggestions and/or Comments always welcome !

Have a very nice day !
 
I think instead of Tile you should use LandTarget for what type of variable t is. Try changing that and uncommenting your 2 lines and see if that fixes this.
 
sorry I should have been more specific (work phone started ringing while i was posting previous post)

Code:
LandTarget t = map.Tiles.GetLandTile( tx, ty );

That was what I was trying to get at.
 
I will be home from work in a couple hours. I can look into it a little bit better at that point (unless some one comes up with the answer before then).
 

Sachin Esha

Wanderer
ahha ok thanks friend, going to keep working on it, even a blind squirrel gets lucky once in a while and finds a nut ! Thanks again .
 

Enroq

Sorceror
As far as I can tell from what I've seen you need to check both static and land tiles. Here's some example code. Don't mind anything about races.

Code:
        public static bool ElementalJump( Player pm, IPoint3D p )
        {
            bool isWater = false;
 
            Map map = pm.Map;
            LandTile land = map.Tiles.GetLandTile(p.X, p.Y);
            StaticTile[] tiles = map.Tiles.GetStaticTiles(p.X, p.Y);
 
            isWater = (land.Z == p.Z && ((land.ID >= 168 && land.ID <= 171) || (land.ID >= 310 && land.ID <= 311)));
 
            for (int i = 0; i < tiles.Length; ++i)
            {
                StaticTile tile = tiles[i];
                isWater = (tile.ID >= 0x1796 && tile.ID <= 0x17B2);
            }
 
            return (pm.Race == Race.Elemental && pm.AbilityActive && isWater);
        }
 
I changed this line from Tile to LandTile and it compiled for me:

Code:
LandTile t = map.Tiles.GetLandTile(tx, ty);

I went out into deep water with a cursedfishingnet and tossed it. Got 4 mobs. If it still isnt working as intended let us know and we will see what we can do.
 
Top