protected override void OnTarget(Mobile from, object o) { if (m_Item == null || m_Item.Deleted) { return; } if (o is BaseTalisman) { BaseTalisman talisman = (BaseTalisman)o; if (talisman.Charges == 0) { int toCharge = talisman is MasterCraftsmanTalisman?Utility.RandomMinMax(1, ((MasterCraftsmanTalisman)talisman).Type) : talisman.MaxCharges; talisman.Charges = toCharge; m_Item.Delete(); from.SendLocalizedMessage(1075100); // The item has been recharged. } else { from.SendLocalizedMessage(1075099); // You cannot recharge that item until all of its current charges have been used. } } else if (o is HarvestersAxe) { ((HarvestersAxe)o).Charges = 1000; from.SendLocalizedMessage(1075100); // The item has been recharged. m_Item.Delete(); } else { from.SendLocalizedMessage(1046439); // That is not a valid target. } }
protected override void OnTarget(Mobile from, object o) { if (m_Item == null || m_Item.Deleted) { return; } if (o is BaseTalisman) { BaseTalisman talisman = (BaseTalisman)o; if (talisman.Charges == 0) { talisman.Charges = talisman.MaxCharges; m_Item.Delete(); from.SendLocalizedMessage(1075100); // The item has been recharged. } else { from.SendLocalizedMessage(1075099); // You cannot recharge that item until all of its current charges have been used. } } else { from.SendLocalizedMessage(1046439); // That is not a valid target. } }
protected override void OnTarget(Mobile from, object o) { BaseTalisman talisman = o as BaseTalisman; if (talisman == null) { from.SendLocalizedMessage(1046439); // That is not a valid target. } else if (!talisman.IsChildOf(from.Backpack)) { from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. } else if (talisman.Charges == -1 || talisman.TalismanType == TalismanType.None) { from.SendLocalizedMessage(1046439); // That is not a valid target. } else if (talisman.Charges > 0) { from.SendLocalizedMessage(1075099); // You cannot recharge that item until all of its current charges have been used. } else { from.SendLocalizedMessage(1075100); // The item has been recharged. talisman.Charges = 49; if (m_Item != null && !m_Item.Deleted) { m_Item.Delete(); } } }
protected override void OnTarget(Mobile from, object o) { if (m_Item == null || m_Item.Deleted) { return; } if (o is BaseTalisman) { BaseTalisman talisman = (BaseTalisman)o; if (talisman.Charges == 0) { // Scriptiz : les talismans ne sont pas éternels if (talisman.MaxCharges > 0) // si c'est un talisman avec des charges (pas infini) { talisman.MaxCharges /= 2; // on perd la moitié des charges max if (talisman.MaxCharges == 0) // s'il n'en reste plus il faut delete le talisman { from.SendMessage("Cet objet était trop vieux pour être rechargé, il s'est cassé."); talisman.Delete(); return; } } talisman.Charges = talisman.MaxCharges; m_Item.Delete(); from.SendLocalizedMessage(1075100); // The item has been recharged. } else { from.SendLocalizedMessage(1075099); // You cannot recharge that item until all of its current charges have been used. } } else { from.SendLocalizedMessage(1046439); // That is not a valid target. } }