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 );
}
Thank you!!!!!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;
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;
}
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 );
}
Thank you very muchSorry, 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 muchBe 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!
We use essential cookies to make this site work, and optional cookies to enhance your experience.