protected override void OnTarget(Mobile from, object o) { if (!(o is Item)) { return; } PlayerMobile pm = from as PlayerMobile; ImbuingContext context = Imbuing.GetContext(pm); int mod = context.Imbue_Mod; int modInt = context.Imbue_ModInt; Item it = o as Item; if (!Imbuing.CanImbueItem(pm, it) || !Imbuing.OnBeforeImbue(from, it, mod, modInt) || !Imbuing.CanImbueProperty(from, it, mod)) { from.SendGump(new ImbuingGump(from)); return; } Imbuing.ImbueItem(from, it, mod, modInt); ImbuingGumpC.SendGumpDelayed(from); }
protected override void OnTarget(Mobile m, object o) { Item item = o as Item; if (item == null || !(m is PlayerMobile)) { m.SendLocalizedMessage(1079576); // You cannot imbue this item. return; } ImbuingContext context = Imbuing.GetContext(m); int mod = context.Imbue_Mod; int modInt = context.Imbue_ModInt; if (!Imbuing.CanImbueItem(m, item) || !Imbuing.OnBeforeImbue(m, item, mod, modInt) || !Imbuing.CanImbueProperty(m, item, mod)) { ImbueGump.SendGumpDelayed((PlayerMobile)m); } else { Imbuing.TryImbueItem(m, item, mod, modInt); ImbueGump.SendGumpDelayed((PlayerMobile)m); } }
protected override void OnTarget(Mobile from, object o) { if (!(o is Item)) { from.SendLocalizedMessage(1079576); // You cannot imbue this item. return; } ImbuingContext context = Imbuing.GetContext(from); int mod = context.Imbue_Mod; int modInt = context.Imbue_ModInt; Item it = o as Item; if (!Imbuing.CanImbueItem(from, it) || !Imbuing.OnBeforeImbue(from, it, mod, modInt) || !Imbuing.CanImbueProperty(from, it, mod)) { from.SendGump(new ImbuingGump(from)); return; } Imbuing.ImbueItem(from, it, mod, modInt); ImbuingGumpC.SendGumpDelayed(from); }