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); }
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); }
public override void OnResponse(NetState state, RelayInfo info) { Mobile from = state.Mobile; ImbuingContext context = Imbuing.GetContext(from); switch (info.ButtonID) { case 0: // Close case 1: { from.EndAction(typeof(Imbuing)); break; } case 10005: // Imbue Item { from.SendLocalizedMessage(1079589); //Target an item you wish to imbue. from.Target = new ImbueItemTarget(); from.Target.BeginTimeout(from, TimeSpan.FromSeconds(10.0)); break; } case 10006: // Reimbue Last { Item it = context.LastImbued; int mod = context.Imbue_Mod; int modint = context.Imbue_ModInt; if (it == null || mod < 0 || modint == 0) { from.SendLocalizedMessage(1113572); // You haven't imbued anything yet! from.EndAction(typeof(Imbuing)); break; } if (Imbuing.CanImbueItem(from, it) && Imbuing.OnBeforeImbue(from, it, mod, modint)) { Imbuing.TryImbueItem(from, it, mod, modint); ImbuingGumpC.SendGumpDelayed(from); } break; } case 10007: // Imbue Last Item { Item item = context.LastImbued; int mod = context.Imbue_Mod; int modint = context.Imbue_ModInt; if (context.LastImbued == null) { from.SendLocalizedMessage(1113572); // You haven't imbued anything yet! from.EndAction(typeof(Imbuing)); break; } else { ImbueStep1(from, item); } break; } case 10008: // Imbue Last Property { context.LastImbued = null; int mod = context.Imbue_Mod; int modint = context.Imbue_ModInt; if (modint < 0) { modint = 0; } if (mod < 0) { from.SendLocalizedMessage(1113572); // You haven't imbued anything yet! from.EndAction(typeof(Imbuing)); break; } else { ImbuingGump.ImbueLastProp(from, mod, modint); } break; } case 10010: // Unravel Item { from.SendLocalizedMessage(1080422); // Target an item you wish to magically unravel. from.Target = new UnravelTarget(); from.Target.BeginTimeout(from, TimeSpan.FromSeconds(10.0)); break; } case 10011: // Unravel Container { from.SendLocalizedMessage(1080422); // Target an item you wish to magically unravel. from.Target = new UnravelContainerTarget(); from.Target.BeginTimeout(from, TimeSpan.FromSeconds(10.0)); break; } } return; }