public override void OnResponse(NetState sender, RelayInfo info) { if (m_Deed.Deleted || !m_Deed.IsChildOf(m_From.Backpack)) { return; } if (info.ButtonID == 2) // Combine { m_From.SendGump(new LargeBODGump(m_From, m_Deed)); m_Deed.BeginCombine(m_From); } else if (info.ButtonID == 3) // bank button { BODContext c = BulkOrderSystem.GetContext(m_From); if (c != null) { switch (c.PointsMode) { case PointsMode.Enabled: c.PointsMode = PointsMode.Disabled; break; case PointsMode.Disabled: c.PointsMode = PointsMode.Automatic; break; case PointsMode.Automatic: c.PointsMode = PointsMode.Enabled; break; } } m_From.SendGump(new LargeBODGump(m_From, m_Deed)); } else if (info.ButtonID == 4) // combine from container { m_From.BeginTarget(-1, false, Targeting.TargetFlags.None, (m, targeted) => { if (!m_Deed.Deleted && targeted is Container container) { List <SmallBOD> list = new List <SmallBOD>(); for (var index = 0; index < container.Items.Count; index++) { Item item = container.Items[index]; if (item is SmallBOD bod) { list.Add(bod); } } for (var index = 0; index < list.Count; index++) { SmallBOD item = list[index]; m_Deed.EndCombine(m_From, item); } list.Clear(); } }); } }
protected override void OnTarget(Mobile from, object targeted) { if (m_Deed.Deleted || !m_Deed.IsChildOf(from.Backpack)) { return; } m_Deed.EndCombine(from, targeted); }
public override void OnResponse(NetState sender, RelayInfo info) { if (m_Deed.Deleted || !m_Deed.IsChildOf(m_From.Backpack)) { return; } if (info.ButtonID == 2) // Combine { m_From.SendGump(new LargeBODGump(m_From, m_Deed)); m_Deed.BeginCombine(m_From); } else if (info.ButtonID == 3) // bank button { BODContext c = BulkOrderSystem.GetContext(m_From); if (c != null) { switch (c.PointsMode) { case PointsMode.Enabled: c.PointsMode = PointsMode.Disabled; break; case PointsMode.Disabled: c.PointsMode = PointsMode.Automatic; break; case PointsMode.Automatic: c.PointsMode = PointsMode.Enabled; break; } } m_From.SendGump(new LargeBODGump(m_From, m_Deed)); } else if (info.ButtonID == 4) // combine from container { m_From.BeginTarget(-1, false, Server.Targeting.TargetFlags.None, (m, targeted) => { if (!m_Deed.Deleted && targeted is Container) { List <SmallBOD> list = ((Container)targeted).Items.OfType <SmallBOD>().ToList(); foreach (SmallBOD item in list) { m_Deed.EndCombine(m_From, item); } list.Clear(); } }); } }
public override void OnResponse(NetState sender, RelayInfo info) { if (this.m_Deed.Deleted || !this.m_Deed.IsChildOf(this.m_From.Backpack)) { return; } if (info.ButtonID == 2) // Combine { this.m_From.SendGump(new LargeBODGump(this.m_From, this.m_Deed)); this.m_Deed.BeginCombine(this.m_From); } else if (info.ButtonID == 3) // bank button { BODContext c = BulkOrderSystem.GetContext(m_From); if (c != null) { switch (c.PointsMode) { case PointsMode.Enabled: c.PointsMode = PointsMode.Disabled; break; case PointsMode.Disabled: c.PointsMode = PointsMode.Automatic; break; case PointsMode.Automatic: c.PointsMode = PointsMode.Enabled; break; } } this.m_From.SendGump(new LargeBODGump(this.m_From, this.m_Deed)); } else if (info.ButtonID == 4) // combine from container { m_From.BeginTarget(-1, false, Server.Targeting.TargetFlags.None, (m, targeted) => { if (!m_Deed.Deleted && targeted is Container) { List <SmallBOD> list = ((Container)targeted).Items.OfType <SmallBOD>().ToList(); foreach (SmallBOD item in list) { m_Deed.EndCombine(m_From, item); } list.Clear(); } }); } // // NOT SURE HOW TO IMPLEMENT WITH NEWER SYSTEM YET ~ ZERODOWNED // /* * //daat99 OWLTR start - custom bods * else if (info.ButtonID >= 3) * { * bool IsFound = false; * IPooledEnumerable eable = m_From.GetMobilesInRange(6); * foreach (Mobile vendor in eable) * { * switch (info.ButtonID) * { * case 3: IsFound = (vendor is Blacksmith || vendor is Weaponsmith || vendor is Armorer); break; * case 4: IsFound = (vendor is Tailor || vendor is Weaver); break; * case 5: IsFound = (vendor is Carpenter); break; * case 6: IsFound = (vendor is Bowyer); break; * } * if (IsFound == true) * break; * } * if (IsFound == false) * switch (info.ButtonID) * { * case 3: m_From.SendMessage("You must be near a Blacksmith, Weaponsmith or Armorer to claim that."); break; * case 4: m_From.SendMessage("You must be near a Tailor or Weaver to claim that."); break; * case 5: m_From.SendMessage("You must be near a Carpenter to claim that."); break; * case 6: m_From.SendMessage("You must be near a Bowyer to claim that."); break; * } * else * daat99.daat99.ClaimBods(m_From, m_Deed); * * } * //daat99 OWLTR end - custom bods */ }