protected override void OnTarget(Mobile from, object target) { if (m_Deed.Deleted || m_Deed.RootParent != from) { return; } Item item = target as Item; if (item == null) { from.SendMessage("That cannot be blessed"); return; } if (item is Runebook || item is RuneTome) { if (item.LootType == LootType.Blessed || item.BlessedFor == from) { from.SendLocalizedMessage(1045113); // That item is already blessed } else if (item.LootType != LootType.Regular) { from.SendLocalizedMessage(1045114); // You can not bless that item } else if (item.RootParent != from) { from.SendLocalizedMessage(500509); // You cannot bless that object } else { item.LootType = LootType.Blessed; from.SendMessage("You bless the item."); from.PlaySound(0x1F7); m_Deed.Delete(); } } else { from.SendLocalizedMessage(500509); // You cannot bless that object } }
protected override void OnTarget(Mobile from, object target) // Override the protected OnTarget() for our feature { if (m_Deed.Deleted || m_Deed.RootParent != from) { return; } if (target is Runebook) { Runebook item = (Runebook)target; if (item.LootType == LootType.Blessed || item.BlessedFor == from || (Mobile.InsuranceEnabled && item.Insured)) // Check if its already newbied (blessed) { from.SendLocalizedMessage(1045113); // That item is already blessed } else if (item.LootType != LootType.Regular) { from.SendLocalizedMessage(1045114); // You can not bless that item } else if (item.RootParent != from) { from.SendLocalizedMessage(500509); // You cannot bless that object } else { item.LootType = LootType.Blessed; from.SendLocalizedMessage(1010026); // You bless the item.... m_Deed.Delete(); // Delete the bless deed } } else { from.SendLocalizedMessage(500509); // You cannot bless that object } }