public static bool CanUse(Mobile from, Item toUse) { if (from == null || toUse == null) { return(false); } if (from.Frozen) { from.SendAsciiMessage("You are frozen and you cannot do that."); } else if (!toUse.Movable) { from.SendAsciiMessage("You can't use that."); } else if (!toUse.IsChildOf(from.Backpack) && toUse.Parent != from && !from.InRange(toUse.Location, 4) && !toUse.IsChildOf(from.BankBox) && !from.BankBox.Opened) { from.SendAsciiMessage("You can't reach that."); } else if (!from.InLOS(toUse) && !toUse.IsChildOf(from.BankBox) && !from.BankBox.Opened) { from.SendAsciiMessage("You can't see that."); } else { return(toUse.CanEquip(from)); } return(false); }
public virtual bool EquipItem( Item item ) { if ( item == null || item.Deleted || !item.CanEquip( this ) ) return false; if ( CheckEquip( item ) && OnEquip( item ) && item.OnEquip( this ) ) { if ( m_Spell != null && !m_Spell.OnCasterEquiping( item ) ) return false; //if ( m_Spell != null && m_Spell.State == SpellState.Casting ) // m_Spell.Disturb( DisturbType.EquipRequest ); AddItem( item ); return true; } return false; }
public bool EquipItem( Item item ) { if ( item == null || item.Deleted || !item.CanEquip( this ) ) return false; if ( CheckEquip( item ) && OnEquip( item ) && item.OnEquip( this ) ) { if ( m_Spell != null && !m_Spell.OnCasterEquiping( item ) ) return false; AddItem( item ); item.OnAfterEquip( this ); return true; } return false; }
public static bool CanUse( Mobile from, Item toUse ) { if( from == null || toUse == null ) return false; if( from.Frozen ) from.SendAsciiMessage( "You are frozen and you cannot do that." ); else if( !toUse.Movable ) from.SendAsciiMessage( "You can't use that." ); else if( !toUse.IsChildOf( from.Backpack ) && toUse.Parent != from && !from.InRange( toUse.Location, 4 ) && !toUse.IsChildOf( from.BankBox ) && !from.BankBox.Opened ) from.SendAsciiMessage( "You can't reach that." ); else if( !from.InLOS( toUse ) && !toUse.IsChildOf( from.BankBox ) && !from.BankBox.Opened ) from.SendAsciiMessage( "You can't see that." ); else return toUse.CanEquip( from ); return false; }