public override void OnClick() { if (backpack == null || !backpack.IsOwner(player)) { return; } MasterStorageSetupGump.SendGump(player, backpack, 0); }
protected override void OnTarget(Mobile from, object targeted) { if (from as PlayerMobile == null || backpack == null || backpack.Deleted) { return; } if (targeted == null) { return; } Type targetType = targeted.GetType(); if (selection == SELECTION.ITEM_SELECTION) { if (backpack.isTypeLootable(targetType)) { from.SendMessage("You already loot that type."); } else { backpack.AddLootableItemType(targetType); } } else if (previousType != null) { if (previousType == targetType) { from.SendMessage("Both items have the same type."); return; } Type common = findCommonType(targetType, previousType); if (common == null) { from.SendMessage("The selected items doesn't have a common type."); } else { string typeName = common.ToString(); int dotIndex = typeName.LastIndexOf("."); if (dotIndex >= 0) { typeName = typeName.Substring(dotIndex + 1); } from.SendMessage("You successfully added " + typeName + " to your loot list."); backpack.AddLootableBaseType(common); } } else { from.Target = new MasterStorageAddTypeTarget(backpack, from as PlayerMobile, selection, targetType); return; } MasterStorageSetupGump.SendGump(from, backpack, -1); }