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

AlphaDragon

Sorceror
Great System

BTW for those of you that get the little ball for a shrunken pet here is an example how to make it all work.
Code:
#ME Mobiles

265 0x2D8B
this is the code for a hydra the 265 is its body code and the 0x2D8B is the item id (don't forget to TAB from the body code to the item id! Have fun everyone!

Just a note for the new people or ones learning, the file to edit is Shrink.cfg. I found it located in the Data folder.
 

tass23

Page
For those that are still having issues with shrunken pets showing up as "A Shrunken Pet", make sure your public bool IsStatuette looks like this:
Code:
  [CommandProperty( AccessLevel.GameMaster )]
  public bool IsStatuette
  {
   get { return m_IsStatuette; }
   set
   {
    if ( null == ShrunkenPet )
    {
     ItemID = 0xFAA;
     Name = "unlinked shrink item!";
    }
    else if ( m_IsStatuette = value )
    {
     ItemID = ShrinkTable.Lookup( m_Pet );
     Name = m_Name + "a shrunken pet";
    }
    else
    {
     ItemID = 0x14EF;
     Name = "a pet deed";
    }
   }
  }
 
Did anyone ever figure out why pets suddenly dissapear and you get that message "Your pet has lost forever due to unforseen circumstances" when double clicking the shrunk item?

This has happened to three pets on my shard, usually older pets, but it's very frustrating, especially as people spend time training them up
 

Pure Insanity

Sorceror
Someone could of cleaned it off the InternalMap (tons of stuff that try to "clean" the internal map) or something else. Tracking down the specific issue would be a fun journey. Would be easier to simply store the pets in your own temp database or something, too much stuff tries to rely on storing stuff on the internal map...pretty bad practices.
 

AlphaDragon

Sorceror
For those that are still having issues with shrunken pets showing up as "A Shrunken Pet", make sure your public bool IsStatuette looks like this:
Code:
  [CommandProperty( AccessLevel.GameMaster )]
  public bool IsStatuette
  {
  get { return m_IsStatuette; }
  set
  {
    if ( null == ShrunkenPet )
    {
    ItemID = 0xFAA;
    Name = "unlinked shrink item!";
    }
    else if ( m_IsStatuette = value )
    {
    ItemID = ShrinkTable.Lookup( m_Pet );
    Name = m_Name + "a shrunken pet";
    }
    else
    {
    ItemID = 0x14EF;
    Name = "a pet deed";
    }
  }
  }
Tried doing it that way but the name still didnt show up. instead of using m_Name I used m_Pet.Name and it worked fine for me, seems the m_Name doesnt get defined till later on in the script.
Code:
        [CommandProperty( AccessLevel.GameMaster )]
        public bool IsStatuette
        {
            get { return m_IsStatuette; }
            set
            {
                if ( null == ShrunkenPet )
                {
                    ItemID = 0xFAA;
                    Name = "unlinked shrink item!";
                }
                else if ( m_IsStatuette = value )
                {
                    ItemID = ShrinkTable.Lookup( m_Pet );
                    Name = m_Pet.Name + ": a shrunken pet";
                }
                else
                {
                    ItemID = 0x14EF;
                    Name = "a pet deed";
                }
            }
        }
 
Someone could of cleaned it off the InternalMap (tons of stuff that try to "clean" the internal map) or something else. Tracking down the specific issue would be a fun journey. Would be easier to simply store the pets in your own temp database or something, too much stuff tries to rely on storing stuff on the internal map...pretty bad practices.

Possibly, not sure, the last pet dissapeared tonight, it was an Evo Dragon sort, so something that comes with the shrink system I have installed.
Probably going to replace the leashes with stable stones, seems safer.
 

smoknaces21

Wanderer
I get this error.

Errors:
Customs/Xanthos/Utilities/Motd.cs
CS0019: Line 481 Operator '&' cannot be applied to operands of type 'server.clientflags' and 'int'

Any suggestions? new to programming and not sure where to edit. Thanks
 

smoknaces21

Wanderer
Line 481 looks like this

AddLabel( 205, 180, NewsGump.kDataColor, (( state.Flags & 0x10 ) != 0 ) ? "Samurai Empire" : (( state.Flags & 0x08 ) != 0) ? "Age of Shadows" : (( state.Flags & 0x04 ) != 0) ? "Blackthorn's Revenge" : (( state.Flags & 0x02 ) != 0 ) ? "Third Dawn" : (( state.Flags & 0x01 ) != 0 ) ? "Renaissance" : "The Second Age" );

Could it be the wrong client version or something?
 

tass23

Page
It's the and between state.Flags & 0x10 that it's throwing a fit about. I don't use Xanthos MotD, I disabled it. It's not going to hurt anything if you disable it. It's just a message of the day thing.
 

chaddd

Sorceror
If you wanted to use the MOTD you would just replace:

Code:
AddLabel( 205, 180, NewsGump.kDataColor, (( state.Flags & 0x10 ) != 0 ) ? "Samurai Empire" : (( state.Flags & 0x08 ) != 0) ? "Age of Shadows" : (( state.Flags & 0x04 ) != 0) ? "Blackthorn's Revenge" : (( state.Flags & 0x02 ) != 0 ) ? "Third Dawn" : (( state.Flags & 0x01 ) != 0 ) ? "Renaissance" : "The Second Age" );

With this:

Code:
AddLabel( 205, 180, NewsGump.kDataColor, (( state.Flags & ClientFlags.Tokuno ) != 0 ) ? "Samurai Empire" : (( state.Flags & ClientFlags.Malas ) != 0) ? "Age of Shadows" : (( state.Flags & ClientFlags.Ilshenar ) != 0) ? "Blackthorn's Revenge" : (( state.Flags & ClientFlags.Trammel ) != 0 ) ? "Third Dawn" : (( state.Flags & ClientFlags.Felucca ) != 0 ) ? "Renaissance" : "The Second Age" );
 

tristem

Sorceror
OK so I know that this is an older thread and system. I have a working shrink potion that works with this system flawlessly. I'm going to try to change it so that its a base potion and not base item, I want this to work similar to normal potions, ie fill kegs, stack etc. I take no cred for this script it is slopped together from several other posts to make it work. My first attempt was based on the pet leash 2nd attempt is based on the shrink command. This came from an earlier post in this thread just played around with it tom make it work on 2.2 . Script is below for who ever is interested.

Code:
using System;
using Server.Items;
using Server.Mobiles;
using Server.Regions;
using Server.Targeting;
using Xanthos.Interfaces;
using Xanthos.ShrinkSystem;
 
namespace Server.Items
{
    public class ShrinkPotion : Item
    {
 
        [Constructable]
        public ShrinkPotion() : base( 0xF04 )
        {
            Name="a Shrink Potion";
        }
 
        public override void OnDoubleClick( Mobile from )
        {
            if ( !Movable )
                return;
            else if( from.InRange( this.GetWorldLocation(), 2 ) == false )
            {
                from.SendLocalizedMessage( 500486 );    //That is too far away.
                return;
            }
 
            Container pack = from.Backpack;
 
            if ( !(Parent == from || ( pack != null && Parent == pack )) ) //If not in pack.
            {
                from.SendLocalizedMessage( 1042001 );    //That must be in your pack to use it.
                return;
            }
            from.Target=new ShrinkPotionTarget( this );
            from.SendMessage( "What do you wish to shrink?" );
        }
 
        private class ShrinkPotionTarget : Target
        {
            private ShrinkPotion m_Potion;
 
            public ShrinkPotionTarget( Item i ) : base( 3, false, TargetFlags.None )
            {
                m_Potion=(ShrinkPotion)i;
            }
           
            protected override void OnTarget( Mobile from, object target )
        {
            BaseCreature pet = target as BaseCreature;
 
            if ( target == from )
                from.SendMessage( "You cannot shrink yourself!" );
 
            else if ( target is Item )
                from.SendMessage( "You cannot shrink that!" );
 
            else if (target is BaseEscortable)
                      from.SendMessage("That person gives you a dirty look.");
 
            else if ( target is PlayerMobile )
                from.SendMessage( "That person gives you a dirty look!" );
 
            else if ( Server.Spells.SpellHelper.CheckCombat( from ) )
                from.SendMessage( "You cannot shrink your pet while you are fighting." );
 
            else if ( null == pet )
                from.SendMessage( "That is not a pet!" );
 
            else if ( ( pet.BodyValue == 400 || pet.BodyValue == 401 ) && pet.Controlled == false )
                from.SendMessage( "That person gives you a dirty look!" );
 
            else if ( pet.IsDeadPet )
                from.SendMessage( "You cannot shrink the dead!" );
 
            else if ( pet.Summoned )
                from.SendMessage( "You cannot shrink a summoned creature!" );
 
            else if ( pet.Combatant != null && pet.InRange( pet.Combatant, 12 ) && pet.Map == pet.Combatant.Map )
                from.SendMessage( "Your pet is fighting; you cannot shrink it yet." );
 
            else if ( pet.BodyMod != 0 )
                from.SendMessage( "You cannot shrink your pet while it is polymorphed." );
 
            else if ( pet.Controlled == false )
                from.SendMessage( "You cannot not shrink wild creatures." );
 
            else if ( pet.ControlMaster != from )
                from.SendMessage( "That is not your pet." );
 
            else if ( ShrinkItem.IsPackAnimal( pet ) && ( null != pet.Backpack && pet.Backpack.Items.Count > 0 ) )
                from.SendMessage( "You must unload this pet's pack before it can be shrunk." );
 
            else if ( !(m_Potion.Deleted) )
            {
                if ( pet.ControlMaster != from && !pet.Controlled )
                {
                    SpawnEntry se = pet.Spawner as SpawnEntry;
                    if ( se != null && se.UnlinkOnTaming )
                    {
                        pet.Spawner.Remove( (ISpawnable)pet );
                        pet.Spawner = null;
                    }
 
                    pet.CurrentWayPoint = null;
                    pet.ControlMaster = from;
                    pet.Controlled = true;
                    pet.ControlTarget = null;
                    pet.ControlOrder = OrderType.Come;
                    pet.Guild = null;
                    pet.Delta( MobileDelta.Noto );
                }
 
                IEntity p1 = new Entity( Serial.Zero, new Point3D( from.X, from.Y, from.Z ), from.Map );
                IEntity p2 = new Entity( Serial.Zero, new Point3D( from.X, from.Y, from.Z + 50 ), from.Map );
 
                Effects.SendMovingParticles( p2, p1, ShrinkTable.Lookup( pet ), 1, 0, true, false, 0, 3, 1153, 1, 0, EffectLayer.Head, 0x100 );
                from.PlaySound( 492 );
                from.AddToBackpack( new ShrinkItem( pet ) );
                m_Potion.Delete();
 
            }
            return;
        }
    }
 
        #region Serialization
        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );
 
            writer.Write( (int) 0 ); // version
        }
 
        public ShrinkPotion( Serial serial ) : base( serial )
        {
        }
 
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );
 
            int version = reader.ReadInt();
        }
        #endregion
    }
}
 

tristem

Sorceror
No idea with why it does it, it appeasers to be an unfortunate side effect of the shrink function. The old shrink system that I used from Tru part of the Lost Alchemy system had the same issues. It appears to be sometimes shrunken pest become orphaned in the array/lists and when the global cleanup runs they get deleted. I've seen this happen with bank boxes and bank box items as well. Sorry I couldn't offer any additional in-site into this for you.
 

JamzeMcC

Squire
Ive been having problems with "Your pet is lost forever" what the hells with that? :(

This here I ran in to a few times when a player puts his pet up while its in the unhappy stage. It cannot be called due to that. At one time I added a bc.Loyalty = 100 check in to it but then decided it was up to the players to keep their pets happy, as in real life. I just made sure I had it posted on my site and forums.
 

tristem

Sorceror
These errorshave been answered already. Please look about halfway down on page 5 for the MOTD fix and about 3/4 of the way down on page 4 for the fix for shrink command.

These errors are caused from version diffs in RunUO and are easy to update.
 
Top