protected override bool OnTarget(Item item) { if (item != null && Map.m_ItemFlags[item.ID & 16383][(TileFlag)2097152L]) { Item obj = (Item)null; if (World.Player != null) { obj = World.Player.FindEquip(Layer.Bank); } if (!item.IsChildOf((Agent)World.Player) || item.IsChildOf((Agent)obj)) { RestockAgent restockAgent = Player.Current.RestockAgent; restockAgent.SourceContainer = new ItemRef(item); if (this.invoking) { restockAgent.Invoke(); } return(true); } Engine.AddTextMessage("Container must not be on your person."); return(false); } Engine.AddTextMessage("Target a container."); return(false); }
protected override bool OnTarget(Item item) { if (item != null && Map.m_ItemFlags[item.ID & 16383][(TileFlag)2097152L]) { if (item.IsChildOf((Agent)World.Player)) { RestockAgent restockAgent = Player.Current.RestockAgent; restockAgent.TargetContainer = new ItemRef(item); if (this.invoking) { restockAgent.Invoke(); } return(true); } Engine.AddTextMessage("Container must be on your person."); return(false); } Engine.AddTextMessage("Target a container."); return(false); }