protected override void OnTarget(Mobile from, object targeted) { if (m_Bag.Deleted) { return; } if (from.Region.IsPartOf <Regions.Jail>()) { from.SendMessage("You may not do that in jail."); } else if (!m_Bag.IsChildOf(from.Backpack)) { MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1062334, 0x59); // The bag of sending must be in your backpack. 1054107 is gone from client, using generic response } else if (m_Bag.Charges == 0) { MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1042544, 0x59); // This item is out of charges. } else if (targeted is Item) { Item item = (Item)targeted; int reqCharges = 1; // (int)Math.Max(1, Math.Ceiling(item.TotalWeight / 10.0)); // change was ML, however reverted during ML period so we can put it at 1 if (!item.IsChildOf(from.Backpack)) { MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054152, 0x59); // You may only send items from your backpack to your bank box. } else if (item is BagOfSending || item is Container) { from.Send(new AsciiMessage(m_Bag.Serial, m_Bag.ItemID, MessageType.Regular, 0x3B2, 3, "", "You cannot send a container through the bag of sending.")); } else if (item.LootType == LootType.Cursed) { MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054108, 0x59); // The bag of sending rejects the cursed item. } else if (!item.VerifyMove(from) || item is Server.Engines.Quests.QuestItem || item.QuestItem) { MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054109, 0x59); // The bag of sending rejects that item. } else if (Spells.SpellHelper.IsDoomGauntlet(from.Map, from.Location)) { from.SendLocalizedMessage(1062089); // You cannot use that here. } else if (!from.BankBox.TryDropItem(from, item, false)) { MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054110, 0x59); // Your bank box is full. } else if (reqCharges > m_Bag.Charges) { from.SendLocalizedMessage(1079932); //You don't have enough charges to send that much weight } else { m_Bag.Charges -= reqCharges; MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054150, 0x59); // The item was placed in your bank box. } } }
protected override void OnTarget(Mobile from, object targeted) { if (m_Bag.Deleted) { return; } if (from.Region.IsPartOf(typeof(Regions.Jail))) { from.SendMessage("You may not do that in jail."); } else if (!m_Bag.IsChildOf(from.Backpack)) { MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054107, 0x59); // The bag of sending must be in your backpack. } else if (m_Bag.Charges == 0) { MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1042544, 0x59); // This item is out of charges. } else if (targeted is Item) { Item item = (Item)targeted; if (!item.IsChildOf(from.Backpack)) { MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054152, 0x59); // You may only send items from your backpack to your bank box. } else if (item is BagOfSending || item is Container) { from.Send(new AsciiMessage(m_Bag.Serial, m_Bag.ItemID, MessageType.Regular, 0x3B2, 3, "", "You cannot send a container through the bag of sending.")); } else if (item.LootType == LootType.Cursed) { MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054108, 0x59); // The bag of sending rejects the cursed item. } // Genova: suporte ao UO:ML. else if (!item.VerifyMove(from) || item is Server.Engines.Quests.QuestItem || item.QuestItem) { MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054109, 0x59); // The bag of sending rejects that item. } else if (Spells.SpellHelper.IsDoomGauntlet(from.Map, from.Location)) { from.SendLocalizedMessage(1062089); // You cannot use that here. } else if (!from.BankBox.TryDropItem(from, item, false)) { MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054110, 0x59); // Your bank box is full. } else { m_Bag.Charges--; MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054150, 0x59); // The item was placed in your bank box. } } }
protected override void OnTarget(Mobile from, object targeted) { if (m_Bag.Deleted) { return; } if (from.Region.IsPartOf(typeof(Regions.Jail))) { from.SendMessage("You may not do that in jail."); } else if (!m_Bag.IsChildOf(from.Backpack)) { MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1062334, 0x59); // The bag of sending must be in your backpack. 1054107 is gone from client, using generic response } else if (m_Bag.Charges == 0) { MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1042544, 0x59); // This item is out of charges. } else if (targeted is Item) { Item item = (Item)targeted; int reqCharges = (int)Math.Max(1, Math.Ceiling(item.TotalWeight / 10.0)); if (!item.IsChildOf(from.Backpack)) { MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054152, 0x59); // You may only send items from your backpack to your bank box. } else if (item is BagOfSending || item is Container) { from.Send(new AsciiMessage(m_Bag.Serial, m_Bag.ItemID, MessageType.Regular, 0x3B2, 3, "", "You cannot send a container through the bag of sending.")); } else if (item.LootType == LootType.Cursed) { MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054108, 0x59); // The bag of sending rejects the cursed item. } else if (!item.VerifyMove(from)) { MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054109, 0x59); // The bag of sending rejects that item. } else if (!from.BankBox.TryDropItem(from, item, false)) { MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054110, 0x59); // Your bank box is full. } else { m_Bag.Charges -= (Core.ML ? reqCharges : 1); MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054150, 0x59); // The item was placed in your bank box. } } }
protected override void OnTarget(Mobile from, object targeted) { if (m_Bag.Deleted) { return; } if (from.Region.IsPartOf(typeof(Regions.Jail))) { // You'll need a better jailbreak plan then that! from.SendLocalizedMessage(1041530); } else if (!m_Bag.IsChildOf(from.Backpack)) { // The bag of sending must be in your backpack. MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054107, 0x59); } else if (m_Bag.Charges == 0) { // This item is out of charges. MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1042544, 0x59); } else if (targeted is Item) { Item item = (Item)targeted; if (!item.IsChildOf(from.Backpack)) { // You may only send items from your backpack to your bank box. MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054152, 0x59); } else if (item is BagOfSending || item is Container) { // You cannot send a container through the bag of sending MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1079428, 0x59); } else if (item.LootType == LootType.Cursed) { // The bag of sending rejects the cursed item. MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054108, 0x59); } else if (!item.VerifyMove(from) || item is Server.Engines.Quests.QuestItem || item.QuestItem || item.NonTransferable || item is Server.Factions.Silver) { // The bag of sending rejects that item. MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054109, 0x59); } else if (Spells.SpellHelper.IsDoomGauntlet(from.Map, from.Location)) { // You cannot use that here. from.SendLocalizedMessage(1062089); } else if (from.BankBox == null || !from.BankBox.TryDropItem(from, item, false)) { // Your bank box is full. MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054110, 0x59); } else { m_Bag.Charges--; // The item was placed in your bank box. MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054150, 0x59); } } }