Overwrite
Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
@@ -0,0 +1,173 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using Server.Gumps;
|
||||
using System.Collections.Generic;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Engines.NewMagincia
|
||||
{
|
||||
public class LottoTrackingGump : Gump
|
||||
{
|
||||
private readonly int LabelColor = 0xFFFFFF;
|
||||
private List<MaginciaHousingPlot> m_List;
|
||||
|
||||
public LottoTrackingGump() : base(50, 50)
|
||||
{
|
||||
AddBackground(0, 0, 410, 564, 9500);
|
||||
|
||||
AddHtml(205, 10, 205, 20, "<DIV ALIGN=RIGHT><Basefont Color=#FFFFFF>New Magincia Lotto Tracking</DIV>", false, false);
|
||||
AddHtml(10, 10, 205, 20, Color(String.Format("Gold Sink: {0}", MaginciaLottoSystem.GoldSink.ToString("###,###,###")), 0xFFFFFF), false, false);
|
||||
|
||||
AddHtml(45, 40, 40, 20, Color("ID", LabelColor), false, false);
|
||||
AddHtml(85, 40, 60, 20, Color("Facet", LabelColor), false, false);
|
||||
AddHtml(145, 40, 40, 20, Color("#bids", LabelColor), false, false);
|
||||
|
||||
m_List = new List<MaginciaHousingPlot>(MaginciaLottoSystem.Plots);
|
||||
|
||||
int y = 60;
|
||||
int x = 0;
|
||||
for (int i = 0; i < m_List.Count; i++)
|
||||
{
|
||||
MaginciaHousingPlot plot = m_List[i];
|
||||
|
||||
if(plot == null)
|
||||
continue;
|
||||
|
||||
int bids = 0;
|
||||
foreach(int bid in plot.Participants.Values)
|
||||
bids += bid;
|
||||
|
||||
AddButton(10 + x, y, 4005, 4007, i + 5, GumpButtonType.Reply, 0);
|
||||
AddHtml(45 + x, y, 40, 22, Color(plot.Identifier, LabelColor), false, false);
|
||||
AddHtml(85 + x, y, 60, 22, Color(plot.Map.ToString(), LabelColor), false, false);
|
||||
|
||||
if(plot.LottoOngoing)
|
||||
AddHtml(145 + x, y, 40, 22, Color(bids.ToString(), LabelColor), false, false);
|
||||
else if (plot.Complete)
|
||||
AddHtml(145 + x, y, 40, 22, Color("Owned", "red"), false, false);
|
||||
else
|
||||
AddHtml(145 + x, y, 40, 22, Color("Expired", "red"), false, false);
|
||||
|
||||
if (i == 21)
|
||||
{
|
||||
y = 60;
|
||||
x = 200;
|
||||
|
||||
AddHtml(45 + x, 40, 40, 20, Color("ID", LabelColor), false, false);
|
||||
AddHtml(85 + x, 40, 60, 20, Color("Facet", LabelColor), false, false);
|
||||
AddHtml(145 + x, 40, 40, 20, Color("#bids", LabelColor), false, false);
|
||||
}
|
||||
else
|
||||
y += 22;
|
||||
}
|
||||
}
|
||||
|
||||
private string Color(string str, int color)
|
||||
{
|
||||
return String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", color, str);
|
||||
}
|
||||
|
||||
private string Color(string str, string color)
|
||||
{
|
||||
return String.Format("<BASEFONT COLOR={0}>{1}</BASEFONT>", color, str);
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState state, RelayInfo info)
|
||||
{
|
||||
Mobile from = state.Mobile;
|
||||
|
||||
if (info.ButtonID >= 5 && from.AccessLevel > AccessLevel.Player)
|
||||
{
|
||||
int index = info.ButtonID - 5;
|
||||
|
||||
if (index >= 0 && index < m_List.Count)
|
||||
{
|
||||
MaginciaHousingPlot plot = m_List[index];
|
||||
|
||||
if (plot != null)
|
||||
{
|
||||
from.SendGump(new PlotTrackingGump(plot));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class PlotTrackingGump : Gump
|
||||
{
|
||||
public PlotTrackingGump(MaginciaHousingPlot plot) : base(50, 50)
|
||||
{
|
||||
int partCount = plot.Participants.Count;
|
||||
int y = 544;
|
||||
int x = 600;
|
||||
|
||||
AddBackground(0, 0, x, y, 9500);
|
||||
|
||||
AddHtml(10, 10, 580, 20, String.Format("<Center><Basefont Color=#FFFFFF>Plot {0}</Center>", plot.Identifier), false, false);
|
||||
|
||||
AddHtml(10, 40, 80, 20, Color("Player", 0xFFFFFF), false, false);
|
||||
AddHtml(92, 40, 60, 20, Color("Tickets", 0xFFFFFF), false, false);
|
||||
AddHtml(154, 40, 60, 20, Color("Total Gold", 0xFFFFFF), false, false);
|
||||
|
||||
x = 0;
|
||||
y = 60;
|
||||
int goldSink = 0;
|
||||
|
||||
List<Mobile> mobiles = new List<Mobile>(plot.Participants.Keys);
|
||||
List<int> amounts = new List<int>(plot.Participants.Values);
|
||||
|
||||
for (int i = 0; i < mobiles.Count; i++)
|
||||
{
|
||||
Mobile m = mobiles[i];
|
||||
int amt = amounts[i];
|
||||
int total = amt * plot.LottoPrice;
|
||||
goldSink += total;
|
||||
|
||||
AddHtml(10 + x, y, 80, 22, Color(m.Name, 0xFFFFFF), false, false);
|
||||
AddHtml(92 + x, y, 60, 22, Color(amt.ToString(), 0xFFFFFF), false, false);
|
||||
AddHtml(154 + x, y, 60, 22, Color(total.ToString(), 0xFFFFFF), false, false);
|
||||
|
||||
if (i == 21)
|
||||
{
|
||||
x = 200;
|
||||
y = 60;
|
||||
|
||||
AddHtml(10 + x, 40, 80, 20, Color("Player", 0xFFFFFF), false, false);
|
||||
AddHtml(92 + x, 40, 60, 20, Color("Tickets", 0xFFFFFF), false, false);
|
||||
AddHtml(154 + x, 40, 60, 20, Color("Total Gold", 0xFFFFFF), false, false);
|
||||
}
|
||||
else if (i == 43)
|
||||
{
|
||||
x = 400;
|
||||
y = 60;
|
||||
|
||||
AddHtml(10 + x, 40, 80, 20, Color("Player", 0xFFFFFF), false, false);
|
||||
AddHtml(92 + x, 40, 60, 20, Color("Tickets", 0xFFFFFF), false, false);
|
||||
AddHtml(154 + x, 40, 60, 20, Color("Total Gold", 0xFFFFFF), false, false);
|
||||
}
|
||||
else
|
||||
y += 22;
|
||||
}
|
||||
|
||||
AddHtml(10, 10, 150, 20, Color(String.Format("Gold Sink: {0}", goldSink.ToString()), 0xFFFFFF), false, false);
|
||||
|
||||
AddButton(10, 544 - 32, 4014, 4016, 1, GumpButtonType.Reply, 0);
|
||||
AddHtml(45, 544 - 32, 150, 20, Color("Back", 0xFFFFFF), false, false);
|
||||
}
|
||||
|
||||
private string Color(string str, int color)
|
||||
{
|
||||
return String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", color, str);
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState state, RelayInfo info)
|
||||
{
|
||||
Mobile from = state.Mobile;
|
||||
|
||||
if (info.ButtonID == 1)
|
||||
from.SendGump(new LottoTrackingGump());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Engines.NewMagincia
|
||||
{
|
||||
public class MaginciaLottoGump : Gump
|
||||
{
|
||||
private MaginciaHousingPlot m_Plot;
|
||||
private Mobile m_From;
|
||||
|
||||
private readonly int BlueColor = 0x00BFFF;
|
||||
private readonly int LabelColor = 0xFFFFFF;
|
||||
private readonly int EntryColor = 0xE9967A;
|
||||
|
||||
public MaginciaLottoGump(Mobile from, MaginciaHousingPlot plot) : base(75, 75)
|
||||
{
|
||||
m_Plot = plot;
|
||||
m_From = from;
|
||||
|
||||
bool prime = plot.IsPrimeSpot;
|
||||
|
||||
int ticketsBought = 0;
|
||||
if (plot.Participants.ContainsKey(from))
|
||||
ticketsBought = plot.Participants[from];
|
||||
|
||||
int totalTicketsSold = 0;
|
||||
foreach (int i in plot.Participants.Values)
|
||||
totalTicketsSold += i;
|
||||
|
||||
AddBackground(0, 0, 350, 380, 9500);
|
||||
|
||||
AddHtmlLocalized(10, 10, 200, 20, 1150460, BlueColor, false, false); // New Magincia Housing Lottery
|
||||
|
||||
AddHtmlLocalized(10, 50, 75, 20, 1150461, BlueColor, false, false); // This Facet:
|
||||
AddHtml(170, 50, 100, 16, String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", LabelColor, plot.Map.ToString()), false, false);
|
||||
|
||||
AddHtmlLocalized(10, 70, 75, 20, 1150462, BlueColor, false, false); // This Plot:
|
||||
AddHtml(170, 70, 100, 16, String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", EntryColor, plot.Identifier), false, false);
|
||||
|
||||
AddHtmlLocalized(10, 95, 130, 20, 1150463, BlueColor, false, false); // Total Tickets Sold:
|
||||
AddHtml(170, 95, 100, 16, String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", EntryColor, totalTicketsSold.ToString()), false, false);
|
||||
|
||||
AddHtmlLocalized(10, 110, 320, 40, prime ? 1150464 : 1150465, LabelColor, false, false);
|
||||
|
||||
AddHtmlLocalized(10, 160, 90, 20, 1150466, BlueColor, false, false); // Your Tickets:
|
||||
AddHtml(170, 160, 100, 20, String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", EntryColor, ticketsBought.ToString()), false, false);
|
||||
|
||||
if (ticketsBought == 0)
|
||||
AddHtmlLocalized(10, 175, 320, 40, 1150467, LabelColor, false, false); // You have not bought a ticket, so you have no chance of winning this plot.
|
||||
else
|
||||
{
|
||||
int odds = totalTicketsSold / ticketsBought;
|
||||
|
||||
AddHtmlLocalized(10, 175, 320, 40, 1150468, odds.ToString(), LabelColor, false, false); // Your chances of winning this plot are currently about 1 in ~1_ODDS~
|
||||
}
|
||||
|
||||
AddHtmlLocalized(10, 225, 115, 20, 1150472, BlueColor, false, false); // Price Per Ticket:
|
||||
AddHtml(170, 225, 100, 20, String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", EntryColor, plot.LottoPrice.ToString("###,###,###")), false, false);
|
||||
|
||||
if (plot.LottoOngoing)
|
||||
{
|
||||
if (!prime)
|
||||
{
|
||||
AddButton(310, 245, 4005, 4007, 1, GumpButtonType.Reply, 0);
|
||||
AddImageTiled(170, 245, 130, 20, 3004);
|
||||
AddTextEntry(172, 245, 126, 16, 0, 0, "");
|
||||
AddHtmlLocalized(10, 245, 100, 20, 1150477, BlueColor, false, false); // Buy Tickets
|
||||
}
|
||||
else
|
||||
{
|
||||
if (plot.CanPurchaseLottoTicket(from))
|
||||
{
|
||||
AddButton(125, 245, 4014, 4007, 2, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(165, 242, 100, 20, 1150469, BlueColor, false, false); // Buy Ticket
|
||||
}
|
||||
else
|
||||
AddHtmlLocalized(10, 240, 320, 40, 1150475, LabelColor, false, false); // You may not purchase another ticket for this plot's lottery.
|
||||
}
|
||||
}
|
||||
else
|
||||
AddHtml(10, 240, 320, 40, "<BASEFONT COLOR=#{0:X6}>The lottery on this plot is currently disabled.</BASEFONT>", false, false);
|
||||
|
||||
TimeSpan ts = plot.LottoEnds - DateTime.UtcNow;
|
||||
|
||||
AddHtmlLocalized(10, 300, 320, 40, 1150476, LabelColor, false, false); // Ticket purchases are NONREFUNDABLE. Odds of winning may vary.
|
||||
|
||||
if(ts.Days > 0)
|
||||
AddHtmlLocalized(10, 340, 320, 20, 1150504, ts.Days.ToString(), LabelColor, false, false); // There are ~1_DAYS~ days left before the drawing.
|
||||
else
|
||||
AddHtmlLocalized(10, 340, 320, 20, 1150503, LabelColor, false, false); // The lottery drawing will happen in less than 1 day.
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState state, RelayInfo info)
|
||||
{
|
||||
bool prime = m_Plot.IsPrimeSpot;
|
||||
|
||||
if (info.ButtonID == 0)
|
||||
return;
|
||||
|
||||
if ((prime && !m_Plot.CanPurchaseLottoTicket(m_From)) || !m_Plot.LottoOngoing)
|
||||
return;
|
||||
|
||||
int pricePer = m_Plot.LottoPrice;
|
||||
int total = pricePer;
|
||||
int toBuy = 1;
|
||||
|
||||
if (!prime && info.ButtonID == 1)
|
||||
{
|
||||
toBuy = 0;
|
||||
TextRelay relay = info.GetTextEntry(0);
|
||||
string text = relay.Text;
|
||||
|
||||
try
|
||||
{
|
||||
toBuy = Convert.ToInt32(text);
|
||||
}
|
||||
catch { }
|
||||
|
||||
if (toBuy <= 0)
|
||||
return;
|
||||
}
|
||||
|
||||
if(toBuy > 1)
|
||||
total = toBuy * pricePer;
|
||||
|
||||
if (Banker.Withdraw(m_From, total))
|
||||
{
|
||||
MaginciaLottoSystem.GoldSink += total;
|
||||
m_From.SendLocalizedMessage(1150480, String.Format("{0}\t{1}\t{2}", toBuy.ToString(), pricePer.ToString(), total.ToString())); // Purchase of ~1_COUNT~ ticket(s) at ~2_PRICE~gp each costs a total of ~3_TOTAL~. The funds have been withdrawn from your bank box and your ticket purchase has been recorded.
|
||||
m_Plot.PurchaseLottoTicket(m_From, toBuy);
|
||||
}
|
||||
else
|
||||
m_From.SendLocalizedMessage(1150479, String.Format("{0}\t{1}\t{2}", toBuy.ToString(), pricePer.ToString(), total.ToString())); // Purchase of ~1_COUNT~ ticket(s) at ~2_PRICE~gp each costs a total of ~3_TOTAL~. You do not have the required funds in your bank box to make the purchase.
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,259 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Mobiles;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Engines.NewMagincia
|
||||
{
|
||||
public class NewMaginciaMessageGump : BaseGump
|
||||
{
|
||||
public List<NewMaginciaMessage> Messages;
|
||||
|
||||
public readonly int LightBlueColor = 0x4AFD;
|
||||
public readonly int GreenColor = 0x4BB7;
|
||||
|
||||
public NewMaginciaMessageGump(PlayerMobile from)
|
||||
: base(from, 490, 30)
|
||||
{
|
||||
Messages = MaginciaLottoSystem.GetMessages(from);
|
||||
}
|
||||
|
||||
public override void AddGumpLayout()
|
||||
{
|
||||
AddPage(0);
|
||||
|
||||
AddBackground(0, 0, 164, 32, 0x24B8);
|
||||
AddButton(7, 7, 0x1523, 0x1523, 1, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(37, 7, 120, 18, 1150425, String.Format("{0}", Messages.Count), GreenColor, false, false); // ~1_COUNT~ Messages
|
||||
}
|
||||
|
||||
public override void OnResponse(RelayInfo info)
|
||||
{
|
||||
switch (info.ButtonID)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
if (Messages.Count != 0)
|
||||
{
|
||||
SendGump(new NewMaginciaMessageGump(User));
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
SendGump(new NewMaginciaMessageListGump(User));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class NewMaginciaMessageListGump : BaseGump
|
||||
{
|
||||
public readonly int GreenColor = 0x4BB7;
|
||||
public readonly int LightBlueColor = 0x4AFD;
|
||||
|
||||
public bool Widescreen;
|
||||
public List<NewMaginciaMessage> Messages;
|
||||
|
||||
public NewMaginciaMessageListGump(PlayerMobile from, bool widescreen = false)
|
||||
: base(from, 490, 30)
|
||||
{
|
||||
Widescreen = widescreen;
|
||||
Messages = MaginciaLottoSystem.GetMessages(from);
|
||||
}
|
||||
|
||||
public override void AddGumpLayout()
|
||||
{
|
||||
if (Messages == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
AddPage(0);
|
||||
|
||||
int width = (Widescreen ? 200 : 0);
|
||||
int buttonid = (Widescreen ? 0x1519 : 0x151A);
|
||||
|
||||
AddBackground(0, 0, 314 + width, 241 + width, 0x24B8);
|
||||
AddButton(7, 7, 0x1523, 0x1523, 0, GumpButtonType.Reply, 0);
|
||||
AddButton(290 + width, 7, buttonid, buttonid, 1, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(47, 7, Widescreen ? 460 : 194, 18, 1150425, String.Format("{0}", Messages.Count), GreenColor, false, false); // ~1_COUNT~ Messages
|
||||
|
||||
int page = 1;
|
||||
int y = 0;
|
||||
|
||||
AddPage(page);
|
||||
|
||||
for (int i = 0; i < Messages.Count; i++)
|
||||
{
|
||||
if (page > 1)
|
||||
AddButton(Widescreen ? 446 : 246, 7, 0x1458, 0x1458, 0, GumpButtonType.Page, page - 1);
|
||||
|
||||
var message = Messages[i];
|
||||
|
||||
if (message == null)
|
||||
continue;
|
||||
|
||||
if (message.Body.Number > 0)
|
||||
{
|
||||
if (message.Args == null)
|
||||
{
|
||||
AddHtmlLocalized(47, 34 + (y * 32), 260 + width, 16, message.Body, LightBlueColor, false, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddHtmlLocalized(47, 34 + (y * 32), 260 + width, 16, message.Body, message.Args, LightBlueColor, false, false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
AddHtml(40, 34 + (y * 32), 260 + width, 16, Color("#94BDEF", message.Body.String), false, false);
|
||||
}
|
||||
|
||||
AddButton(7, 34 + (y * 32), 4029, 4031, i + 1000, GumpButtonType.Reply, 0);
|
||||
|
||||
y++;
|
||||
|
||||
bool pages = Widescreen && (i + 1) % 12 == 0 || !Widescreen && (i + 1) % 6 == 0;
|
||||
|
||||
if (pages && Messages.Count - 1 != i)
|
||||
{
|
||||
AddButton(Widescreen ? 468 : 268, 7, 0x1459, 0x1459, 0, GumpButtonType.Page, page + 1);
|
||||
page++;
|
||||
y = 0;
|
||||
|
||||
AddPage(page);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnResponse(RelayInfo info)
|
||||
{
|
||||
switch (info.ButtonID)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
SendGump(new NewMaginciaMessageGump(User));
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
SendGump(new NewMaginciaMessageListGump(User, Widescreen ? false : true));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
int id = info.ButtonID - 1000;
|
||||
|
||||
if (id >= 0 && id < Messages.Count)
|
||||
{
|
||||
SendGump(new NewMaginciaMessageDetailGump(User, Messages, id));
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class NewMaginciaMessageDetailGump : BaseGump
|
||||
{
|
||||
public NewMaginciaMessage Message;
|
||||
public List<NewMaginciaMessage> Messages;
|
||||
|
||||
public readonly int GreenColor = 0x4BB7;
|
||||
public readonly int BlueColor = 0x110;
|
||||
public readonly int EntryColor = 0x76F2;
|
||||
|
||||
public NewMaginciaMessageDetailGump(PlayerMobile from, List<NewMaginciaMessage> messages, int messageid)
|
||||
: base(from, 490, 30)
|
||||
{
|
||||
Messages = messages;
|
||||
Message = messages[messageid];
|
||||
|
||||
|
||||
}
|
||||
|
||||
public override void AddGumpLayout()
|
||||
{
|
||||
if (Message != null)
|
||||
{
|
||||
AddPage(0);
|
||||
|
||||
AddBackground(0, 0, 414, 341, 0x24B8);
|
||||
AddButton(7, 7, 0x1523, 0x1523, 0, GumpButtonType.Reply, 0);
|
||||
AddButton(390, 7, 0x1519, 0x151A, 1, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(47, 7, 360, 18, 1150425, String.Format("{0}", Messages.Count), GreenColor, false, false); // ~1_COUNT~ Messages
|
||||
|
||||
if (Message.Body != null)
|
||||
{
|
||||
if (Message.Body.Number != 0)
|
||||
{
|
||||
if (Message.Args == null)
|
||||
{
|
||||
AddHtmlLocalized(7, 34, 404, 150, Message.Body.Number, BlueColor, true, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddHtmlLocalized(7, 34, 404, 150, Message.Body.Number, Message.Args, BlueColor, true, true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
AddHtml(7, 34, 404, 150, Color("#004284", Message.Body.String), true, true);
|
||||
}
|
||||
}
|
||||
|
||||
TimeSpan ts = Message.Expires - DateTime.UtcNow;
|
||||
|
||||
AddHtmlLocalized(7, 194, 400, 18, 1150432, String.Format("@{0}@{1}@{2}", ts.Days, ts.Hours, ts.Minutes), GreenColor, false, false); // This message will expire in ~1_DAYS~ days, ~2_HOURS~ hours, and ~3_MIN~ minutes.
|
||||
|
||||
AddHtmlLocalized(47, 212, 360, 22, 1150433, EntryColor, false, false); // DELETE NOW
|
||||
AddButton(7, 212, 4005, 4007, 2, GumpButtonType.Reply, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnResponse(RelayInfo info)
|
||||
{
|
||||
switch (info.ButtonID)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
SendGump(new NewMaginciaMessageGump(User));
|
||||
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
SendGump(new NewMaginciaMessageListGump(User));
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
if (Message != null)
|
||||
{
|
||||
List<NewMaginciaMessage> messages = MaginciaLottoSystem.MessageQueue[User];
|
||||
|
||||
if (messages == null)
|
||||
{
|
||||
MaginciaLottoSystem.MessageQueue.Remove(User);
|
||||
}
|
||||
else
|
||||
{
|
||||
MaginciaLottoSystem.RemoveMessageFromQueue(User, Message);
|
||||
|
||||
if (MaginciaLottoSystem.HasMessageInQueue(User))
|
||||
{
|
||||
SendGump(new NewMaginciaMessageListGump(User));
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using Server.Gumps;
|
||||
using System.Collections.Generic;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Engines.NewMagincia
|
||||
{
|
||||
public class PlotWinnerGump : Gump
|
||||
{
|
||||
private MaginciaHousingPlot m_Plot;
|
||||
|
||||
private readonly int BlueColor = 0x1E90FF;
|
||||
private readonly int GreenColor = 0x7FFFD4;
|
||||
private readonly int EntryColor = 0xFF7F50;
|
||||
|
||||
public PlotWinnerGump(MaginciaHousingPlot plot) : base(75, 75)
|
||||
{
|
||||
m_Plot = plot;
|
||||
|
||||
AddBackground(0, 0, 424, 351, 9500);
|
||||
AddImage(5, 10, 5411);
|
||||
|
||||
AddHtmlLocalized(170, 13, 150, 16, 1150484, GreenColor, false, false); // WRIT OF LEASE
|
||||
|
||||
string args = String.Format("{0}\t{1}\t{2}", plot.Identifier, plot.Map, String.Format("{0} {1}", plot.Bounds.X, plot.Bounds.Y));
|
||||
AddHtmlLocalized(10, 40, 404, 180, 1150499, args, BlueColor, true, true);
|
||||
|
||||
AddButton(5, 235, 4005, 4007, 1, GumpButtonType.Reply, 0);
|
||||
AddHtmlLocalized(50, 235, 150, 16, 1150498, EntryColor, false, false); // CLAIM DEED
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState state, RelayInfo info)
|
||||
{
|
||||
Mobile winner = state.Mobile;
|
||||
|
||||
if (info.ButtonID == 1)
|
||||
{
|
||||
WritOfLease writ = new WritOfLease(m_Plot);
|
||||
m_Plot.Writ = writ;
|
||||
m_Plot.Winner = null;
|
||||
|
||||
if (winner.Backpack == null || !winner.Backpack.TryDropItem(winner, writ, false))
|
||||
{
|
||||
winner.SendLocalizedMessage(1150501); // Your backpack is full, so the deed has been placed in your bank box.
|
||||
winner.BankBox.DropItem(writ);
|
||||
}
|
||||
else
|
||||
winner.SendLocalizedMessage(1150500); // The deed has been placed in your backpack.
|
||||
|
||||
MaginciaLottoSystem.GetWinnerGump(winner);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user