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!

Problem with FSATS -

Ruined_Xz

Wanderer
Code:
using System;
using System.Collections;
using Server;
using Server.Gumps;
using Server.Items;
using Server.Network;
using Server.Targeting;
using Server.ContextMenus;

namespace Server.Mobiles
{
    public class AnimalBreeder : BaseVendor
    {
        private ArrayList m_SBInfos = new ArrayList();
        protected override ArrayList SBInfos{ get { return m_SBInfos; } }

        [Constructable]
        public AnimalBreeder() : base( "the animal breeder" )
        {
            SetSkill( SkillName.AnimalLore, 64.0, 100.0 );
            SetSkill( SkillName.AnimalTaming, 90.0, 100.0 );
            SetSkill( SkillName.Veterinary, 65.0, 88.0 );
        }

        public override void InitSBInfo()
        {
            //m_SBInfos.Add( new SBAnimalTrainer() );
        }

        public override VendorShoeType ShoeType
        {
            get{ return Female ? VendorShoeType.ThighBoots : VendorShoeType.Boots; }
        }

        public override int GetShoeHue()
        {
            return 0;
        }

        public override void InitOutfit()
        {
            base.InitOutfit();

            AddItem( Utility.RandomBool() ? (Item)new QuarterStaff() : (Item)new ShepherdsCrook() );
        }

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

        public override bool OnDragDrop( Mobile from, Item dropped )
        {
            if ( dropped is PetClaimTicket )
            {
                PetClaimTicket pct = (PetClaimTicket)dropped;
                if ( pct.Time <= DateTime.Now )
                {
                    if ( pct.Pet == null )
                    {
                        from.SendMessage( "Error! Contact Gamemaster" );
                        return false;
                    }
                    else if ( from.Followers == 0 )
                    {
                        Type pettype = pct.Pet.GetType();
                        BaseCreature bc = (BaseCreature)pct.Pet;

                        bc.IsStabled = true;
                        from.Stabled.Add( bc );
                        this.SayTo( from, "I have put your pet that was mating in the stable under you name." );

                        BaseCreature baby = null;

                        if ( pettype != null )
                        {
                            object o = Activator.CreateInstance( pettype );
                                baby = o as BaseCreature;
                        }

                        if ( baby == null )
                        {
                            from.SendMessage( 38, "There was an internal error and breeding has failed due to lack of type, Please contact a member of the staff." );
                            return false;
                        }
                        else
                        {
                            if ( from == pct.Owner )
                            {
                                if ( Banker.Withdraw( from, pct.Price ) )
                                {
                                    from.SendLocalizedMessage( 1060398, pct.Price.ToString() );
                                    from.SendLocalizedMessage( 1060022, Banker.GetBalance( from ).ToString() );

                                    baby.Str = pct.Str;
                                    baby.Dex = pct.Dex;
                                    baby.Int = pct.Int;
                                    baby.HitsMaxSeed = pct.Hits;
                                    baby.StamMaxSeed = pct.Stam;
                                    baby.ManaMaxSeed = pct.Mana;
                                    baby.PhysicalResistanceSeed = pct.Phys;
                                    baby.FireResistSeed = pct.Fire;
                                    baby.ColdResistSeed = pct.Cold;
                                    baby.EnergyResistSeed = pct.Nrgy;
                                    baby.PoisonResistSeed = pct.Pois;
                                    baby.DamageMin = pct.Dmin;
                                    baby.DamageMax = pct.Dmax;
                                    baby.MaxLevel = pct.Mlev;
                                    baby.Generation = pct.Gen + 1;

                                        baby.Controlled = true;
                                        baby.ControlMaster = from;
                                        baby.Location = from.Location;
                                    baby.ControlOrder = OrderType.Follow;
                                    baby.ControlTarget = from;
                                        baby.Map = from.Map;
                                    baby.Name = baby.Name + " baby";

                                    if ( pct.AI == 1 )
                                        baby.AI = AIType.AI_Mage;
                                    else if ( pct.AI == 2 )
                                        baby.AI = AIType.AI_Melee;

                                        World.AddMobile( baby );

                                    pct.Delete();

                                    return true;
                                }
                                else
                                {
                                    this.SayTo( from, "Hey! you tring to cheat me! This anit for free buddy." );
                                    from.SendMessage( "You lack the gold in your banking account to do this." );
                                    return false;
                                }
                            }
                            else
                            {
                                this.SayTo( from, "You are not the owner of this deed." );
                                return false;
                            }
                        }
                    }
                    else
                    {
                        this.SayTo( from, "Please stable or shrink all your pets before we go on." );
                        return false;
                    }
                }
                else
                {
                    if ( pct.Pet != null )
                    {
                        this.SayTo( from, "Your pet {0} is not done mating yet, Please check back later.", pct.Pet.Name );
                        return false;
                    }
                    else
                    {
                        from.SendMessage( "Error in your (Pet Claim Ticket) please contact the staff." );
                        return false;
                    }
                }
            }
            else
            {
                return false;
            }

        }

        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();
        }
    }
}
Code:
Errors:
+ Customs/FSATS_Gen2_SVN/Advanced Pet System/Mobiles/AnimalBreeder.cs:
    CS1715: Line 15: 'Server.Mobiles.AnimalBreeder.SBInfos': type must be 'Syste
m.Collections.Generic.List<Server.Mobiles.SBInfo>' to match overridden member 'S
erver.Mobiles.BaseVendor.SBInfos'
    CS0534: Line 12: 'Server.Mobiles.AnimalBreeder' does not implement inherited
abstract member 'Server.Mobiles.BaseVendor.SBInfos.get'
Did a clean install of FS Taming, copied over all the distros correctly, then on start of server got this error with the AnimalBreeder.cs file.

Here is script:
 

Hammerhand

Knight
Change the
Code:
        private ArrayList m_SBInfos = new ArrayList();
        protected override ArrayList SBInfos{ get { return m_SBInfos; } }

to
Code:
        private List<SBInfo> m_SBInfos = new List<SBInfo>();
        protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }

See if that helps.
 

Ruined_Xz

Wanderer
Code:
Errors:
+ Customs/FSATS_Gen2_SVN/Advanced Pet System/Mobiles/AnimalBreeder.cs:
    CS0246: Line 19: The type or namespace name 'List' could not be found (are y
ou missing a using directive or an assembly reference?)
    CS0246: Line 20: The type or namespace name 'List' could not be found (are y
ou missing a using directive or an assembly reference?)

Now it's saying that List isn't declared anywhere.
 

Ruined_Xz

Wanderer
Code:
using System;
using System.Collections;
using System.Collections.Generic;
using Server;
using Server.Gumps;
using Server.Network;
using Server.Menus;
using Server.Menus.Questions;
using Server.Mobiles;
using Server.Targeting;
 
namespace Server.Items
{
      public class PetPowerScroll : Item
      {

        private SkillName m_Skill;
        private double m_Value;

        private static SkillName[] m_Skills = new SkillName[]
            {
                SkillName.Magery,
                SkillName.EvalInt,
                SkillName.Meditation,
                SkillName.MagicResist,
                SkillName.Tactics,
                SkillName.Wrestling,
                SkillName.Anatomy
            };

        public static SkillName[] Skills{ get{ return ( m_Skills ); } }

        [CommandProperty( AccessLevel.GameMaster )]
        public SkillName Skill
        {
            get
            {
                return m_Skill;
            }
            set
            {
                m_Skill = value;
            }
        }

        [CommandProperty( AccessLevel.GameMaster )]
        public double Value
        {
            get
            {
                return m_Value;
            }
            set
            {
                m_Value = value;
            }
        }

        public static PetPowerScroll CreateRandom( int min, int max )
        {
            min /= 5;
            max /= 5;

            SkillName[] skills = PowerScroll.Skills;

            return new PetPowerScroll( skills[Utility.Random( skills.Length )], 100 + (Utility.RandomMinMax( min, max ) * 5));
        }

              [Constructable]
              public PetPowerScroll( SkillName skill, double value ) : base( 0x14F0 )
              {
            base.Hue = 0x481;
            base.Weight = 1.0;

            LootType = LootType.Cursed;
            Name = "a pet power scroll";

            m_Skill = skill;
            m_Value = value;
              }

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

            list.Add( 1060663, "{0}\t{1}", m_Skill, m_Value );
        }

              public PetPowerScroll( Serial serial ) : base( serial )
              {
              }
              public override void OnDoubleClick( Mobile from )
              {

            if ( !IsChildOf( from.Backpack ) )
            {
                from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
            }
            else if( from.InRange( this.GetWorldLocation(), 1 ) )
            {

                    from.SendMessage( "What pet would you like to use this on?" );
                      from.Target = new PSTarget( this, m_Skill, m_Value );

            }
            else
            {
                from.SendLocalizedMessage( 500446 ); // That is too far away.
            }

              }

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

                writer.Write( (int) 0 );

            writer.Write( (int) m_Skill );
            writer.Write( (double) m_Value );

              }

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

                int version = reader.ReadInt();

            switch ( version )
            {

                case 0:
                {
                    m_Skill = (SkillName)reader.ReadInt();
                    m_Value = reader.ReadDouble();
                    break;
                }

            }
              }
 
          private class PSTarget : Target
              {
                private Mobile m_Owner;

                private PetPowerScroll m_Powder;
            private SkillName m_Skill;
            private double m_Value;

                public PSTarget( PetPowerScroll charge, SkillName skill, double value ) : base ( 10, false, TargetFlags.None )
                {
                        m_Powder = charge;
                        m_Skill = skill;
                        m_Value = value;
                }

                protected override void OnTarget( Mobile from, object target )
                {

                        if( target == from )
                              from.SendMessage( "You cant do that." );

                      else if( target is BaseCreature )
                      {

                          BaseCreature c = (BaseCreature)target;
                    if( c.Controlled == false )
                    {
                        from.SendMessage( "That Creature is not tamed." );
                    }
                    else if( c.ControlMaster != from )
                    {
                        from.SendMessage( "This is not your pet." );
                    }

                    else if ( c.Controlled == true && c.ControlMaster == from)
                    {
                        Skill skill = c.Skills[m_Skill];

                        if ( skill != null )
                        {
                            if ( skill.Cap >= m_Value )
                            {
                                from.SendMessage( "Your pets {0} is to high for this powerscroll.", m_Skill );
                            }
                            else
                            {
                                from.SendMessage( "Your pets {0} has been caped at {1}.", m_Skill, m_Value );

                                skill.Cap = m_Value;

                                Effects.SendLocationParticles( EffectItem.Create( c.Location, c.Map, EffectItem.DefaultDuration ), 0, 0, 0, 0, 0, 5060, 0 );
                                Effects.PlaySound( from.Location, from.Map, 0x243 );

                                Effects.SendMovingParticles( new Entity( Serial.Zero, new Point3D( c.X - 6, from.Y - 6, c.Z + 15 ), c.Map ), c, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100 );
                                Effects.SendMovingParticles( new Entity( Serial.Zero, new Point3D( c.X - 4, from.Y - 6, c.Z + 15 ), c.Map ), c, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100 );
                                Effects.SendMovingParticles( new Entity( Serial.Zero, new Point3D( c.X - 6, from.Y - 4, c.Z + 15 ), c.Map ), c, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100 );

                                Effects.SendTargetParticles( c, 0x375A, 35, 90, 0x00, 0x00, 9502, (EffectLayer)255, 0x100 );
                                        m_Powder.Delete();
                            }
                        }
                    }
                        }
                }
              }
      }
}
Code:
Errors:
+ Customs/FSATS_Gen2_SVN/Animal Taming BODs/Rewards/Pet Power Scrolls/PetPowerS
croll.cs:
    CS0029: Line 65: Cannot implicitly convert type 'System.Collections.Generic.
List<Server.SkillName>' to 'Server.SkillName[]'
Solved most of my issues, except this error keeps popping up.

Here is script:
 

milva

Sorceror
Did you try removing the using System.Collections.Generic;- from the top of the petpowerscroll? because in mine it does not have that only -using System.Collections;
but which runuo are you running? Final or Rc2?
 

Ruined_Xz

Wanderer
Yea, I just removed it and tried recompiling the server. No dice, same issue still. I am running the latest SVN Version which I think is revision 665?
 

Hammerhand

Knight
Ok, we had to deal with this same error.. around line 64 look for these lines & remove them.
Code:
            SkillName[] skills = PowerScroll.Skills;

            return new PetPowerScroll(skills[Utility.Random(skills.Length)], 100 + (Utility.RandomMinMax(min, max) * 5));
Replace them with this..
Code:
            return new PetPowerScroll( m_Skills[ Utility.Random( m_Skills.Length ) ], 100 + (Utility.RandomMinMax( min, max ) * 5));
May get new errors afterwards from other scripts, I dont remember, but this should help and I may be able to help with others.
 

Pakko

Traveler
WOOOOHOOO THANKS FOR THE FIXTURE ON ME SCRIPTURE "HEHEHEHE" I FAILED FOR # DAYS ON # SIMPLE ENOUGH TO FIX ERRORS NOW I HAVE A MASTER PIECE IN MY HANDS MWAHAHAHA!!!!!!!!! TANKS AGAIN GUYS!!
 

Jay Randolph

Traveler
I was wondering if anyone would know why, or in what script, it would make me start getting an error to delete mobiles after I finally got the FSATS installed?
 
Check your deserialize and serialize in basecreature and playermobile and make sure everything deserializes and serializes in the correct order and that your version numbers are right.
 

Jay Randolph

Traveler
Check your deserialize and serialize in basecreature and playermobile and make sure everything deserializes and serializes in the correct order and that your version numbers are right.

If I post my basecreature and playermobile could you possibly help me locate any issue? I have been looking at the FSATS thread and comparing my 2 files with every basecreature and playermobile file posted on there.
 

Grimm S

Sorceror
RunUO - [www.runuo.com] Version 2.1, Build 4272.35047
Core: Running on .NET Framework Version 2.0.50727
Core: Optimizing for 4 64-bit processors
Scripts: Compiling C# scripts...done (cached)
Scripts: Skipping VB.NET Scripts...done (use -vb to enable)
Scripts: Verifying...done (3261 items, 850 mobiles) (1.16 seconds)
Regions: Loading...done
World: Loading...An error was encountered while loading a saved object
- Type: Server.Mobiles.PlayerMobile
- Serial: 0x00000001
Delete the object? (y/n)


Getting asked to delete objects after starting my new server. Im using runuo 2.2 with neruns edits. I also have winmerged all the fsats distros. Hoping someone else ran into this. If so can you help. i uploaded both files below with my merges. Thank you in advance
 

Attachments

  • BaseCreature.cs
    144 KB · Views: 3
  • PlayerMobile.cs
    112.2 KB · Views: 9

daat99

Moderator
Staff member
You need to make sure you "deserialize" (read) exactly what you "serialized" (saved) before you restarted your server.

These errors are usually due to bad deserialization order.
 

Grimm S

Sorceror
You need to make sure you "deserialize" (read) exactly what you "serialized" (saved) before you restarted your server.

These errors are usually due to bad deserialization order.

I have winmerged these files to death. I'mnot really sure what deserialized and serialized is. Can Someone help
 
Top