public override void OnResponse(RelayInfo info) { User.EndAction(typeof(Imbuing)); if (m_Container == null || m_List == null) { return; } if (info.ButtonID == 0) { TryUnravelContainer(User, m_Container); return; } int count = 0; m_List.ForEach(x => { if (Imbuing.CanUnravelItem(User, x, true) && Imbuing.UnravelItem(User, x, true)) { count++; } }); if (count > 0) { User.SendLocalizedMessage(1080429); // You magically unravel the item! User.SendLocalizedMessage(1072223); // An item has been placed in your backpack. } User.SendLocalizedMessage(1111814, String.Format("{0}\t{1}", count, m_List.Count)); ColUtility.Free(m_List); }
protected override void OnTarget(Mobile from, object o) { if (!Imbuing.CheckSoulForge(from, 1)) { return; } if (o is Container) { Container cont = (Container)o; if (cont.IsChildOf(from.Backpack) || cont == from.Backpack) { int unraveled = 0; List <Item> list = new List <Item>(cont.Items); foreach (Item item in list) { if (item is BaseWeapon || item is BaseArmor || item is BaseJewel || item is BaseHat) { if (Imbuing.CanUnravelItem(from, item, false) && Imbuing.UnravelItem(from, item, false)) { unraveled++; } } } list.Clear(); list.TrimExcess(); if (unraveled <= 0) { from.SendMessage(2499, "You fail to unravel any items in the selected container."); Effects.PlaySound(from.Location, from.Map, 0x3BF); } else { Effects.PlaySound(from.Location, from.Map, 0x1ED); Effects.SendLocationParticles( EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0x373A, 10, 30, 0, 4, 0, 0); from.SendMessage(2499, "You successfully unravel {0} items from the selected container.", unraveled); } } else { from.SendMessage(2499, "The container must be in your backpack to magically unravel its contents."); return; } } else { from.SendMessage(2499, "You must target a container."); return; } return; }
public override void OnResponse(RelayInfo info) { User.EndAction(typeof(Imbuing)); if (info.ButtonID == 0 || m_Item.Deleted) { return; } if (Imbuing.CanUnravelItem(User, m_Item) && Imbuing.UnravelItem(User, m_Item)) { Effects.SendPacket(User, User.Map, new GraphicalEffect(EffectType.FixedFrom, User.Serial, Server.Serial.Zero, 0x375A, User.Location, User.Location, 1, 17, true, false)); User.PlaySound(0x1EB); User.SendLocalizedMessage(1080429); // You magically unravel the item! User.SendLocalizedMessage(1072223); // An item has been placed in your backpack. } }
public override void OnResponse(NetState sender, RelayInfo info) { Mobile from = sender.Mobile; from.EndAction(typeof(Imbuing)); if (m_Container == null || m_List == null) { return; } if (info.ButtonID == 0) { TryUnravelContainer(from, m_Container); return; } int count = 0; m_List.ForEach(x => { if (Imbuing.CanUnravelItem(from, x, true) && Imbuing.UnravelItem(from, x, true)) { count++; } }); if (count > 0) { from.SendLocalizedMessage(1080429); // You magically unravel the item! from.SendLocalizedMessage(1072223); // An item has been placed in your backpack. } from.SendLocalizedMessage(1111814, String.Format("{0}\t{1}", count, m_List.Count)); m_List.Clear(); m_List.TrimExcess(); }
protected override void OnTarget(Mobile from, object o) { if (!Imbuing.CheckSoulForge(from, 1)) { return; } if (o is BaseWeapon || o is BaseArmor || o is BaseJewel || o is BaseHat) { if (Imbuing.CanUnravelItem(from, (Item)o) && Imbuing.UnravelItem(from, (Item)o)) { Effects.PlaySound(from.Location, from.Map, 0x1ED); Effects.SendLocationParticles( EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0x373A, 10, 30, 0, 4, 0, 0); from.SendLocalizedMessage(1080429); // Unravelled :P } } else { from.SendLocalizedMessage(1080425); // You cannot magically unravel this item. return; } }