protected override void OnTarget(Mobile from, object targ) { if (targ is BaseArmor) { BaseArmor item = (BaseArmor)targ; if (item.IsChildOf(from.Backpack)) { if (!item.Identified) { ball.PublicOverheadMessage(MessageType.Regular, 0x0, false, ("Your armor has been identified")); item.Identified = true; ball.LastActiveCheck = DateTime.Now; if (ball.Charges > 0) { ball.Charges -= 1; } } else { ball.PublicOverheadMessage(MessageType.Regular, 0x0, false, ("That has already been identified.")); } } else { ball.PublicOverheadMessage(MessageType.Regular, 0x0, false, ("That must be in your pack to identify")); } } else if (targ is BaseJewel) { BaseJewel item = (BaseJewel)targ; if (item.IsChildOf(from.Backpack)) { if (!item.Identified) { ball.PublicOverheadMessage(MessageType.Regular, 0x0, false, ("Your jewelry has been identified")); item.Identified = true; ball.LastActiveCheck = DateTime.Now; if (ball.Charges > 0) { ball.Charges -= 1; } } else { ball.PublicOverheadMessage(MessageType.Regular, 0x0, false, ("That has already been identified.")); } } else { ball.PublicOverheadMessage(MessageType.Regular, 0x0, false, ("That must be in your pack to identify")); } } else if (targ is BaseWeapon) { BaseWeapon item = (BaseWeapon)targ; if (item.IsChildOf(from.Backpack)) { if (!item.Identified) { ball.PublicOverheadMessage(MessageType.Regular, 0x0, false, ("Your weapon has been identified")); item.Identified = true; ball.LastActiveCheck = DateTime.Now; if (ball.Charges > 0) { ball.Charges -= 1; } } else { ball.PublicOverheadMessage(MessageType.Regular, 0x0, false, ("That has already been identified.")); } } else { ball.PublicOverheadMessage(MessageType.Regular, 0x0, false, ("That must be in your pack to identify")); } } else if (targ is BaseClothing) { BaseClothing item = (BaseClothing)targ; if (item.IsChildOf(from.Backpack)) { if (!item.Identified) { ball.PublicOverheadMessage(MessageType.Regular, 0x0, false, ("Your clothing has been identified")); item.Identified = true; ball.LastActiveCheck = DateTime.Now; if (ball.Charges > 0) { ball.Charges -= 1; } } else { ball.PublicOverheadMessage(MessageType.Regular, 0x0, false, ("That has already been identified.")); } } else { ball.PublicOverheadMessage(MessageType.Regular, 0x0, false, ("That must be in your pack to identify")); } } else { ball.PublicOverheadMessage(MessageType.Regular, 0x0, false, ("I can't identify that!")); } }
protected override void OnTarget(Mobile from, object targeted) { if (m_Powder.Deleted || m_Powder.UsesRemaining <= 0) { from.SendLocalizedMessage(1049086); // You have used up your powder of temperament. return; } if (targeted is BaseArmor /*&& (DefBlacksmithy.CraftSystem.CraftItems.SearchForSubclass( targeted.GetType() ) != null)*/) { BaseArmor ar = (BaseArmor)targeted; if (ar.IsChildOf(from.Backpack) && m_Powder.IsChildOf(from.Backpack)) { int origMaxHP = ar.MaxHitPoints; int origCurHP = ar.HitPoints; int initMaxHP = Core.SE ? 255 : ar.InitMaxHits; ar.UnscaleDurability(); if (ar.MaxHitPoints < initMaxHP) { int bonus = initMaxHP - ar.MaxHitPoints; if (bonus > 10) { bonus = 10; } ar.MaxHitPoints += bonus; ar.HitPoints += bonus; ar.ScaleDurability(); if (ar.MaxHitPoints > 255) { ar.MaxHitPoints = 255; } if (ar.HitPoints > 255) { ar.HitPoints = 255; } if (ar.MaxHitPoints > origMaxHP) { from.SendLocalizedMessage(1049084); // You successfully use the powder on the item. --m_Powder.UsesRemaining; if (m_Powder.UsesRemaining <= 0) { from.SendLocalizedMessage(1049086); // You have used up your powder of temperament. m_Powder.Delete(); } } else { ar.MaxHitPoints = origMaxHP; ar.HitPoints = origCurHP; from.SendLocalizedMessage(1049085); // The item cannot be improved any further. } } else { from.SendLocalizedMessage(1049085); // The item cannot be improved any further. ar.ScaleDurability(); } } else { from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. } } else if (targeted is BaseWeapon /*&& (DefBlacksmithy.CraftSystem.CraftItems.SearchForSubclass( targeted.GetType() ) != null)*/) { BaseWeapon wep = (BaseWeapon)targeted; if (wep.IsChildOf(from.Backpack) && m_Powder.IsChildOf(from.Backpack)) { int origMaxHP = wep.MaxHitPoints; int origCurHP = wep.HitPoints; int initMaxHP = Core.SE ? 255 : wep.InitMaxHits; wep.UnscaleDurability(); if (wep.MaxHitPoints < initMaxHP) { int bonus = initMaxHP - wep.MaxHitPoints; if (bonus > 10) { bonus = 10; } wep.MaxHitPoints += bonus; wep.HitPoints += bonus; wep.ScaleDurability(); if (wep.MaxHitPoints > 255) { wep.MaxHitPoints = 255; } if (wep.HitPoints > 255) { wep.HitPoints = 255; } if (wep.MaxHitPoints > origMaxHP) { from.SendLocalizedMessage(1049084); // You successfully use the powder on the item. --m_Powder.UsesRemaining; if (m_Powder.UsesRemaining <= 0) { from.SendLocalizedMessage(1049086); // You have used up your powder of temperament. m_Powder.Delete(); } } else { wep.MaxHitPoints = origMaxHP; wep.HitPoints = origCurHP; from.SendLocalizedMessage(1049085); // The item cannot be improved any further. } } else { from.SendLocalizedMessage(1049085); // The item cannot be improved any further. wep.ScaleDurability(); } } else { from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. } } else if (targeted is BaseClothing /*&& (DefBlacksmithy.CraftSystem.CraftItems.SearchForSubclass( targeted.GetType() ) != null)*/) { BaseClothing clothing = (BaseClothing)targeted; if (clothing.IsChildOf(from.Backpack) && m_Powder.IsChildOf(from.Backpack)) { int origMaxHP = clothing.MaxHitPoints; int origCurHP = clothing.HitPoints; int initMaxHP = Core.SE ? 255 : clothing.InitMaxHits; if (clothing.MaxHitPoints < initMaxHP) { int bonus = initMaxHP - clothing.MaxHitPoints; if (bonus > 10) { bonus = 10; } clothing.MaxHitPoints += bonus; clothing.HitPoints += bonus; if (clothing.MaxHitPoints > 255) { clothing.MaxHitPoints = 255; } if (clothing.HitPoints > 255) { clothing.HitPoints = 255; } if (clothing.MaxHitPoints > origMaxHP) { from.SendLocalizedMessage(1049084); // You successfully use the powder on the item. --m_Powder.UsesRemaining; if (m_Powder.UsesRemaining <= 0) { from.SendLocalizedMessage(1049086); // You have used up your powder of temperament. m_Powder.Delete(); } } else { clothing.MaxHitPoints = origMaxHP; clothing.HitPoints = origCurHP; from.SendLocalizedMessage(1049085); // The item cannot be improved any further. } } else { from.SendLocalizedMessage(1049085); // The item cannot be improved any further. } } else { from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. } } else { from.SendLocalizedMessage(1049083); // You cannot use the powder on that item. } }