public void OnTarget(Mobile from, object obj) { if (obj is Item) { Item item = (Item)obj; if (((Item)obj).RootParent != from) { from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. } else if (item is ILevelable) { from.SendMessage("You cannot enhance legendary artifacts!"); } else if (item is BaseJewel && !(MaterialInfo.IsMagicTorch(item)) && !(MaterialInfo.IsMagicTalisman(item)) && !(MaterialInfo.IsMagicCandle(item)) && !(item is MagicRobe) && !(item is MagicHat) && !(item is MagicCloak) && !(item is MagicBoots) && !(MaterialInfo.IsMagicBelt(item)) && !(MaterialInfo.IsMagicSash(item))) { GuildCraftingProcess process = new GuildCraftingProcess(from, (Item)obj); process.BeginProcess(); } else { from.SendMessage("You cannot enhance this item!"); } } }
public override bool OnDragDrop(Mobile from, Item dropped) { bool doSythEffect = false; bool doGemColor = false; bool doSteelAdd = false; int color = Utility.RandomList(0xB80, 0xB5E, 0xB39, 0xB3A, 0xA9F, 0x99E, 0x997, 0x8D9, 0x8DA, 0x8DB, 0x8DC, 0x8B9); if (dropped is HellShard) { if (crystals >= 50000) { from.SendMessage("That datacron is already fully charged."); } else if ((crystals + dropped.Amount) < 50000) { from.SendMessage("The datacron has been charged."); crystals = crystals + dropped.Amount; from.PlaySound(0x54B); dropped.Delete(); } else { int need = 50000 - crystals; from.SendMessage("The datacron has been charged to maximum capacity, so you did not use all of them."); crystals = 50000; dropped.Amount = dropped.Amount - need; from.PlaySound(0x54B); } } else if (dropped is Ruby && dropped.Amount == 1) { if (dropped.Hue > 0) { gem = dropped.Hue; } else { gem = 0x48E; } doGemColor = true; } else if (dropped is Amber && dropped.Amount == 1) { if (dropped.Hue > 0) { gem = dropped.Hue; } else { gem = 0xB17; } doGemColor = true; } else if (dropped is Amethyst && dropped.Amount == 1) { if (dropped.Hue > 0) { gem = dropped.Hue; } else { gem = 0x490; } doGemColor = true; } else if (dropped is Citrine && dropped.Amount == 1) { if (dropped.Hue > 0) { gem = dropped.Hue; } else { gem = 0x491; } doGemColor = true; } else if (dropped is Emerald && dropped.Amount == 1) { if (dropped.Hue > 0) { gem = dropped.Hue; } else { gem = 0x48F; } doGemColor = true; } else if (dropped is Diamond && dropped.Amount == 1) { if (dropped.Hue > 0) { gem = dropped.Hue; } else { gem = 0xB33; } doGemColor = true; } else if (dropped is Sapphire && dropped.Amount == 1) { if (dropped.Hue > 0) { gem = dropped.Hue; } else { gem = 0x48D; } doGemColor = true; } else if (dropped is StarSapphire && dropped.Amount == 1) { if (dropped.Hue > 0) { gem = dropped.Hue; } else { gem = 0x4AB; } doGemColor = true; } else if (dropped is Tourmaline && dropped.Amount == 1) { if (dropped.Hue > 0) { gem = dropped.Hue; } else { gem = 0xAFA; } doGemColor = true; } else if (MaterialInfo.IsMagicTalisman(dropped)) { dropped.ItemID = 0x4CDE; dropped.Name = "Syth Exacron"; doSythEffect = true; } else if (dropped.Name != null && (dropped.Name).Contains("Durasteel") && dropped.Hue == 0x7A9 && steel < 1) { steel = 1; doSteelAdd = true; } else if (dropped != null && (dropped is BaseArmor || dropped is BaseClothing || dropped is BaseJewel || dropped is BaseHat)) { if (dropped is BaseHat || dropped is MagicHat) { if (dropped.ItemID == 0x4CDA) { dropped.ItemID = 0x4CDC; dropped.Name = "Syth hood"; } else { dropped.ItemID = 0x4CDA; dropped.Name = "Syth cowl"; } doSythEffect = true; } else if (dropped is BaseShield) { dropped.ItemID = 0x1BC3; dropped.Name = "Syth shield"; doSythEffect = true; } else if (dropped.Layer == Layer.OuterTorso) { if (dropped.ItemID == 0x2B69) { dropped.ItemID = 0x2FB9; dropped.Name = "Syth shroud"; } else if (dropped.ItemID == 0x2FB9) { dropped.ItemID = 0x2B69; dropped.Name = "Syth robe"; } else { dropped.ItemID = 0x2B69; dropped.Name = "Syth robe"; } doSythEffect = true; } else if (dropped.Layer == Layer.Cloak && ( dropped.ItemID == 0x1515 || dropped.ItemID == 0x1530 || dropped.ItemID == 0x2309 || dropped.ItemID == 0x230A || dropped.ItemID == 0x26AD || dropped.ItemID == 0x2B04 || dropped.ItemID == 0x2B05 || dropped.ItemID == 0x2B76 || dropped.ItemID == 0x316D || dropped.ItemID == 0x5679)) { dropped.ItemID = 0x1515; dropped.Name = "Syth cloak"; doSythEffect = true; } else if (dropped.Layer == Layer.Helm && dropped is BaseArmor) { dropped.ItemID = 0x2FBB; dropped.Name = "Syth helm"; doSythEffect = true; } } if (doSythEffect) { from.PlaySound(0x55B); from.RevealingAction(); dropped.Hue = color; from.SendMessage("The datacron transformed the item."); } else if (doGemColor) { from.PlaySound(0x55B); from.RevealingAction(); dropped.Delete(); from.SendMessage("The add the colored gem to the datacron."); } else if (doSteelAdd) { from.PlaySound(0x55B); from.RevealingAction(); dropped.Delete(); from.SendMessage("The add the piece of durasteel to the datacron."); } base.OnDragDrop(from, dropped); InvalidateProperties(); return(false); }