eugenesa

Member
Modified humanoid monster to be tameable

I want to open the PaperDoll of the tamed humanoid monster and modify the equipment so that it can be changed

It's hard for me.

Where can I fix it?
 
The client decides which BodyValues can be opened in the paperdoll window.

Other than the ones used by players (400/401) and the gargoyle and elven equivalents, only bodies 183 and 184 have viewable paperdolls.
 
Make them human and override a BodyMod on them.
See how transformation spells do that trick and experiment.
 
13659
player

There is tamed npc Do not clothe or change equipment ...


13660
- admin-
The general user wants to be able to change the equipment to the tame pet like the image above.
admin is possible

What can I do to make the player available?
 
Last edited:
Ohhh i see what you mean now...
Here is some code:

C#:
public override bool IsSnoop( Mobile from )
        {
            if ( PackAnimal.CheckAccess( this, from ) )
                return false;

            return base.IsSnoop( from );
        }

        public override bool OnDragDrop( Mobile from, Item item )
        {
            if ( CheckFeed( from, item ) )
                return true;

            if ( PackAnimal.CheckAccess( this, from ) )
            {
                AddToBackpack( item );
                return true;
            }

            return base.OnDragDrop( from, item );
        }

        public override bool CheckNonlocalDrop( Mobile from, Item item, Item target )
        {
            return PackAnimal.CheckAccess( this, from );
        }

        public override bool CheckNonlocalLift( Mobile from, Item item )
        {
            return PackAnimal.CheckAccess( this, from );
        }

        public override void GetContextMenuEntries( Mobile from, List<ContextMenuEntry> list )
        {
            base.GetContextMenuEntries( from, list );

            PackAnimal.GetContextMenuEntries( this, from, list );
        }

The code above should give you access to the backpack as well as the paperdoll.

You might need this at the top:

using Server.ContextMenus;
 
Ohhh i see what you mean now...
Here is some code:

C#:
public override bool IsSnoop( Mobile from )
        {
            if ( PackAnimal.CheckAccess( this, from ) )
                return false;

            return base.IsSnoop( from );
        }

        public override bool OnDragDrop( Mobile from, Item item )
        {
            if ( CheckFeed( from, item ) )
                return true;

            if ( PackAnimal.CheckAccess( this, from ) )
            {
                AddToBackpack( item );
                return true;
            }

            return base.OnDragDrop( from, item );
        }

        public override bool CheckNonlocalDrop( Mobile from, Item item, Item target )
        {
            return PackAnimal.CheckAccess( this, from );
        }

        public override bool CheckNonlocalLift( Mobile from, Item item )
        {
            return PackAnimal.CheckAccess( this, from );
        }

        public override void GetContextMenuEntries( Mobile from, List<ContextMenuEntry> list )
        {
            base.GetContextMenuEntries( from, list );

            PackAnimal.GetContextMenuEntries( this, from, list );
        }

The code above should give you access to the backpack as well as the paperdoll.

You might need this at the top:

using Server.ContextMenus;
Thank you!!!!!

Thank you Use of backpacks of tamed monsters is now possible

How do I change the item equipment?
 
Last edited:
Sorry, i missed that function:
C#:
public override bool AllowEquipFrom( Mobile from )
        {
            if (ControlMaster != null && ControlMaster == from)
                return true;
            else if (from.AccessLevel >= AccessLevel.GameMaster)
                return true;
            else if (from.BodyValue == 0x190 || from.BodyValue == 0x191)
                return true;
            else
                return false;
        }

You might want to get rid of the bodyvalue check, not sure why i had that check initially.
 
Be sure to include a tamed/ownership check or you'll have players stripping the "untamed" NPCs left and right!

Bio humans (aka Mercenaries) do it via their own BaseBioCreature that looks at what you're drag/dropping and decides accordingly what to do. This is also the reason the items must be removed by the "undress" command that puts all gear into their pack.

Code:
        public override bool OnDragDrop( Mobile from, Item item )
        {
            if ( CheckFeed( from, item ) )
                return true;

            if ( this.BodyValue == 400 || this.BodyValue == 401 && from == this.ControlMaster )
            {
                if ( item is BaseClothing && from == this.ControlMaster )
                {
                    BaseClothing bc = (BaseClothing)item;
                    Item equ = this.FindItemOnLayer( bc.Layer );
                    
                    if ( bc.LootType == LootType.Blessed || bc.LootType == LootType.Newbied )
                        from.SendMessage( 53, "WARNING!!! If your pet dies while holding a blessed, insured, or newbied item. It will be lost forever." );

                    if ( equ != null)
                        from.AddToBackpack( equ );

                    this.EquipItem( bc );
                    this.CheckResistances();

                    return true;
                    
                }
                else if ( item is BaseArmor && from == this.ControlMaster )
                {
                    BaseArmor ba = (BaseArmor)item;

                    Item equ = this.FindItemOnLayer( ba.Layer );

                    if ( ba.LootType == LootType.Blessed || ba.LootType == LootType.Newbied )
                        from.SendMessage( 53, "WARNING!!! If your pet dies while holding a blessed, insured, or newbied item. It will be lost forever." );

                    if ( equ != null)
                        from.AddToBackpack( equ );

                    if ( this.Str <= ba.StrRequirement )
                    {
                        from.SendMessage( "Your pet is not strong enough to wear this." );
                        from.AddToBackpack( ba );
                    }
                    else
                    {
                        this.EquipItem( ba );
                        this.CheckResistances();
                    }

                    return true;
                }
                else if ( item is BaseWeapon && from == this.ControlMaster )
                {
                    BaseWeapon bw = (BaseWeapon)item;

                    Item weap = this.FindItemOnLayer( Layer.OneHanded );
                    Item shield = this.FindItemOnLayer( Layer.TwoHanded );

                    if ( bw.LootType == LootType.Blessed || bw.LootType == LootType.Newbied )
                        from.SendMessage( 53, "WARNING!!! If your pet dies while holding a blessed, insured, or newbied item. It will be lost forever." );

                    if ( weap != null)
                        from.AddToBackpack( weap );

                    if ( shield != null)
                        from.AddToBackpack( shield );

                    if ( this.Str <= bw.StrRequirement )
                    {
                        from.SendMessage( "Your pet is not strong enough to wear this." );
                        from.AddToBackpack( bw );
                    }
                    else
                    {
                        this.EquipItem( bw );
                        this.CheckResistances();
                    }

                    this.EquipItem( bw );
                    
                    return true;
                }
                else if ( item is BaseJewel && from == this.ControlMaster )
                {
                    BaseJewel bj = (BaseJewel)item;

                    Item equ = this.FindItemOnLayer( bj.Layer );

                    if ( bj.LootType == LootType.Blessed || bj.LootType == LootType.Newbied )
                        from.SendMessage( 53, "Warning: The item you have droped on your pet is either blessed or newbied. If this pet is unbonded and dies you will lose this item." );

                    if ( equ != null)
                        from.AddToBackpack( equ );

                    this.EquipItem( bj );
                    this.CheckResistances();
    
                    return true;
                }
                else if ( item is Lantern && from == this.ControlMaster )
                {
                    Lantern l = (Lantern)item;

                    Item equ = this.FindItemOnLayer( l.Layer );

                    if ( l.LootType == LootType.Blessed || l.LootType == LootType.Newbied )
                        from.SendMessage( 53, "Warning: The item you have droped on your pet is either blessed or newbied. If this pet is unbonded and dies you will lose this item." );

                    if ( equ != null)
                        from.AddToBackpack( equ );

                    this.EquipItem( l );
                    this.CheckResistances();
    
                    return true;
                }
                else if ( item is FishingPole && from == this.ControlMaster )
                {
                    FishingPole fp = (FishingPole)item;

                    Item equ = this.FindItemOnLayer( fp.Layer );

                    if ( fp.LootType == LootType.Blessed || fp.LootType == LootType.Newbied )
                        from.SendMessage( 53, "Warning: The item you have droped on your pet is either blessed or newbied. If this pet is unbonded and dies you will lose this item." );

                    if ( equ != null)
                        from.AddToBackpack( equ );

                    this.EquipItem( fp );
                    this.CheckResistances();
    
                    return true;
                }
                else if ( item is Torch && from == this.ControlMaster )
                {
                    Torch t = (Torch)item;

                    Item equ = this.FindItemOnLayer( t.Layer );

                    if ( t.LootType == LootType.Blessed || t.LootType == LootType.Newbied )
                        from.SendMessage( 53, "Warning: The item you have droped on your pet is either blessed or newbied. If this pet is unbonded and dies you will lose this item." );

                    if ( equ != null)
                        from.AddToBackpack( equ );

                    this.EquipItem( t );
                    this.CheckResistances();
    
                    return true;
                }
                else
                {
                    if ( PackAnimal.CheckAccess( this, from ) )
                    {
                        AddToBackpack( item );
                        return true;
                    }
                }
            }
            else
            {
                if ( PackAnimal.CheckAccess( this, from ) )
                {
                    AddToBackpack( item );
                    return true;
                }
            }

            return base.OnDragDrop( from, item );
        }

BTW Pooka - your BodyMod idea does kind-of work. I made a Brigand Troll by adding BodyMod=0x1 to the regular brigand and I got a troll that has a human paperdoll when doubleclicked. They still can't be dressed/undressed by players but it proves the client sees them as humans and not trolls. I'm sure that'll come in useful later for something!
 
Sorry, i missed that function:
C#:
public override bool AllowEquipFrom( Mobile from )
        {
            if (ControlMaster != null && ControlMaster == from)
                return true;
            else if (from.AccessLevel >= AccessLevel.GameMaster)
                return true;
            else if (from.BodyValue == 0x190 || from.BodyValue == 0x191)
                return true;
            else
                return false;
        }

You might want to get rid of the bodyvalue check, not sure why i had that check initially.
Thank you very much

I applied the code you provided.
It works without any problems.

Thank you!!
Post automatically merged:

Be sure to include a tamed/ownership check or you'll have players stripping the "untamed" NPCs left and right!

Bio humans (aka Mercenaries) do it via their own BaseBioCreature that looks at what you're drag/dropping and decides accordingly what to do. This is also the reason the items must be removed by the "undress" command that puts all gear into their pack.

Code:
        public override bool OnDragDrop( Mobile from, Item item )
        {
            if ( CheckFeed( from, item ) )
                return true;

            if ( this.BodyValue == 400 || this.BodyValue == 401 && from == this.ControlMaster )
            {
                if ( item is BaseClothing && from == this.ControlMaster )
                {
                    BaseClothing bc = (BaseClothing)item;
                    Item equ = this.FindItemOnLayer( bc.Layer );
                   
                    if ( bc.LootType == LootType.Blessed || bc.LootType == LootType.Newbied )
                        from.SendMessage( 53, "WARNING!!! If your pet dies while holding a blessed, insured, or newbied item. It will be lost forever." );

                    if ( equ != null)
                        from.AddToBackpack( equ );

                    this.EquipItem( bc );
                    this.CheckResistances();

                    return true;
                   
                }
                else if ( item is BaseArmor && from == this.ControlMaster )
                {
                    BaseArmor ba = (BaseArmor)item;

                    Item equ = this.FindItemOnLayer( ba.Layer );

                    if ( ba.LootType == LootType.Blessed || ba.LootType == LootType.Newbied )
                        from.SendMessage( 53, "WARNING!!! If your pet dies while holding a blessed, insured, or newbied item. It will be lost forever." );

                    if ( equ != null)
                        from.AddToBackpack( equ );

                    if ( this.Str <= ba.StrRequirement )
                    {
                        from.SendMessage( "Your pet is not strong enough to wear this." );
                        from.AddToBackpack( ba );
                    }
                    else
                    {
                        this.EquipItem( ba );
                        this.CheckResistances();
                    }

                    return true;
                }
                else if ( item is BaseWeapon && from == this.ControlMaster )
                {
                    BaseWeapon bw = (BaseWeapon)item;

                    Item weap = this.FindItemOnLayer( Layer.OneHanded );
                    Item shield = this.FindItemOnLayer( Layer.TwoHanded );

                    if ( bw.LootType == LootType.Blessed || bw.LootType == LootType.Newbied )
                        from.SendMessage( 53, "WARNING!!! If your pet dies while holding a blessed, insured, or newbied item. It will be lost forever." );

                    if ( weap != null)
                        from.AddToBackpack( weap );

                    if ( shield != null)
                        from.AddToBackpack( shield );

                    if ( this.Str <= bw.StrRequirement )
                    {
                        from.SendMessage( "Your pet is not strong enough to wear this." );
                        from.AddToBackpack( bw );
                    }
                    else
                    {
                        this.EquipItem( bw );
                        this.CheckResistances();
                    }

                    this.EquipItem( bw );
                   
                    return true;
                }
                else if ( item is BaseJewel && from == this.ControlMaster )
                {
                    BaseJewel bj = (BaseJewel)item;

                    Item equ = this.FindItemOnLayer( bj.Layer );

                    if ( bj.LootType == LootType.Blessed || bj.LootType == LootType.Newbied )
                        from.SendMessage( 53, "Warning: The item you have droped on your pet is either blessed or newbied. If this pet is unbonded and dies you will lose this item." );

                    if ( equ != null)
                        from.AddToBackpack( equ );

                    this.EquipItem( bj );
                    this.CheckResistances();
   
                    return true;
                }
                else if ( item is Lantern && from == this.ControlMaster )
                {
                    Lantern l = (Lantern)item;

                    Item equ = this.FindItemOnLayer( l.Layer );

                    if ( l.LootType == LootType.Blessed || l.LootType == LootType.Newbied )
                        from.SendMessage( 53, "Warning: The item you have droped on your pet is either blessed or newbied. If this pet is unbonded and dies you will lose this item." );

                    if ( equ != null)
                        from.AddToBackpack( equ );

                    this.EquipItem( l );
                    this.CheckResistances();
   
                    return true;
                }
                else if ( item is FishingPole && from == this.ControlMaster )
                {
                    FishingPole fp = (FishingPole)item;

                    Item equ = this.FindItemOnLayer( fp.Layer );

                    if ( fp.LootType == LootType.Blessed || fp.LootType == LootType.Newbied )
                        from.SendMessage( 53, "Warning: The item you have droped on your pet is either blessed or newbied. If this pet is unbonded and dies you will lose this item." );

                    if ( equ != null)
                        from.AddToBackpack( equ );

                    this.EquipItem( fp );
                    this.CheckResistances();
   
                    return true;
                }
                else if ( item is Torch && from == this.ControlMaster )
                {
                    Torch t = (Torch)item;

                    Item equ = this.FindItemOnLayer( t.Layer );

                    if ( t.LootType == LootType.Blessed || t.LootType == LootType.Newbied )
                        from.SendMessage( 53, "Warning: The item you have droped on your pet is either blessed or newbied. If this pet is unbonded and dies you will lose this item." );

                    if ( equ != null)
                        from.AddToBackpack( equ );

                    this.EquipItem( t );
                    this.CheckResistances();
   
                    return true;
                }
                else
                {
                    if ( PackAnimal.CheckAccess( this, from ) )
                    {
                        AddToBackpack( item );
                        return true;
                    }
                }
            }
            else
            {
                if ( PackAnimal.CheckAccess( this, from ) )
                {
                    AddToBackpack( item );
                    return true;
                }
            }

            return base.OnDragDrop( from, item );
        }

BTW Pooka - your BodyMod idea does kind-of work. I made a Brigand Troll by adding BodyMod=0x1 to the regular brigand and I got a troll that has a human paperdoll when doubleclicked. They still can't be dressed/undressed by players but it proves the client sees them as humans and not trolls. I'm sure that'll come in useful later for something!
Thank you very much

I'll study more and study.

Thank you!!
 
This resource is probably along the lines of what you're looking for, but is already very feature rich and coded well.

 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back