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_Crystal.IsAccessibleTo(from)) { return; } if (from.Map != m_Crystal.Map || !from.InRange(m_Crystal.GetWorldLocation(), 2)) { //from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that. int OldHue = from.SpeechHue; from.SpeechHue = 0; from.SayTo(from, true, "I can't reach that."); from.SpeechHue = OldHue; return; } if (targeted == m_Crystal) { if (m_Crystal.Active) { m_Crystal.Active = false; from.SendLocalizedMessage(500672); // You turn the crystal off. } else { m_Crystal.Active = true; from.SendLocalizedMessage(500673); // You turn the crystal on. } } else if (targeted == from) { if (m_Crystal.Sender != null) { m_Crystal.Sender = null; from.SendLocalizedMessage(1010044); // You unlink the receiver crystal. } else { from.SendLocalizedMessage(1010045); // That receiver crystal is not linked. } } else { Item targItem = targeted as Item; if (targItem != null && targItem.VerifyMove(from)) { CrystalRechargeInfo info = CrystalRechargeInfo.Get(targItem.GetType()); if (info != null) { from.SendLocalizedMessage(500677); // This crystal cannot be recharged. return; } } from.SendLocalizedMessage(1010045); // That receiver crystal is not linked. } }
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_Chest.Deleted) { return; } Item item = targeted as Item; if (item == null || from.Backpack == null) { return; } if (!from.Region.IsPartOf <HouseRegion>()) { from.SendLocalizedMessage(502092); // You must be in your house to do this. } else if (!item.IsChildOf(from.Backpack)) { from.SendLocalizedMessage(1054107); // This item must be in your backpack. } else if (item is Container || item is BagOfSending || item is ChestOfSending) { from.SendLocalizedMessage(1150420, "#1150424"); // You cannot send a container through the ~1_NAME~. } else if (!m_Chest.IsLockedDown && !m_Chest.IsSecure) { from.SendLocalizedMessage(1112573); // This must be locked down or secured in order to use it. } else if (m_Chest.Charges == 0) { from.SendLocalizedMessage(1019073); // This item is out of charges. } else if (!m_Chest.CheckAccessible(from, m_Chest)) { } else if (m_Chest.InSecureTrade) { from.SendLocalizedMessage(1150422, "#1150424"); // The ~1_NAME~ will not function while being traded. } else if (!item.VerifyMove(from) || item is Server.Engines.Quests.QuestItem) { from.SendLocalizedMessage(1150421, "#1150424"); // The ~1_NAME~ rejects that item. } else if (!from.BankBox.TryDropItem(from, item, false)) { from.SendLocalizedMessage(1054110); // Your bank box is full. } else { m_Chest.Charges--; from.SendLocalizedMessage(1054150); // 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_Crystal.IsAccessibleTo(from)) { return; } if (from.Map != m_Crystal.Map || !from.InRange(m_Crystal.GetWorldLocation(), 2)) { from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. return; } if (targeted == m_Crystal) { if (m_Crystal.Active) { m_Crystal.Active = false; from.SendLocalizedMessage(500672); // You turn the crystal off. } else { if (m_Crystal.Charges > 0) { m_Crystal.Active = true; from.SendLocalizedMessage(500673); // You turn the crystal on. } else { from.SendLocalizedMessage(500676); // This crystal is out of charges. } } } else if (targeted is ReceiverCrystal) { ReceiverCrystal receiver = (ReceiverCrystal)targeted; if (m_Crystal.Receivers.Count >= 10) { from.SendLocalizedMessage(1010042); // This broadcast crystal is already linked to 10 receivers. } else if (receiver.Sender == m_Crystal) { from.SendLocalizedMessage(500674); // This crystal is already linked with that crystal. } else if (receiver.Sender != null) { from.SendLocalizedMessage(1010043); // That receiver crystal is already linked to another broadcast crystal. } else { receiver.Sender = m_Crystal; from.SendLocalizedMessage(500675); // That crystal has been linked to this crystal. } } else if (targeted == from) { foreach (ReceiverCrystal receiver in new List <ReceiverCrystal>(m_Crystal.Receivers)) { receiver.Sender = null; } from.SendLocalizedMessage(1010046); // You unlink the broadcast crystal from all of its receivers. } else { Item targItem = targeted as Item; if (targItem != null && targItem.VerifyMove(from)) { CrystalRechargeInfo info = CrystalRechargeInfo.Get(targItem.GetType()); if (info != null) { if (m_Crystal.Charges >= MaxCharges) { from.SendLocalizedMessage(500678); // This crystal is already fully charged. } else { targItem.Consume(); if (m_Crystal.Charges + info.Amount >= MaxCharges) { m_Crystal.Charges = MaxCharges; from.SendLocalizedMessage(500679); // You completely recharge the crystal. } else { m_Crystal.Charges += info.Amount; from.SendLocalizedMessage(500680); // You recharge the crystal. } } return; } } from.SendLocalizedMessage(500681); // You cannot use this crystal on that. } }
protected override void OnTarget(Mobile from, object targeted) { if (!m_Crystal.IsAccessibleTo(from)) { return; } if (from.Map != m_Crystal.Map || !from.InRange(m_Crystal.GetWorldLocation(), 2)) { //from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that. int OldHue = from.SpeechHue; from.SpeechHue = 0; from.SayTo(from, true, "I can't reach that."); from.SpeechHue = OldHue; return; } if (targeted == m_Crystal) { if (m_Crystal.Active) { m_Crystal.Active = false; //from.SendLocalizedMessage( 500672 ); // You turn the crystal off. from.SendAsciiMessage("You turn the crystal off."); } else { if (m_Crystal.Charges > 0) { m_Crystal.Active = true; //from.SendLocalizedMessage( 500673 ); // You turn the crystal on. from.SendAsciiMessage("You turn the crystal on."); } else { //from.SendLocalizedMessage( 500676 ); // This crystal is out of charges. from.SendAsciiMessage("This crystal is out of charges"); } } } else if (targeted is BroadcastCrystal) { BroadcastCrystal receiver = (BroadcastCrystal)targeted; if (m_Crystal.Receivers.Count >= 10) { //from.SendLocalizedMessage( 1010042 ); // This broadcast crystal is already linked to 10 receivers. from.SendAsciiMessage("This broadcast crystal is already linked to 10 receivers"); } /*else if ( receiver.Sender == m_Crystal ) * { * from.SendLocalizedMessage( 500674 ); // This crystal is already linked with that crystal. * }*/ else if (receiver.Sender != null) { receiver.Sender = null; //from.SendLocalizedMessage( 1010044 ); // You unlink the receiver crystal. from.SendAsciiMessage("That crystal has been unlinked to this crystal."); } else { receiver.Sender = m_Crystal; //from.SendLocalizedMessage( 500675 ); // That crystal has been linked to this crystal. from.SendAsciiMessage("That crystal has been linked to this crystal."); } } else if (targeted == from) { foreach (BroadcastCrystal receiver in new ArrayList(m_Crystal.Receivers)) { receiver.Sender = null; } //from.SendLocalizedMessage( 1010046 ); // You unlink the broadcast crystal from all of its receivers. from.SendAsciiMessage("You unlink all of the crystals."); } else { Item targItem = targeted as Item; if (targItem != null && targItem.VerifyMove(from)) { CrystalRechargeInfo info = CrystalRechargeInfo.Get(targItem.GetType()); if (info != null) { if (m_Crystal.Charges >= MaxCharges) { //from.SendLocalizedMessage( 500678 ); // This crystal is already fully charged. from.SendAsciiMessage("This crystal is already fully charged."); } else { targItem.Consume(); if (m_Crystal.Charges + info.Amount >= MaxCharges) { m_Crystal.Charges = MaxCharges; //from.SendLocalizedMessage( 500679 ); // You completely recharge the crystal. from.SendAsciiMessage("You completely recharge the crystal."); } else { m_Crystal.Charges += info.Amount; //from.SendLocalizedMessage( 500680 ); // You recharge the crystal. from.SendAsciiMessage("You recharge the crystal."); } } return; } } //from.SendLocalizedMessage( 500681 ); // You cannot use this crystal on that. from.SendAsciiMessage("You cannot use this crystal on that."); } }
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); } } }