protected override void OnTarget(Mobile from, object targeted) { if (!m_Tool.IsChildOf(from.Backpack)) { from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. } else if (targeted is EtherealMount mount) { if (!mount.IsChildOf(from.Backpack)) { from.SendLocalizedMessage(1045158); // You must have the item in your backpack to target it. } else if (mount is GMEthereal || mount is EtherealWarBoar) { from.SendLocalizedMessage(1071117); // You cannot use this item for it. } else if (RewardSystem.CheckIsUsableBy(from, m_Tool, null)) { if (mount.Transparent) { from.SendLocalizedMessage(1113816); // Your ethereal mount's body has been solidified. } else { from.SendLocalizedMessage(1113817); // Your ethereal mount's transparency has been restored. } mount.Transparent = mount.Transparent ? false : true; mount.InvalidateProperties(); } } else { from.SendLocalizedMessage(1046439); // That is not a valid target. } }
protected override void OnTarget(Mobile from, object targeted) { if (m_Tool.IsChildOf(from.Backpack) && targeted is EtherealMount) { EtherealMount mount = targeted as EtherealMount; if (mount is GMEthereal) { from.SendMessage("You cannot use it on this!"); } else if (mount.IsChildOf(from.Backpack) && RewardSystem.CheckIsUsableBy(from, m_Tool, null)) { mount.Transparent = mount.Transparent ? false : true; from.PlaySound(0x242); mount.InvalidateProperties(); } } }