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!

[RunUO 2.0 RC1] Xanthos Shrink System

nadious

Sorceror
Can't figure this one out... maybe someone can tell me what I'm doing wrong. I'm trying to add the Pet Leash to the SBAnimalTrainer but I keep getting the following error:

Code:
Errors:
+ Mobiles/Vendors/SBInfo/SBAnimalTrainer.cs:
    CS0246: Line 26: The type or namespace name 'PetLeash' could not be found (a
re you missing a using directive or an assembly reference?)

I thought I knew how to fix it, by making sure I had the right 'using.' entries that the PetLeash script uses, but even that is not working. Any ideas? Here are both of my scripts:

PetLeash.cs
Code:
#region AuthorHeader
//
//    Shrink System version 2.1, by Xanthos
//
//
#endregion AuthorHeader
using System;
using Server;
using Server.Items;
using Server.Mobiles;
using Xanthos.Interfaces;
 
namespace Xanthos.ShrinkSystem
{
    public class PetLeash : Item, IShrinkTool
    {   
        private int m_Charges = ShrinkConfig.ShrinkCharges;
 
        [CommandProperty( AccessLevel.GameMaster )]
        public int ShrinkCharges
        {
            get { return m_Charges; }
            set
            {
                if ( 0 == m_Charges || 0 == (m_Charges = value ))
                    Delete();
                else
                    InvalidateProperties();
            }
        }
 
        [Constructable]
        public PetLeash() : base( 0x1374 )
        {
            Weight = 1.0;
            Movable = true;
            Name = "Pet Leash";
            LootType = ( ShrinkConfig.BlessedLeash ? LootType.Blessed : LootType.Regular );
        }
 
        public PetLeash( Serial serial ) : base( serial )
        {
        }
 
        public override void AddNameProperties( ObjectPropertyList list )
        {
            base.AddNameProperties( list );
 
            if ( m_Charges >= 0 )
                list.Add( 1060658, "Charges\t{0}", m_Charges.ToString() );
        }
 
        public override void OnDoubleClick( Mobile from )
        {
            bool isStaff = from.AccessLevel != AccessLevel.Player;
 
            if ( !IsChildOf( from.Backpack ) )
                from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
 
            else if ( isStaff || from.Skills[ SkillName.AnimalTaming ].Value >= ShrinkConfig.TamingRequired )
                from.Target = new ShrinkTarget( from, this, isStaff );
            else
                from.SendMessage( "You must have at least " + ShrinkConfig.TamingRequired + " animal taming to use a pet leash." );
        }
 
        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );
            writer.Write( (int) 0 );
            writer.Write( m_Charges );
        }
 
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );
            int version = reader.ReadInt();
            m_Charges = reader.ReadInt();
        }
    }
}

SBAnimalTrainer.cs
Code:
using System;
using System.Collections.Generic;
using Server.Items;
using Server;
using Xanthos.Interfaces; // Pet Leash
using Server.Mobiles;
 
namespace Server.Mobiles
{
    public class SBAnimalTrainer : SBInfo
    {
        private List<GenericBuyInfo> m_BuyInfo = new InternalBuyInfo();
        private IShopSellInfo m_SellInfo = new InternalSellInfo();
 
        public SBAnimalTrainer()
        {
        }
 
        public override IShopSellInfo SellInfo { get { return m_SellInfo; } }
        public override List<GenericBuyInfo> BuyInfo { get { return m_BuyInfo; } }
 
        public class InternalBuyInfo : List<GenericBuyInfo>
        {
            public InternalBuyInfo()
            {
                Add( new GenericBuyInfo( typeof (PetLeash), 500, 20, 0x0137, 0)); // Pet Leash
                Add( new AnimalBuyInfo( 1, typeof( Cat ), 132, 10, 201, 0 ) );
                Add( new AnimalBuyInfo( 1, typeof( Dog ), 170, 10, 217, 0 ) );
                Add( new AnimalBuyInfo( 1, typeof( Horse ), 550, 10, 204, 0 ) );
                Add( new AnimalBuyInfo( 1, typeof( PackHorse ), 631, 10, 291, 0 ) );
                Add( new AnimalBuyInfo( 1, typeof( PackLlama ), 565, 10, 292, 0 ) );
                Add( new AnimalBuyInfo( 1, typeof( Rabbit ), 106, 10, 205, 0 ) );
 
                if( !Core.AOS )
                {
                    Add( new AnimalBuyInfo( 1, typeof( Eagle ), 402, 10, 5, 0 ) );
                    Add( new AnimalBuyInfo( 1, typeof( BrownBear ), 855, 10, 167, 0 ) );
                    Add( new AnimalBuyInfo( 1, typeof( GrizzlyBear ), 1767, 10, 212, 0 ) );
                    Add( new AnimalBuyInfo( 1, typeof( Panther ), 1271, 10, 214, 0 ) );
                    Add( new AnimalBuyInfo( 1, typeof( TimberWolf ), 768, 10, 225, 0 ) );
                    Add( new AnimalBuyInfo( 1, typeof( Rat ), 107, 10, 238, 0 ) );
                }
                   
            }
        }
 
        public class InternalSellInfo : GenericSellInfo
        {
            public InternalSellInfo()
            {
            }
        }
    }
}
 

alchimysty

Wanderer
this one works fine for me on 2.2

I've got a an install of runuo 2.2 with neruns distro amongst some other odds and ends and i'm running into some issues getting this going. Any ideas what might be going on with the two errors?

-Alch

Code:
RunUO - [www.runuo.com] Version 2.2, Build 4425.25303
Core: Running on .NET Framework Version 2.0.50727
Core: Optimizing for 8 64-bit processors
Scripts: Compiling C# scripts...failed (2 errors, 11 warnings)
Warnings:
+ Customs/Stargate System v3/Addons/SGLocationAddon1East.cs:
    CS0105: Line 2: The using directive for 'System' appeared previously in this
namespace
+ Customs/Stargate System v3/Addons/SGLocationAddon1South.cs:
    CS0105: Line 2: The using directive for 'System' appeared previously in this
namespace
+ Customs/Stargate System v3/Addons/SGLocationAddon2East.cs:
    CS0105: Line 2: The using directive for 'System' appeared previously in this
namespace
+ Customs/Stargate System v3/Addons/SGLocationAddon2South.cs:
    CS0105: Line 2: The using directive for 'System' appeared previously in this
namespace
+ Customs/Stargate System v3/Addons/SGLocationAddon3East.cs:
    CS0105: Line 2: The using directive for 'System' appeared previously in this
namespace
+ Customs/Stargate System v3/Addons/SGLocationAddon3South.cs:
    CS0105: Line 2: The using directive for 'System' appeared previously in this
namespace
+ Customs/Corpse Retrieval System/CorpseRetrievalPackage.cs:
    CS0114: Line 66: 'Server.CorpseSystem.CorpseMinion.IsInvulnerable' hides inh
erited member 'Server.Mobiles.BaseVendor.IsInvulnerable'. To make the current me
mber override that implementation, add the override keyword. Otherwise add the n
ew keyword.
+ Misc/AutoSave.cs:
    CS0108: Line 33: 'Server.Misc.AutoSave.Delay' hides inherited member 'Server
.Timer.Delay'. Use the new keyword if hiding was intended.
+ Customs/Autosave/AutoSaveSettings.cs:
    CS0472: Line 141: The result of the expression is always 'false' since a val
ue of type 'Server.AccessLevel' is never equal to 'null' of type 'Server.AccessL
evel?'
    CS0162: Line 138: Unreachable code detected
    CS0162: Line 140: Unreachable code detected
    CS0162: Line 142: Unreachable code detected
+ Customs/Knives Chat 3.0 Beta 9/General/MultiConnection.cs:
    CS0168: Line 65: The variable 'e' is declared but never used
    CS0168: Line 134: The variable 'e' is declared but never used
    CS0168: Line 165: The variable 'e' is declared but never used
    CS0168: Line 184: The variable 'e' is declared but never used
    CS0168: Line 201: The variable 'e' is declared but never used
    CS0168: Line 252: The variable 'e' is declared but never used
+ Customs/Knives Chat 3.0 Beta 9/Gumps/Error Reporting/Errors.cs:
    CS0618: Line 91: 'System.Web.Mail.MailMessage' is obsolete: 'The recommended
alternative is System.Net.Mail.MailMessage. http://go.microsoft.com/fwlink/?lin
kid=14202'
    CS0618: Line 91: 'System.Web.Mail.MailMessage' is obsolete: 'The recommended
alternative is System.Net.Mail.MailMessage. http://go.microsoft.com/fwlink/?lin
kid=14202'
    CS0618: Line 102: 'System.Web.Mail.SmtpMail' is obsolete: 'The recommended a
lternative is System.Net.Mail.SmtpClient. http://go.microsoft.com/fwlink/?linkid
=14202'
Errors:
+ Customs/Xanthos/Shrink System/ShrinkCommand.cs:
    CS1502: Line 141: The best overloaded method match for 'Server.ISpawner.Remo
ve(Server.ISpawnable)' has some invalid arguments
    CS1503: Line 141: Argument '1': cannot convert from 'Xanthos.ShrinkSystem.Sh
rinkTarget' to 'Server.ISpawnable'
+ Customs/Xanthos/Utilities/motd.cs:
    CS0019: Line 481: Operator '&' cannot be applied to operands of type 'Server
.ClientFlags' and 'int'
    CS0019: Line 481: Operator '&' cannot be applied to operands of type 'Server
.ClientFlags' and 'int'
    CS0019: Line 481: Operator '&' cannot be applied to operands of type 'Server
.ClientFlags' and 'int'
    CS0019: Line 481: Operator '&' cannot be applied to operands of type 'Server
.ClientFlags' and 'int'
    CS0019: Line 481: Operator '&' cannot be applied to operands of type 'Server
.ClientFlags' and 'int'
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.
 

nadious

Sorceror
Try putting:

using Xanthos.ShrinkSystem;

in sbanimaltrainer.cs
See if that works.

Thanks, Alpha. I'll give that a shot. I didn't even think about that. If I was a little more knowledgeable about scripting, I would have probably figured that out by now.
 

AlphaDragon

Sorceror
LOL:p I am definatly a long way from being a scripter. But as we all do.. We learn as we go! And to help eachother the best we can will make things a lot easier for us all. Even if its the little things that we may overlook. We all do that at one time or another. ;)
 
Top