public static void OnSpun( ISpinningWheel wheel, Mobile from, int hue ) { Item item = new DarkYarn( 3 ); item.Hue = hue; from.AddToBackpack( item ); from.SendAsciiMessage( "You put the balls of yarn in your backpack." ); }
public static void OnSpun( ISpinningWheel wheel, Mobile from, int hue ) { Item item = new DarkYarn( 3 ); item.Hue = hue; from.AddToBackpack( item ); from.SendLocalizedMessage( 1010576 ); // You put the balls of yarn in your backpack. }
public static void OnSpun(ISpinningWheel wheel, Mobile from, int hue) { Item item = new DarkYarn(3); item.Hue = hue; from.AddToBackpack(item); from.SendLocalizedMessage(1010576); // You put the balls of yarn in your backpack. }
public static void OnSpun(ISpinningWheel wheel, Mobile from, int hue) { Item item = new DarkYarn(3); item.Hue = hue; from.AddToBackpack(item); from.SendAsciiMessage("You put the balls of yarn in your backpack."); }
new public static void OnSpun(ISpinningWheel wheel, Mobile from, int hue) { Item item = new DarkYarn(1) { Hue = hue }; from.AddToBackpack(item); from.SendLocalizedMessage(1010574); // You put a ball of yarn in your backpack. }
public static void OnSpun(ISpinningWheel wheel, Mobile from, Item yarn) { if (yarn != null) { Item item = new DarkYarn((yarn.Amount * 3)); item.Hue = yarn.Hue; yarn.Delete(); from.AddToBackpack(item); from.SendLocalizedMessage(1010576); // You put the balls of yarn in your backpack. } }
public static void OnSpunLoop(ISpinningWheel wheel, Mobile from, int hue, Item cotton) { Item item = new DarkYarn(3); item.Hue = hue; from.AddToBackpack(item); SpinningWheelQuotaAttachment att = (SpinningWheelQuotaAttachment)XmlAttach.FindAttachment(from, typeof(SpinningWheelQuotaAttachment)); if (att == null) { att = new SpinningWheelQuotaAttachment(); XmlAttach.AttachTo(from, att); } att.RemoveWheels((Item)wheel); if (from.NetState == null) // player logged off return; if (cotton.Deleted || cotton.Amount < 1 || !(cotton is Wool)) from.SendMessage("You finished processing all the wool."); else if (!cotton.IsChildOf(from.Backpack)) from.SendMessage("You can not continue without the wool in your backpack."); else if (wheel is Item) { Item wheel1 = (Item)wheel; if (wheel1.Deleted) from.SendMessage("Where did the spinning wheel go?"); else if (!from.InRange(wheel1.GetWorldLocation(), 3)) from.SendMessage("You are too far away from the spinning wheel to continue your work."); else if (wheel.Spinning) from.SendLocalizedMessage(502656); // That spinning wheel is being used. else { if (att.getNumWheels() < SpinningWheelQuotaAttachment.m_WheelQuotaCap) { att.AddWheels(wheel1); if (Utility.Random(6 * att.getNumWheels()) < 1) from.PublicOverheadMessage(Server.Network.MessageType.Emote, 51, false, "*spinning*"); cotton.Consume(); wheel.BeginSpin(new SpinCallback(Wool.OnSpunLoop), from, cotton.Hue, cotton); return; } else from.SendMessage("You are too occupied with the " + SpinningWheelQuotaAttachment.m_WheelQuotaCap.ToString() + " spinning wheels you are running."); } } from.SendLocalizedMessage(1010577); // You put the spools of thread in your backpack. }
public override bool OnDragDrop(Mobile from, Item dropped) { if (Movable) { from.SendMessage("You haven't locked it down!"); return(false); } else if (dropped is PotionKeg && ((PotionKeg)dropped).Held > 0) { from.SendMessage("You can add only empty potion kegs."); return(false); } else if (dropped is LightYarn || dropped is LightYarnUnraveled) { m_Yarn = new DarkYarn(); m_Yarn.Amount = dropped.Amount; return(TryAdd(m_Yarn)); } return(TryAdd(dropped)); }
public override bool OnDragDrop( Mobile from, Item dropped ) { if ( Movable ) { from.SendMessage( "You haven't locked it down!" ); return false; } else if ( dropped is PotionKeg && ((PotionKeg)dropped).Held > 0 ) { from.SendMessage("You can add only empty potion kegs."); return false; } else if ( dropped is LightYarn || dropped is LightYarnUnraveled ) { m_Yarn = new DarkYarn(); m_Yarn.Amount = dropped.Amount; return TryAdd( m_Yarn ); } return TryAdd( dropped ); }
public static void OnSpunLoop(ISpinningWheel wheel, Mobile from, int hue, Item cotton) { Item item = new DarkYarn(3); item.Hue = hue; from.AddToBackpack(item); SpinningWheelQuotaAttachment att = (SpinningWheelQuotaAttachment)XmlAttach.FindAttachment(from, typeof(SpinningWheelQuotaAttachment)); if (att == null) { att = new SpinningWheelQuotaAttachment(); XmlAttach.AttachTo(from, att); } att.RemoveWheels((Item)wheel); if (from.NetState == null) // player logged off { return; } if (cotton.Deleted || cotton.Amount < 1 || !(cotton is Wool)) { from.SendMessage("You finished processing all the wool."); } else if (!cotton.IsChildOf(from.Backpack)) { from.SendMessage("You can not continue without the wool in your backpack."); } else if (wheel is Item) { Item wheel1 = (Item)wheel; if (wheel1.Deleted) { from.SendMessage("Where did the spinning wheel go?"); } else if (!from.InRange(wheel1.GetWorldLocation(), 3)) { from.SendMessage("You are too far away from the spinning wheel to continue your work."); } else if (wheel.Spinning) { from.SendLocalizedMessage(502656); // That spinning wheel is being used. } else { if (att.getNumWheels() < SpinningWheelQuotaAttachment.m_WheelQuotaCap) { att.AddWheels(wheel1); if (Utility.Random(6 * att.getNumWheels()) < 1) { from.PublicOverheadMessage(Server.Network.MessageType.Emote, 51, false, "*spinning*"); } cotton.Consume(); wheel.BeginSpin(new SpinCallback(Wool.OnSpunLoop), from, cotton.Hue, cotton); return; } else { from.SendMessage("You are too occupied with the " + SpinningWheelQuotaAttachment.m_WheelQuotaCap.ToString() + " spinning wheels you are running."); } } } from.SendLocalizedMessage(1010577); // You put the spools of thread in your backpack. }