public RemovePetsGump(PetBroker broker, Mobile from, int index) { m_Broker = broker; m_Index = index; AddHtmlLocalized(215, 10, 200, 18, 1150311, RedColor16, false, false); // Animal Broker AddHtmlLocalized(145, 50, 250, 18, 1150337, RedColor16, false, false); // ADD PET TO BROKER INVENTORY AddHtmlLocalized(10, 80, 500, 40, 1150633, GreenColor16, false, false); // Click the button next to a pet to select it, then click the REMOVE PET button below to transfer that pet to your stables. m_Broker.CheckInventory(); int y = 130; for (int i = 0; i < broker.BrokerEntries.Count; i++) { BaseCreature bc = broker.BrokerEntries[i].Pet; int col = index == i ? YellowColor16 : OrangeColor16; AddButton(10, y, 4005, 4007, i + 1, GumpButtonType.Reply, 0); AddHtmlLocalized(50, y, 200, 18, 1150340, String.Format("{0}\t{1}", bc.Name, PetBrokerEntry.GetOriginalName(bc)), col, false, false); // ~1_NAME~ (~2_type~) y += 20; } AddHtmlLocalized(215, 405, 150, 18, 1150632, OrangeColor16, false, false); // REMOVE PET AddButton(175, 405, 4014, 4016, 501, GumpButtonType.Reply, 0); AddButton(10, 490, 4014, 4016, 500, GumpButtonType.Reply, 0); AddHtmlLocalized(50, 490, 100, 18, 1149777, BlueColor16, false, false); // MAIN MENU }
public PetBrokerGump(PetBroker broker, Mobile from) { m_Broker = broker; AddHtmlLocalized(215, 10, 200, 18, 1150311, RedColor16, false, false); // Animal Broker if (m_Broker.Plot.ShopName != null && m_Broker.Plot.ShopName.Length > 0) { AddHtml(173, 40, 173, 18, Color(FormatStallName(m_Broker.Plot.ShopName), BlueColor), false, false); } else { AddHtmlLocalized(180, 40, 200, 18, 1150314, BlueColor16, false, false); // This Shop Has No Name } AddHtml(173, 65, 173, 18, Color(FormatBrokerName(String.Format("Proprietor: {0}", broker.Name)), BlueColor), false, false); AddHtmlLocalized(215, 100, 200, 18, 1150328, GreenColor16, false, false); // Owner Menu AddButton(150, 150, 4005, 4007, 1, GumpButtonType.Reply, 0); AddHtmlLocalized(190, 150, 200, 18, 1150392, OrangeColor16, false, false); // INFORMATION AddHtmlLocalized(39, 180, 200, 18, 1150199, RedColor16, false, false); // Broker Account Balance AddHtml(190, 180, 300, 18, FormatAmt(broker.BankBalance), false, false); int balance = Banker.GetBalance(from); AddHtmlLocalized(68, 200, 200, 18, 1150149, GreenColor16, false, false); // Your Bank Balance: AddHtml(190, 200, 200, 18, FormatAmt(balance), false, false); AddHtmlLocalized(32, 230, 200, 18, 1150329, OrangeColor16, false, false); // Broker Sales Comission AddHtmlLocalized(190, 230, 100, 18, 1150330, false, false); // 5% AddHtmlLocalized(110, 250, 200, 18, 1150331, OrangeColor16, false, false); // Weekly Fee: AddHtml(190, 250, 250, 18, FormatAmt(broker.GetWeeklyFee()), false, false); AddHtmlLocalized(113, 280, 200, 18, 1150332, OrangeColor16, false, false); // Shop Name: AddBackground(190, 280, 285, 22, 9350); AddTextEntry(191, 280, 285, 20, LabelHueBlue, 0, m_Broker.Plot.ShopName == null ? "" : m_Broker.Plot.ShopName); AddButton(480, 280, 4014, 4016, 2, GumpButtonType.Reply, 0); AddHtmlLocalized(83, 305, 150, 18, 1150195, OrangeColor16, false, false); // Withdraw Funds AddBackground(190, 305, 285, 22, 9350); AddTextEntry(191, 305, 285, 20, LabelHueBlue, 1, ""); AddButton(480, 305, 4014, 4016, 3, GumpButtonType.Reply, 0); AddHtmlLocalized(95, 330, 150, 18, 1150196, OrangeColor16, false, false); // Deposit Funds AddBackground(190, 330, 285, 22, 9350); AddTextEntry(191, 330, 285, 20, LabelHueBlue, 2, ""); AddButton(480, 330, 4014, 4016, 4, GumpButtonType.Reply, 0); AddButton(150, 365, 4005, 4007, 5, GumpButtonType.Reply, 0); AddHtmlLocalized(190, 365, 350, 18, 1150276, OrangeColor16, false, false); // TRANSFER STABLED PETS TO MERCHANT AddButton(150, 390, 4005, 4007, 6, GumpButtonType.Reply, 0); AddHtmlLocalized(190, 390, 350, 18, 1150277, OrangeColor16, false, false); // TRANSFER MERCHANT INVENTORY TO STABLE AddButton(150, 415, 4005, 4007, 7, GumpButtonType.Reply, 0); AddHtmlLocalized(190, 415, 350, 18, 1150334, OrangeColor16, false, false); // VIEW INVENTORY / EDIT PRICES }
public PetInventoryGump(PetBroker broker, Mobile from) { m_Broker = broker; m_Entries = broker.BrokerEntries; AddHtmlLocalized(10, 10, 500, 18, 1114513, "#1150311", RedColor16, false, false); // Animal Broker if (m_Broker.Plot.ShopName != null && m_Broker.Plot.ShopName.Length > 0) { AddHtml(10, 37, 500, 18, Color(FormatStallName(m_Broker.Plot.ShopName), BlueColor), false, false); } else { AddHtmlLocalized(10, 37, 500, 18, 1114513, "#1150314", BlueColor16, false, false); // This Shop Has No Name } AddHtmlLocalized(10, 55, 240, 18, 1114514, "#1150313", BlueColor16, false, false); // Proprietor: AddHtml(260, 55, 250, 18, Color(String.Format("{0}", broker.Name), BlueColor), false, false); if (m_Entries.Count != 0) { AddHtmlLocalized(10, 91, 500, 18, 1114513, "#1150346", GreenColor16, false, false); // PETS FOR SALE AddHtmlLocalized(10, 118, 500, 72, 1114513, "#1150352", GreenColor16, false, false); // LORE: See the animal's AddHtmlLocalized(10, 199, 52, 18, 1150351, OrangeColor16, false, false); // LORE AddHtmlLocalized(68, 199, 52, 18, 1150353, OrangeColor16, false, false); // VIEW AddHtmlLocalized(126, 199, 104, 18, 1150347, OrangeColor16, false, false); // NAME AddHtmlLocalized(236, 199, 104, 18, 1150348, OrangeColor16, false, false); // TYPE AddHtmlLocalized(346, 199, 104, 18, 1114514, "#1150349", OrangeColor16, false, false); // PRICE AddHtmlLocalized(456, 199, 52, 18, 1150350, OrangeColor16, false, false); // BUY int y = 219; for (int i = 0; i < m_Entries.Count; i++) { PetBrokerEntry entry = m_Entries[i]; if (entry == null || entry.Pet == null) { continue; } AddButton(10, y + (i * 20), 4011, 4013, 100 + i, GumpButtonType.Reply, 0); AddButton(68, y + (i * 20), 4008, 4010, 200 + i, GumpButtonType.Reply, 0); AddHtml(126, y + (i * 20), 104, 14, Color(entry.Pet.Name, BlueColor), false, false); AddHtml(236, y + (i * 20), 104, 20, Color(entry.TypeName, BlueColor), false, false); AddHtml(346, y + (i * 20), 104, 20, Color(AlignRight(FormatAmt(entry.SalePrice)), GreenColor), false, false); AddButton(456, y + (i * 20), 4014, 4016, 300 + i, GumpButtonType.Reply, 0); } } else { AddHtmlLocalized(10, 127, 500, 534, 1114513, "#1150336", OrangeColor16, false, false); // The animal broker has no pets in its inventory. AddButton(10, 490, 0xFAE, 0xFAF, 1, GumpButtonType.Reply, 0); AddHtmlLocalized(50, 490, 210, 20, 1149777, BlueColor16, false, false); // MAIN MENU } }
public override void OnResponse(NetState state, RelayInfo info) { Mobile from = state.Mobile; if (info.ButtonID == 0) { return; } if (info.ButtonID == 500) // MAIN MENU { from.SendGump(new PetBrokerGump(m_Broker, from)); return; } else if (info.ButtonID == 501) // REMOVE PET { if (m_Index >= 0 && m_Index < m_Broker.BrokerEntries.Count) { PetBrokerEntry entry = m_Broker.BrokerEntries[m_Index]; if (from.Stabled.Count >= AnimalTrainer.GetMaxStabled(from) || entry.Pet == null) { from.SendLocalizedMessage(1150634); // Failed to transfer the selected pet to your stables. Either the pet is no longer in the broker's inventory, or you do not have any available stable slots. } else { BaseCreature bc = entry.Pet; m_Broker.RemoveEntry(entry); PetBroker.EndViewTimer(bc); bc.ControlTarget = null; bc.ControlOrder = OrderType.Stay; bc.Internalize(); bc.SetControlMaster(null); bc.SummonMaster = null; bc.IsStabled = true; bc.Loyalty = BaseCreature.MaxLoyalty; from.Stabled.Add(bc); from.SendLocalizedMessage(1150635, String.Format("{0}\t{1}", entry.TypeName, bc.Name)); // Your pet ~1_TYPE~ named ~2_NAME~ has been transferred to the stables. from.SendGump(new PetBrokerGump(m_Broker, from)); return; } } else { from.SendLocalizedMessage(1150341); // You did not select a pet. } from.SendGump(new RemovePetsGump(m_Broker, from, m_Index)); } else { from.SendGump(new RemovePetsGump(m_Broker, from, info.ButtonID - 1)); } }
public PetBrokerGump(PetBroker broker, Mobile from) { m_Broker = broker; AddHtmlLocalized(215, 10, 200, 18, 1150311, RedColor16, false, false); // Animal Broker if(m_Broker.Plot.ShopName != null && m_Broker.Plot.ShopName.Length > 0) AddHtml(173, 40, 173, 18, Color(FormatStallName(m_Broker.Plot.ShopName), BlueColor), false, false); else AddHtmlLocalized(180, 40, 200, 18, 1150314, BlueColor16, false, false); // This Shop Has No Name AddHtml(173, 65, 173, 18, Color(FormatBrokerName(String.Format("Proprietor: {0}", broker.Name)), BlueColor), false, false); AddHtmlLocalized(215, 100, 200, 18, 1150328, GreenColor16, false, false); // Owner Menu AddButton(150, 150, 4005, 4007, 1, GumpButtonType.Reply, 0); AddHtmlLocalized(190, 150, 200, 18, 1150392, OrangeColor16, false, false); // INFORMATION AddHtmlLocalized(39, 180, 200, 18, 1150199, RedColor16, false, false); // Broker Account Balance AddHtml(190, 180, 300, 18, FormatAmt(broker.BankBalance), false, false); int balance = Banker.GetBalance(from); AddHtmlLocalized(68, 200, 200, 18, 1150149, GreenColor16, false, false); // Your Bank Balance: AddHtml(190, 200, 200, 18, FormatAmt(balance), false, false); AddHtmlLocalized(32, 230, 200, 18, 1150329, OrangeColor16, false, false); // Broker Sales Comission AddHtmlLocalized(190, 230, 100, 18, 1150330, false, false); // 5% AddHtmlLocalized(110, 250, 200, 18, 1150331, OrangeColor16, false, false); // Weekly Fee: AddHtml(190, 250, 250, 18, FormatAmt(broker.GetWeeklyFee()), false, false); AddHtmlLocalized(113, 280, 200, 18, 1150332, OrangeColor16, false, false); // Shop Name: AddBackground(190, 280, 285, 22, 9350); AddTextEntry(191, 280, 285, 20, LabelHueBlue, 0, m_Broker.Plot.ShopName == null ? "" : m_Broker.Plot.ShopName); AddButton(480, 280, 4014, 4016, 2, GumpButtonType.Reply, 0); AddHtmlLocalized(83, 305, 150, 18, 1150195, OrangeColor16, false, false); // Withdraw Funds AddBackground(190, 305, 285, 22, 9350); AddTextEntry(191, 305, 285, 20, LabelHueBlue, 1, ""); AddButton(480, 305, 4014, 4016, 3, GumpButtonType.Reply, 0); AddHtmlLocalized(95, 330, 150, 18, 1150196, OrangeColor16, false, false); // Deposit Funds AddBackground(190, 330, 285, 22, 9350); AddTextEntry(191, 330, 285, 20, LabelHueBlue, 2, ""); AddButton(480, 330, 4014, 4016, 4, GumpButtonType.Reply, 0); AddButton(150, 365, 4005, 4007, 5, GumpButtonType.Reply, 0); AddHtmlLocalized(190, 365, 350, 18, 1150276, OrangeColor16, false, false); // TRANSFER STABLED PETS TO MERCHANT AddButton(150, 390, 4005, 4007, 6, GumpButtonType.Reply, 0); AddHtmlLocalized(190, 390, 350, 18, 1150277, OrangeColor16, false, false); // TRANSFER MERCHANT INVENTORY TO STABLE AddButton(150, 415, 4005, 4007, 7, GumpButtonType.Reply, 0); AddHtmlLocalized(190, 415, 350, 18, 1150334, OrangeColor16, false, false); // VIEW INVENTORY / EDIT PRICES }
public void ConfirmMulti(bool commodity) { EndTempMultiTimer(); if (commodity) { Merchant = new CommodityBroker(this); } else { Merchant = new PetBroker(this); } }
public PetInventoryGump(PetBroker broker, Mobile from) { m_Broker = broker; m_Entries = broker.BrokerEntries; AddHtmlLocalized(215, 10, 200, 18, 1150311, RedColor16, false, false); // Animal Broker if (m_Broker.Plot.ShopName != null && m_Broker.Plot.ShopName.Length > 0) { AddHtml(173, 40, 173, 18, Color(FormatStallName(m_Broker.Plot.ShopName), BlueColor), false, false); } else { AddHtmlLocalized(180, 40, 200, 18, 1150314, BlueColor16, false, false); // This Shop Has No Name } AddHtml(173, 65, 173, 18, Color(FormatBrokerName(String.Format("Proprietor: {0}", broker.Name)), BlueColor), false, false); AddHtmlLocalized(205, 100, 200, 18, 1150346, GreenColor16, false, false); // PETS FOR SALE AddHtmlLocalized(10, 130, 500, 40, 1150352, GreenColor16, false, false); // LORE: See the animal's AddHtmlLocalized(5, 180, 45, 18, 1150351, OrangeColor16, false, false); // LORE AddHtmlLocalized(50, 180, 45, 18, 1150353, OrangeColor16, false, false); // VIEW AddHtmlLocalized(95, 180, 150, 18, 1150347, OrangeColor16, false, false); // NAME AddHtmlLocalized(245, 180, 150, 18, 1150348, OrangeColor16, false, false); // TYPE AddHtmlLocalized(425, 180, 80, 18, 1150349, OrangeColor16, false, false); // PRICE AddHtmlLocalized(480, 180, 55, 18, 1150350, OrangeColor16, false, false); // BUY int y = 200; for (int i = 0; i < m_Entries.Count; i++) { PetBrokerEntry entry = m_Entries[i]; if (entry == null || entry.Pet == null) { continue; } AddButton(5, y + (i * 20), 4011, 4013, 100 + i, GumpButtonType.Reply, 0); AddButton(50, y + (i * 20), 4008, 4010, 200 + i, GumpButtonType.Reply, 0); AddHtml(95, y + (i * 20), 145, 18, Color(entry.Pet.Name, BlueColor), false, false); AddHtml(245, y + (i * 20), 145, 18, Color(entry.TypeName, BlueColor), false, false); AddHtml(425, y + (i * 20), 80, 18, AlignRight(Color(FormatAmt(entry.SalePrice), GreenColor)), false, false); AddButton(480, y + (i * 20), 4014, 4016, 300 + i, GumpButtonType.Reply, 0); } }
public ConfirmBuyPetGump(PetBroker broker, PetBrokerEntry entry) { m_Broker = broker; m_Entry = entry; AddHtmlLocalized(10, 10, 500, 18, 1114513, "#1150311", RedColor16, false, false); // Animal Broker if (m_Broker.Plot.ShopName != null && m_Broker.Plot.ShopName.Length > 0) { AddHtml(10, 37, 500, 18, Color(FormatStallName(m_Broker.Plot.ShopName), BlueColor), false, false); } else { AddHtmlLocalized(10, 37, 500, 18, 1114513, "#1150314", BlueColor16, false, false); // This Shop Has No Name } AddHtmlLocalized(10, 55, 240, 18, 1114514, "#1150313", BlueColor16, false, false); // Proprietor: AddHtml(260, 55, 250, 18, Color(String.Format("{0}", broker.Name), BlueColor), false, false); AddHtmlLocalized(10, 91, 500, 18, 1114513, "#1150375", GreenColor16, false, false); // PURCHASE PET AddHtmlLocalized(10, 118, 500, 72, 1114513, "#1150370", GreenColor16, false, false); // Please confirm your purchase order below, and click "ACCEPT" if you wish to purchase this animal. AddHtmlLocalized(10, 235, 245, 18, 1114514, "#1150372", OrangeColor16, false, false); // Animal Name: AddHtmlLocalized(10, 255, 245, 18, 1114514, "#1150371", OrangeColor16, false, false); // Animal Type: AddHtmlLocalized(10, 275, 245, 18, 1114514, "#1150373", OrangeColor16, false, false); // Sale Price: AddHtml(265, 235, 245, 18, Color(entry.Pet.Name, BlueColor), false, false); AddHtml(265, 255, 245, 18, Color(entry.TypeName, BlueColor), false, false); AddHtml(265, 275, 245, 18, Color(FormatAmt(entry.SalePrice), BlueColor), false, false); /*int itemID = ShrinkTable.Lookup(entry.Pet); * //if (entry.Pet is WildTiger) * // itemID = 0x9844; * * AddItem(240, 250, itemID);*/ AddHtmlLocalized(265, 295, 245, 22, 1150374, OrangeColor16, false, false); // ACCEPT AddButton(225, 295, 4005, 4007, 1, GumpButtonType.Reply, 0); AddButton(10, 490, 0xFAE, 0xFAF, 2, GumpButtonType.Reply, 0); AddHtmlLocalized(50, 490, 210, 20, 1149777, BlueColor16, false, false); // MAIN MENU }
public SetPetPricesGump(PetBroker broker, int index) { m_Broker = broker; m_Index = index; AddHtmlLocalized(215, 10, 200, 18, 1150311, RedColor16, false, false); // Animal Broker AddHtmlLocalized(60, 90, 100, 18, 1150347, OrangeColor16, false, false); // NAME AddHtmlLocalized(220, 90, 100, 18, 1150348, OrangeColor16, false, false); // TYPE AddHtmlLocalized(400, 90, 100, 18, 1150349, OrangeColor16, false, false); // PRICE m_Broker.CheckInventory(); int y = 130; for (int i = 0; i < broker.BrokerEntries.Count; i++) { int col = index == i ? YellowColor : OrangeColor; PetBrokerEntry entry = broker.BrokerEntries[i]; AddHtml(60, y, 200, 18, Color(entry.Pet.Name != null ? entry.Pet.Name : "Unknown", col), false, false); AddHtml(220, y, 200, 18, Color(entry.TypeName, col), false, false); AddHtml(400, y, 200, 18, Color(FormatAmt(entry.SalePrice), col), false, false); AddButton(10, y, 4005, 4007, i + 3, GumpButtonType.Reply, 0); y += 22; } int price = index >= 0 && index < broker.BrokerEntries.Count ? broker.BrokerEntries[index].SalePrice : 0; AddHtmlLocalized(215, 380, 150, 18, 1150627, BlueColor16, false, false); // SET PRICE AddBackground(215, 405, 295, 22, 9350); AddTextEntry(216, 405, 294, 20, 0, 0, FormatAmt(price)); AddButton(175, 405, 4005, 4007, 500, GumpButtonType.Reply, 0); AddButton(10, 490, 4014, 4016, 1, GumpButtonType.Reply, 0); AddHtmlLocalized(50, 490, 100, 18, 1149777, BlueColor16, false, false); // MAIN MENU }
public PurchasePetGump(PetBroker broker, int cliloc) { m_Broker = broker; AddHtmlLocalized(10, 10, 500, 18, 1114513, "#1150311", RedColor16, false, false); // Animal Broker if (m_Broker.Plot.ShopName != null && m_Broker.Plot.ShopName.Length > 0) { AddHtml(10, 37, 500, 18, Color(FormatStallName(m_Broker.Plot.ShopName), BlueColor), false, false); } else { AddHtmlLocalized(10, 37, 500, 18, 1114513, "#1150314", BlueColor16, false, false); // This Shop Has No Name } AddHtmlLocalized(10, 55, 240, 18, 1114514, "#1150313", BlueColor16, false, false); // Proprietor: AddHtml(260, 55, 250, 18, Color(String.Format("{0}", broker.Name), BlueColor), false, false); AddHtmlLocalized(10, 127, 500, 534, 1114513, String.Format("#{0}", cliloc), OrangeColor16, false, false); AddButton(10, 490, 0xFAE, 0xFAF, 1, GumpButtonType.Reply, 0); AddHtmlLocalized(50, 490, 210, 20, 1149777, BlueColor16, false, false); // MAIN MENU }
public ConfirmBuyPetGump(PetBroker broker, PetBrokerEntry entry) { m_Broker = broker; m_Entry = entry; AddHtmlLocalized(215, 10, 200, 18, 1150311, RedColor16, false, false); // Animal Broker if (m_Broker.Plot.ShopName != null && m_Broker.Plot.ShopName.Length > 0) { AddHtml(173, 40, 173, 18, Color(FormatStallName(m_Broker.Plot.ShopName), BlueColor), false, false); } else { AddHtmlLocalized(180, 40, 200, 18, 1150314, BlueColor16, false, false); // This Shop Has No Name } AddHtml(173, 65, 173, 18, Color(FormatBrokerName(String.Format("Proprietor: {0}", broker.Name)), BlueColor), false, false); AddHtmlLocalized(10, 100, 500, 40, 1150370, RedColor16, false, false); // Please confirm your purchase order below, and click "ACCEPT" if you wish to purchase this animal. AddHtmlLocalized(150, 160, 200, 18, 1150371, OrangeColor16, false, false); // Animal Type: AddHtmlLocalized(145, 180, 200, 18, 1150372, OrangeColor16, false, false); // Animal Name: AddHtmlLocalized(157, 200, 150, 18, 1150373, OrangeColor16, false, false); // Sale Price: AddHtml(240, 160, 200, 18, Color(entry.TypeName, BlueColor), false, false); AddHtml(240, 180, 200, 18, Color(entry.Pet.Name, BlueColor), false, false); AddHtml(240, 200, 200, 18, Color(FormatAmt(entry.SalePrice), BlueColor), false, false); int itemID = ShrinkTable.Lookup(entry.Pet); //if (entry.Pet is WildTiger) // itemID = 0x9844; AddItem(240, 250, itemID); AddHtmlLocalized(240, 360, 150, 18, 1150375, OrangeColor16, false, false); // Purchas Pet AddButton(200, 360, 4005, 4007, 1, GumpButtonType.Reply, 0); }
public SelectPetsGump(PetBroker broker, Mobile from, int index) { m_Broker = broker; m_Index = index; AddHtmlLocalized(215, 10, 200, 18, 1150311, RedColor16, false, false); // Animal Broker AddHtmlLocalized(145, 50, 250, 18, 1150337, RedColor16, false, false); // ADD PET TO BROKER INVENTORY AddHtmlLocalized(10, 100, 500, 40, 1150338, GreenColor16, false, false); // Click the button next to a pet to select it. Enter the price you wish to charge into the box below the pet list, then click the "ADD PET" button. m_List = GetList(from); int y = 150; for (int i = 0; i < m_List.Count; i++) { int col = index == i ? YellowColor16 : OrangeColor16; BaseCreature bc = m_List[i]; if (bc == null) { continue; } AddButton(10, y, 4005, 4007, i + 1, GumpButtonType.Reply, 0); AddHtmlLocalized(60, y, 200, 18, 1150340, String.Format("{0}\t{1}", bc.Name, PetBrokerEntry.GetOriginalName(bc)), col, false, false); // ~1_NAME~ (~2_type~) y += 22; } AddHtmlLocalized(215, 380, 100, 18, 1150339, OrangeColor16, false, false); // ADD PET AddButton(175, 405, 4005, 4007, 501, GumpButtonType.Reply, 0); AddBackground(215, 405, 295, 22, 9350); AddTextEntry(216, 405, 294, 20, 0, 0, ""); AddButton(10, 490, 4014, 4016, 500, GumpButtonType.Reply, 0); AddHtmlLocalized(50, 490, 100, 18, 1149777, BlueColor16, false, false); // MAIN MENU }
public override void OnResponse(NetState state, RelayInfo info) { Mobile from = state.Mobile; if (info.ButtonID < 200) // LORE { int id = info.ButtonID - 100; if (id >= 0 && id < m_Entries.Count) { PetBrokerEntry entry = m_Entries[id]; if (entry != null && entry.Pet != null && m_Broker.BrokerEntries.Contains(entry)) { from.SendGump(new PetInventoryGump(m_Broker, from)); from.SendGump(new Server.SkillHandlers.AnimalLoreGump(entry.Pet)); } else { from.SendLocalizedMessage(1150368); // The selected animal is not available. } } } else if (info.ButtonID < 300) // VIEW { int id = info.ButtonID - 200; if (id >= 0 && id < m_Entries.Count) { PetBrokerEntry entry = m_Entries[id]; if (entry != null && entry.Pet != null && m_Broker.BrokerEntries.Contains(entry) && entry.Pet.IsStabled) { BaseCreature pet = entry.Pet; pet.Blessed = true; pet.SetControlMaster(m_Broker); pet.ControlTarget = m_Broker; pet.ControlOrder = OrderType.None; pet.MoveToWorld(m_Broker.Location, m_Broker.Map); pet.IsStabled = false; pet.Home = pet.Location; pet.RangeHome = 2; pet.Loyalty = BaseCreature.MaxLoyalty; PetBroker.AddToViewTimer(pet); from.SendLocalizedMessage(1150369, String.Format("{0}\t{1}", entry.TypeName, pet.Name)); // The ~1_TYPE~ named "~2_NAME~" is now in the animal broker's pen for inspection. } else { from.SendLocalizedMessage(1150368); // The selected animal is not available. } } from.SendGump(new PetInventoryGump(m_Broker, from)); } else // BUY { int id = info.ButtonID - 300; if (id >= 0 && id < m_Entries.Count) { PetBrokerEntry entry = m_Entries[id]; if (entry != null && entry.Pet != null && m_Broker.BrokerEntries.Contains(entry)) { from.SendGump(new ConfirmBuyPetGump(m_Broker, entry)); } } } }
public SelectPetsGump(PetBroker broker, Mobile from, int index) { m_Broker = broker; m_Index = index; AddHtmlLocalized(215, 10, 200, 18, 1150311, RedColor16, false, false); // Animal Broker AddHtmlLocalized(145, 50, 250, 18, 1150337, RedColor16, false, false); // ADD PET TO BROKER INVENTORY AddHtmlLocalized(10, 100, 500, 40, 1150338, GreenColor16, false, false); // Click the button next to a pet to select it. Enter the price you wish to charge into the box below the pet list, then click the "ADD PET" button. m_List = GetList(from); int y = 150; for(int i = 0; i < m_List.Count; i++) { int col = index == i ? YellowColor16 : OrangeColor16; BaseCreature bc = m_List[i]; if (bc == null) continue; AddButton(10, y, 4005, 4007, i + 1, GumpButtonType.Reply, 0); AddHtmlLocalized(60, y, 200, 18, 1150340, String.Format("{0}\t{1}", bc.Name, PetBrokerEntry.GetOriginalName(bc)), col, false, false); // ~1_NAME~ (~2_type~) y += 22; } AddHtmlLocalized(215, 380, 100, 18, 1150339, OrangeColor16, false, false); // ADD PET AddButton(175, 405, 4005, 4007, 501, GumpButtonType.Reply, 0); AddBackground(215, 405, 295, 22, 9350); AddTextEntry(216, 405, 294, 20, 0, 0, ""); AddButton(10, 490, 4014, 4016, 500, GumpButtonType.Reply, 0); AddHtmlLocalized(50, 490, 100, 18, 1149777, BlueColor16, false, false); // MAIN MENU }
public RemovePetsGump(PetBroker broker, Mobile from) : this(broker, from, -1) { }
public SetPetPricesGump(PetBroker broker) : this(broker, -1) { }
public RemovePetsGump(PetBroker broker, Mobile from, int index) { m_Broker = broker; m_Index = index; AddHtmlLocalized(215, 10, 200, 18, 1150311, RedColor16, false, false); // Animal Broker AddHtmlLocalized(145, 50, 250, 18, 1150337, RedColor16, false, false); // ADD PET TO BROKER INVENTORY AddHtmlLocalized(10, 80, 500, 40, 1150633, GreenColor16, false, false); // Click the button next to a pet to select it, then click the REMOVE PET button below to transfer that pet to your stables. m_Broker.CheckInventory(); int y = 130; for(int i = 0; i < broker.BrokerEntries.Count; i++) { BaseCreature bc = broker.BrokerEntries[i].Pet; int col = index == i ? YellowColor16 : OrangeColor16; AddButton(10, y, 4005, 4007, i + 1, GumpButtonType.Reply, 0); AddHtmlLocalized(50, y, 200, 18, 1150340, String.Format("{0}\t{1}", bc.Name, PetBrokerEntry.GetOriginalName(bc)), col, false, false); // ~1_NAME~ (~2_type~) y += 20; } AddHtmlLocalized(215, 405, 150, 18, 1150632, OrangeColor16, false, false); // REMOVE PET AddButton(175, 405, 4014, 4016, 501, GumpButtonType.Reply, 0); AddButton(10, 490, 4014, 4016, 500, GumpButtonType.Reply, 0); AddHtmlLocalized(50, 490, 100, 18, 1149777, BlueColor16, false, false); // MAIN MENU }
public void ConfirmMulti(bool commodity) { EndTempMultiTimer(); if(commodity) Merchant = new CommodityBroker(this); else Merchant = new PetBroker(this); }
public SelectPetsGump(PetBroker broker, Mobile from) : this(broker, from, -1) { }
public SetPetPricesGump(PetBroker broker, int index) { m_Broker = broker; m_Index = index; AddHtmlLocalized(215, 10, 200, 18, 1150311, RedColor16, false, false); // Animal Broker AddHtmlLocalized(60, 90, 100, 18, 1150347, OrangeColor16, false, false); // NAME AddHtmlLocalized(220, 90, 100, 18, 1150348, OrangeColor16, false, false); // TYPE AddHtmlLocalized(400, 90, 100, 18, 1150349, OrangeColor16, false, false); // PRICE m_Broker.CheckInventory(); int y = 130; for(int i = 0; i < broker.BrokerEntries.Count; i++) { int col = index == i ? YellowColor : OrangeColor; PetBrokerEntry entry = broker.BrokerEntries[i]; AddHtml(60, y, 200, 18, Color(entry.Pet.Name != null ? entry.Pet.Name : "Unknown", col), false, false); AddHtml(220, y, 200, 18, Color(entry.TypeName, col), false, false); AddHtml(400, y, 200, 18, Color(FormatAmt(entry.SalePrice), col), false, false); AddButton(10, y, 4005, 4007, i + 3, GumpButtonType.Reply, 0); y += 22; } int price = index >= 0 && index < broker.BrokerEntries.Count ? broker.BrokerEntries[index].SalePrice : 0; AddHtmlLocalized(215, 380, 150, 18, 1150627, BlueColor16, false, false); // SET PRICE AddBackground(215, 405, 295, 22, 9350); AddTextEntry(216, 405, 294, 20, 0, 0, FormatAmt(price)); AddButton(175, 405, 4005, 4007, 500, GumpButtonType.Reply, 0); AddButton(10, 490, 4014, 4016, 1, GumpButtonType.Reply, 0); AddHtmlLocalized(50, 490, 100, 18, 1149777, BlueColor16, false, false); // MAIN MENU }
public PetInventoryGump(PetBroker broker, Mobile from) { m_Broker = broker; m_Entries = broker.BrokerEntries; AddHtmlLocalized(215, 10, 200, 18, 1150311, RedColor16, false, false); // Animal Broker if (m_Broker.Plot.ShopName != null && m_Broker.Plot.ShopName.Length > 0) AddHtml(173, 40, 173, 18, Color(FormatStallName(m_Broker.Plot.ShopName), BlueColor), false, false); else AddHtmlLocalized(180, 40, 200, 18, 1150314, BlueColor16, false, false); // This Shop Has No Name AddHtml(173, 65, 173, 18, Color(FormatBrokerName(String.Format("Proprietor: {0}", broker.Name)), BlueColor), false, false); AddHtmlLocalized(205, 100, 200, 18, 1150346, GreenColor16, false, false); // PETS FOR SALE AddHtmlLocalized(10, 130, 500, 40, 1150352, GreenColor16, false, false); // LORE: See the animal's AddHtmlLocalized(5, 180, 45, 18, 1150351, OrangeColor16, false, false); // LORE AddHtmlLocalized(50, 180, 45, 18, 1150353, OrangeColor16, false, false); // VIEW AddHtmlLocalized(95, 180, 150, 18, 1150347, OrangeColor16, false, false); // NAME AddHtmlLocalized(245, 180, 150, 18, 1150348, OrangeColor16, false, false); // TYPE AddHtmlLocalized(425, 180, 80, 18, 1150349, OrangeColor16, false, false); // PRICE AddHtmlLocalized(480, 180, 55, 18, 1150350, OrangeColor16, false, false); // BUY int y = 200; for(int i = 0; i < m_Entries.Count; i++) { PetBrokerEntry entry = m_Entries[i]; if(entry == null || entry.Pet == null) continue; AddButton(5, y + (i * 20), 4011, 4013, 100 + i, GumpButtonType.Reply, 0); AddButton(50, y + (i * 20), 4008, 4010, 200 + i, GumpButtonType.Reply, 0); AddHtml(95, y + (i * 20), 145, 18, Color(entry.Pet.Name, BlueColor), false, false); AddHtml(245, y + (i * 20), 145, 18, Color(entry.TypeName, BlueColor), false, false); AddHtml(425, y + (i * 20), 80, 18, AlignRight(Color(FormatAmt(entry.SalePrice), GreenColor)), false, false); AddButton(480, y + (i * 20), 4014, 4016, 300 + i, GumpButtonType.Reply, 0); } }
public ConfirmBuyPetGump(PetBroker broker, PetBrokerEntry entry) { m_Broker = broker; m_Entry = entry; AddHtmlLocalized(215, 10, 200, 18, 1150311, RedColor16, false, false); // Animal Broker if (m_Broker.Plot.ShopName != null && m_Broker.Plot.ShopName.Length > 0) AddHtml(173, 40, 173, 18, Color(FormatStallName(m_Broker.Plot.ShopName), BlueColor), false, false); else AddHtmlLocalized(180, 40, 200, 18, 1150314, BlueColor16, false, false); // This Shop Has No Name AddHtml(173, 65, 173, 18, Color(FormatBrokerName(String.Format("Proprietor: {0}", broker.Name)), BlueColor), false, false); AddHtmlLocalized(10, 100, 500, 40, 1150370, RedColor16, false, false); // Please confirm your purchase order below, and click "ACCEPT" if you wish to purchase this animal. AddHtmlLocalized(150, 160, 200, 18, 1150371, OrangeColor16, false, false); // Animal Type: AddHtmlLocalized(145, 180, 200, 18, 1150372, OrangeColor16, false, false); // Animal Name: AddHtmlLocalized(157, 200, 150, 18, 1150373, OrangeColor16, false, false); // Sale Price: AddHtml(240, 160, 200, 18, Color(entry.TypeName, BlueColor), false, false); AddHtml(240, 180, 200, 18, Color(entry.Pet.Name, BlueColor), false, false); AddHtml(240, 200, 200, 18, Color(FormatAmt(entry.SalePrice), BlueColor), false, false); int itemID = ShrinkTable.Lookup(entry.Pet); //if (entry.Pet is WildTiger) // itemID = 0x9844; AddItem(240, 250, itemID); AddHtmlLocalized(240, 360, 150, 18, 1150375, OrangeColor16, false, false); // Purchas Pet AddButton(200, 360, 4005, 4007, 1, GumpButtonType.Reply, 0); }
protected override void OnTick() { PetBroker.SendToBrokerStables(m_Creature); }
public void OnTick() { foreach (MaginciaBazaarPlot plot in m_Plots) { if (plot.Active) { plot.OnTick(); } } List <Mobile> toRemove = new List <Mobile>(); foreach (KeyValuePair <Mobile, StorageEntry> kvp in m_WarehouseStorage) { Mobile m = kvp.Key; StorageEntry entry = kvp.Value; if (entry.Expires < DateTime.UtcNow) { bool deleted = false; bool stabled = false; if (entry.CommodityTypes.Count > 0) { deleted = true; } foreach (BaseCreature bc in entry.Creatures) { if (m.Stabled.Count < AnimalTrainer.GetMaxStabled(m)) { PetBroker.SendToStables(m, bc); if (!stabled) { stabled = true; } } else { if (!deleted) { deleted = true; } bc.Delete(); } } if (stabled) { string message; if (deleted) { message = "Your broker inventory and/or funds in storage at the New Magincia Warehouse " + "have been donated to charity, because these items remained unclaimed for a " + "full week. These items may no longer be recovered, but the orphans will " + "appreciate a nice hot meal. One or all of your pets have been placed in your stables."; } else { message = "Because your pets remained in storage for more than a full week, one or all of them have been placed in your stables. " + "If you had insufficient room in your stables, any further pets will be lost and returned to the wild."; } MaginciaLottoSystem.SendMessageTo(m, new NewMaginciaMessage(new TextDefinition(1150676), message, null)); } else if (deleted) { toRemove.Add(m); /*Your broker inventory and/or funds in storage at the New Magincia Warehouse * have been donated to charity, because these items remained unclaimed for a * full week. These items may no longer be recovered, but the orphans will * appreciate a nice hot meal.*/ MaginciaLottoSystem.SendMessageTo(m, new NewMaginciaMessage(new TextDefinition(1150676), new TextDefinition(1150673), null)); } } } foreach (Mobile m in toRemove) { if (m_WarehouseStorage.ContainsKey(m)) { m_WarehouseStorage.Remove(m); } } ColUtility.Free(toRemove); }