Overwrite

Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
Unstable Kitsune
2023-11-28 23:20:26 -05:00
parent 3cd54811de
commit b918192e4e
11608 changed files with 2644205 additions and 47 deletions

View File

@@ -0,0 +1,85 @@
using System;
using Server;
using Server.Items;
using Server.Mobiles;
using Server.Gumps;
using Server.Guilds;
using Server.Network;
using System.Collections.Generic;
using System.Globalization;
namespace Server.Engines.VvV
{
public class BattleStatsGump : Gump
{
public VvVBattle Battle { get; set; }
public static readonly int Color16 = Engines.Quests.BaseQuestGump.C32216(0xB22222);
public BattleStatsGump(PlayerMobile pm, VvVBattle battle)
: base(50, 50)
{
Battle = battle;
BattleTeam leader = battle.GetLeader();
Guild myGuild = pm.Guild as Guild;
if (leader == null || leader.Guild == null || myGuild == null)
return;
AddBackground(0, 0, 500, 500, 9380);
AddHtmlLocalized(0, 40, 500, 20, 1154645, "#1154945", Color16, false, false); // The Battle between Vice and Virtue has ended!
AddHtml(40, 65, 420, 20, String.Format("<basefont color=#B22222>{0} [{1}] has won the battle!", leader.Guild.Name, leader.Guild.Abbreviation), false, false);
int y = 90;
if (leader.Guild.Alliance != null)
{
AddHtml(40, y, 420, 20, String.Format("<basefont color=#B22222>The {0} Alliance has won the battle!", leader.Guild.Alliance.Name), false, false);
y += 25;
}
BattleTeam team = Battle.GetTeam(myGuild);
//TODO: Are totals the PLAYERS OVERALL totals, or the guild/alliance totals for that battle??? Or that players totals for that battle
/*silver += (int)ViceVsVirtueSystem.Instance.GetPoints(pm);
VvVPlayerEntry entry = ViceVsVirtueSystem.Instance.GetPlayerEntry<VvVPlayerEntry>(pm);
if (entry != null)
{
score = entry.Score;
}*/
AddHtmlLocalized(40, y, 420, 20, 1154947, team.Silver.ToString("N0", CultureInfo.GetCultureInfo("en-US")), Color16, false, false); // Total Silver Points: ~1_val~
y += 25;
AddHtmlLocalized(40, y, 420, 20, 1154948, team.Score.ToString("N0", CultureInfo.GetCultureInfo("en-US")), Color16, false, false); // Total Score: ~1_val~
y += 25;
AddHtmlLocalized(40, y, 420, 20, 1154949, team.Kills.ToString("N0", CultureInfo.GetCultureInfo("en-US")), Color16, false, false);
y += 25;
AddHtmlLocalized(40, y, 420, 20, 1154950, team.Assists.ToString("N0", CultureInfo.GetCultureInfo("en-US")), Color16, false, false);
y += 25;
AddHtmlLocalized(40, y, 420, 20, 1154951, team.Deaths.ToString("N0", CultureInfo.GetCultureInfo("en-US")), Color16, false, false);
y += 25;
AddHtmlLocalized(40, y, 420, 20, 1154952, team.Stolen.ToString("N0", CultureInfo.GetCultureInfo("en-US")), Color16, false, false);
y += 25;
AddHtmlLocalized(40, y, 420, 20, 1154953, team.ReturnedSigils.ToString("N0", CultureInfo.GetCultureInfo("en-US")), Color16, false, false);
y += 25;
AddHtmlLocalized(40, y, 420, 20, 1154954, team.ViceReturned.ToString("N0", CultureInfo.GetCultureInfo("en-US")), Color16, false, false);
y += 25;
AddHtmlLocalized(40, y, 420, 20, 1154955, team.VirtueReturned.ToString("N0", CultureInfo.GetCultureInfo("en-US")), Color16, false, false);
y += 25;
AddHtmlLocalized(40, y, 420, 20, 1154956, team.Disarmed.ToString("N0", CultureInfo.GetCultureInfo("en-US")), Color16, false, false);
y += 25;
}
}
}

View File

@@ -0,0 +1,89 @@
using System;
using Server;
using Server.Items;
using Server.Mobiles;
using Server.Gumps;
using Server.Guilds;
using Server.Network;
using System.Linq;
namespace Server.Engines.VvV
{
public class BattleWarningGump : Gump
{
public PlayerMobile User { get; set; }
public Timer Timer { get; set; }
public BattleWarningGump(PlayerMobile pm)
: base(50, 50)
{
User = pm;
AddBackground(0, 0, 500, 200, 83);
AddHtmlLocalized(0, 25, 500, 20, 1154645, "#1155582", Engines.Quests.BaseQuestGump.C32216(0xFF0000), false, false);
AddHtmlLocalized(10, 55, 480, 100, 1154645, "#1155583", 0xFFFF, false, false); // You are in an active Vice vs Virtue battle region! If you do not leave the City you will be open to attack!
AddButton(463, 168, 4005, 4007, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(250, 171, 250, 20, 1155647, 0xFFFF, false, false); // Teleport to nearest Moongate?
Timer = Timer.DelayCall(TimeSpan.FromMinutes(1), () =>
{
User.CloseGump(typeof(BattleWarningGump));
ViceVsVirtueSystem.AddTempParticipant(User, null);
});
}
public override void OnResponse(NetState state, RelayInfo info)
{
if (Timer != null)
{
Timer.Stop();
Timer = null;
}
if (info.ButtonID == 1)
{
PublicMoongate closestGate = null;
double closestDist = 0;
foreach (PublicMoongate gate in PublicMoongate.Moongates.Where(mg => mg.Map == User.Map))
{
double dist = User.GetDistanceToSqrt(gate);
if (closestGate == null || dist < closestDist)
{
closestDist = dist;
closestGate = gate;
}
}
if (closestGate != null && User.Map != null)
{
for (int i = 0; i < 25; i++)
{
Point3D p = User.Map.GetRandomSpawnPoint(new Rectangle2D(closestGate.X - 5, closestGate.Y - 5, 10, 10));
if (closestGate.Map.CanFit(p.X, p.Y, p.Z, 16, false, true, true))
{
BaseCreature.TeleportPets(User, p, closestGate.Map);
User.MoveToWorld(p, closestGate.Map);
return;
}
}
}
else
{
User.SendLocalizedMessage(1155584); // You are now open to attack!
ViceVsVirtueSystem.AddTempParticipant(User, null);
}
}
else
{
User.SendLocalizedMessage(1155584); // You are now open to attack!
ViceVsVirtueSystem.AddTempParticipant(User, null);
}
}
}
}

View File

@@ -0,0 +1,76 @@
using System;
using Server;
using Server.Items;
using Server.Mobiles;
using Server.Gumps;
using Server.Guilds;
using Server.Network;
namespace Server.Engines.VvV
{
public class ConfirmSignupGump : Gump
{
public PlayerMobile User { get; set; }
public ConfirmSignupGump(PlayerMobile pm)
: base(50, 50)
{
User = pm;
AddBackground(0, 0, 360, 300, 83);
AddHtmlLocalized(0, 25, 360, 20, 1154645, "#1155565",0xFFFF, false, false); // Vice vs Virtue Signup
if (ViceVsVirtueSystem.EnhancedRules)
{
AddHtml(10, 55, 340, 165, _EnhancedRulesMessage, false, true);
}
else
{
AddHtmlLocalized(10, 55, 340, 210, 1155566, 0xFFFF, false, false);
/*Greetings! You are about to join Vice vs Virtue! VvV is an exhilarating Player vs Player
* experience that you can have fun with whether you have hours or only a few minutes to
* jump into the action! Be forewarned, once you join VvV you will be freely attackable
* by other VvV participants in non-consensual PvP facets.<br><br>Will you answer the call
* and lead your guild to victory?*/
}
AddButton(115, 230, 0x2622, 0x2623, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(140, 230, 150, 20, 1155567, 0xFFFF, false, false); // Learn more about VvV!
AddButton(10, 268, 0xFA5, 0xFA7, 2, GumpButtonType.Reply, 0);
AddHtmlLocalized(45, 268, 100, 20, 1049011, 0xFFFF, false, false); // I Accept!
AddButton(325, 268, 0xFB1, 0xFB3, 0, GumpButtonType.Reply, 0);
AddHtml(285, 268, 100, 20, "<basefont color=#FFFFFF>Cancel", false, false);
}
private string _EnhancedRulesMessage =
"<basefont color=#FFFFFF>Greetings! You are about to join Vice vs Virtue! VvV is an exhilarating Player vs Player" +
" experience that you can have fun with whether you have hours or only a few minutes to" +
" jump into the action! Be forewarned, once you join VvV you will be freely attackable" +
" by other VvV participants in <b>any</b> facet.<br><br>Will you answer the call" +
" and lead your guild to victory? Please note the slightly different enhanced rules that you may not be used to:<br><br>" +
"- VvV Combat on any facet<br>- Reduced silver during town battles when uncontested<br>- Combat travel restrictions when in VvV Combat Zone";
public override void OnResponse(NetState state, RelayInfo info)
{
switch (info.ButtonID)
{
case 0: break;
case 1:
User.LaunchBrowser("http://uo.com/wiki/ultima-online-wiki/publish-notes/publish-86/");
User.SendGump(new ConfirmSignupGump(User));
break;
case 2:
Guild g = User.Guild as Guild;
if (g != null)
{
ViceVsVirtueSystem.Instance.AddPlayer(User);
}
break;
}
}
}
}

View File

@@ -0,0 +1,57 @@
using System;
using Server;
using Server.Items;
using Server.Mobiles;
using Server.Gumps;
using Server.Guilds;
using Server.Network;
namespace Server.Engines.VvV
{
public class ExemptCitiesGump : Gump
{
public ExemptCitiesGump()
: base(50, 50)
{
AddGumpLayout();
}
public void AddGumpLayout()
{
AddBackground(0, 0, 250, 300, 83);
AddHtml(0, 15, 250, 60, "<basefont color=#FFFFFF><center>City Exempt List:<br>Check any cities that you do not want participating in VvV Battles.</center>", false, false);
for (int i = 0; i < 8; i++)
{
VvVCity city = (VvVCity)i;
int button = ViceVsVirtueSystem.Instance.ExemptCities.Contains(city) ? 211 : 210;
AddButton(20, 80 + (i * 23), button, button, i + 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(44, 80 + (i * 23), 200, 20, ViceVsVirtueSystem.GetCityLocalization(city), 0xFFFF, false, false);
}
}
public override void OnResponse(NetState state, RelayInfo info)
{
int id = info.ButtonID;
if (id == 0)
return;
var city = (VvVCity)id - 1;
if (ViceVsVirtueSystem.Instance.ExemptCities.Contains(city))
ViceVsVirtueSystem.Instance.ExemptCities.Remove(city);
else
ViceVsVirtueSystem.Instance.ExemptCities.Add(city);
if (state.Gumps.Contains(this))
state.Gumps.Remove(this);
Entries.Clear();
AddGumpLayout();
state.Mobile.SendGump(this);
}
}
}

View File

@@ -0,0 +1,148 @@
using System;
using Server;
using Server.Items;
using Server.Mobiles;
using Server.Gumps;
using Server.Guilds;
using Server.Network;
using System.Collections.Generic;
using System.Linq;
namespace Server.Engines.VvV
{
public class GuildLeaderboardGump : Gump
{
public static int PerPage = 10;
public PlayerMobile User { get; set; }
public Filter Filter { get; set; }
public GuildLeaderboardGump(PlayerMobile pm, Filter filter = Filter.Score) : base(50, 50)
{
User = pm;
Filter = filter;
AddPage(0);
AddBackground(0, 0, 560, 320, 5054);
AddImageTiled(10, 10, 540, 300, 2624);
AddHtmlLocalized(0, 12, 560, 20, 1114922, 0xFFFF, false, false); // <DIV ALIGN=CENTER>Vice Vs Virtue - Guild Rankings</DIV>
AddHtmlLocalized(10, 55, 60, 20, 1114981, 0xFFFF, false, false); // <DIV ALIGN=CENTER>#:</DIV>
AddHtmlLocalized(50, 55, 180, 20, 1114978, 0xFFFF, false, false); // <DIV ALIGN=CENTER>Guild:</DIV>
AddHtmlLocalized(230, 55, 100, 20, 1114977, Filter == Filter.Score ? Server.Engines.Quests.BaseQuestGump.C32216(0x00FA9A) : 0xFFFF, false, false); // <DIV ALIGN=RIGHT>Score:</DIV>
AddHtmlLocalized(330, 55, 85, 20, 1114975, Filter == Filter.Kills ? Server.Engines.Quests.BaseQuestGump.C32216(0x00FA9A) : 0xFFFF, false, false); // <DIV ALIGN=RIGHT>Kills:</DIV>
AddHtmlLocalized(425, 55, 95, 20, 1155575, Filter == Filter.ReturnedSigils ? Server.Engines.Quests.BaseQuestGump.C32216(0x00FA9A) : 0xFFFF, false, false); // <DIV ALIGN=RIGHT>Returned Sigil:</DIV>
if (Filter != Filter.Score)
AddButton(330, 55, 2437, 2438, 1, GumpButtonType.Reply, 0);
else
AddImage(330, 55, 10006);
if (Filter != Filter.Kills)
AddButton(415, 55, 2437, 2438, 2, GumpButtonType.Reply, 0);
else
AddImage(415, 55, 10006);
if (Filter != Filter.ReturnedSigils)
AddButton(520, 55, 2437, 2438, 3, GumpButtonType.Reply, 0);
else
AddImage(520, 55, 10006);
AddButton(280, 290, 4005, 4007, 4, GumpButtonType.Reply, 0);
AddHtmlLocalized(315, 290, 150, 20, 1114924, 0xFFFF, false, false); // Guild Rankings
List<VvVGuildStats> list = new List<VvVGuildStats>(ViceVsVirtueSystem.Instance.GuildStats.Values);
switch (Filter)
{
default:
case Filter.Score: list = list.OrderBy(e => -e.Score).ToList(); break;
case Filter.Kills: list = list.OrderBy(e => -e.Kills).ToList(); break;
case Filter.ReturnedSigils: list = list.OrderBy(e => -e.ReturnedSigils).ToList(); break;
}
int pages = (int)Math.Ceiling((double)list.Count / PerPage);
int y = 75;
int page = 1;
int pageindex = 0;
if (pages < 1)
pages = 1;
AddPage(page);
AddHtmlLocalized(60, 290, 150, 20, 1153561, String.Format("{0}\t{1}", page.ToString(), pages.ToString()), 0xFFFF, false, false); // Page ~1_CUR~ of ~2_MAX~
for (int i = 0; i < list.Count; i++)
{
VvVGuildStats entry = list[i];
AddHtml(10, y, 65, 20, CenterGray((i + 1).ToString() + "."), false, false);
AddHtml(50, y, 180, 20, CenterGray(entry.Guild == null ? "" : entry.Guild.Name), false, false);
AddHtml(230, y, 100, 20, Filter == Filter.Score ? RightGreen(entry.Score.ToString()) : RightGray(entry.Score.ToString()), false, false);
AddHtml(330, y, 85, 20, Filter == Filter.Kills ? RightGreen(entry.Kills.ToString()) : RightGray(entry.Kills.ToString()), false, false);
AddHtml(425, y, 95, 20, Filter == Filter.ReturnedSigils ? RightGreen(entry.ReturnedSigils.ToString()) : RightGray(entry.ReturnedSigils.ToString()), false, false);
y += 20;
pageindex++;
if (pageindex == PerPage)
{
AddHtmlLocalized(60, 290, 150, 20, 1153561, String.Format("{0}\t{1}", page.ToString(), pages.ToString()), 0xFFFF, false, false); // Page ~1_CUR~ of ~2_MAX~
if (i > 0 && i < list.Count - 1)
{
AddButton(200, 290, 4005, 4007, 0, GumpButtonType.Page, page + 1);
page++;
y = 75;
pageindex = 0;
AddPage(page);
AddButton(170, 290, 4014, 4016, 0, GumpButtonType.Page, page - 1);
}
}
}
list.Clear();
list.TrimExcess();
}
public override void OnResponse(NetState state, RelayInfo info)
{
switch (info.ButtonID)
{
default: break;
case 1:
case 2:
case 3:
Filter f = (Filter)info.ButtonID - 1;
User.SendGump(new GuildLeaderboardGump(User, f));
break;
case 4:
User.SendGump(new ViceVsVirtueLeaderboardGump(User));
break;
}
}
private string CenterGray(string format)
{
return String.Format("<basefont color=#A9A9A9><DIV ALIGN=CENTER>{0}</DIV>", format);
}
private string RightGray(string format)
{
return String.Format("<basefont color=#A9A9A9><DIV ALIGN=RIGHT>{0}</DIV>", format);
}
private string LeftGray(string format)
{
return String.Format("<basefont color=#A9A9A9><DIV ALIGN=LEFT>{0}</DIV>", format);
}
private string RightGreen(string format)
{
return String.Format("<basefont color=#00FA9A><DIV ALIGN=RIGHT>{0}</DIV>", format);
}
}
}

View File

@@ -0,0 +1,170 @@
using System;
using Server;
using Server.Items;
using Server.Mobiles;
using Server.Gumps;
using Server.Guilds;
using Server.Network;
using System.Collections.Generic;
using System.Linq;
namespace Server.Engines.VvV
{
public enum Filter
{
Score,
Kills,
ReturnedSigils
}
public class ViceVsVirtueLeaderboardGump : Gump
{
public static int PerPage = 10;
public PlayerMobile User { get; set; }
public Filter Filter { get; set; }
public ViceVsVirtueLeaderboardGump(PlayerMobile pm, Filter filter = Filter.Score) : base(50, 50)
{
User = pm;
Filter = filter;
AddPage(0);
AddBackground(0, 0, 920, 320, 5054);
AddImageTiled(10, 10, 900, 300, 2624);
AddHtmlLocalized(0, 12, 920, 20, 1114921, 0xFFFF, false, false); // <DIV ALIGN=CENTER>Vice Vs Virtue - Player Rankings</DIV>
AddHtmlLocalized(10, 55, 65, 20, 1114981, 0xFFFF, false, false); // <DIV ALIGN=CENTER>#:</DIV>
AddHtmlLocalized(70, 55, 160, 20, 1114966, 0xFFFF, false, false); // <DIV ALIGN=LEFT>Name:</DIV>
AddHtmlLocalized(230, 55, 70, 20, 1114978, 0xFFFF, false, false); // <DIV ALIGN=CENTER>Guild:</DIV>
AddHtmlLocalized(300, 55, 100, 20, 1114977, Filter == Filter.Score ? Server.Engines.Quests.BaseQuestGump.C32216(0x00FA9A) : 0xFFFF, false, false); // <DIV ALIGN=RIGHT>Score:</DIV>
AddHtmlLocalized(420, 55, 55, 20, 1114975, Filter == Filter.Kills ? Server.Engines.Quests.BaseQuestGump.C32216(0x00FA9A) : 0xFFFF, false, false); // <DIV ALIGN=RIGHT>Kills:</DIV>
AddHtmlLocalized(480, 55, 55, 20, 1114893, 0xFFFF, false, false); // <DIV ALIGN=RIGHT>Deaths:</DIV>
AddHtmlLocalized(540, 55, 55, 20, 1155572, 0xFFFF, false, false); // <DIV ALIGN=RIGHT>Assists:</DIV>
AddHtmlLocalized(610, 55, 90, 20, 1155575, Filter == Filter.ReturnedSigils ? Server.Engines.Quests.BaseQuestGump.C32216(0x00FA9A) : 0xFFFF, false, false); // <DIV ALIGN=RIGHT>Returned Sigil:</DIV>
AddHtmlLocalized(710, 55, 100, 20, 1155574, 0xFFFF, false, false); // <DIV ALIGN=RIGHT>Disarmed Traps:</DIV>
AddHtmlLocalized(810, 55, 80, 20, 1155573, 0xFFFF, false, false); // <DIV ALIGN=RIGHT>Stolen Sigil:</DIV>
if (Filter != Filter.Score)
AddButton(400, 55, 2437, 2438, 1, GumpButtonType.Reply, 0);
else
AddImage(400, 55, 10006);
if (Filter != Filter.Kills)
AddButton(475, 55, 2437, 2438, 2, GumpButtonType.Reply, 0);
else
AddImage(475, 55, 10006);
if (Filter != Filter.ReturnedSigils)
AddButton(700, 55, 2437, 2438, 3, GumpButtonType.Reply, 0);
else
AddImage(700, 55, 10006);
AddButton(280, 290, 4005, 4007, 4, GumpButtonType.Reply, 0);
AddHtmlLocalized(315, 290, 150, 20, 1114923, 0xFFFF, false, false); // Guild Rankings
List<VvVPlayerEntry> list = new List<VvVPlayerEntry>(ViceVsVirtueSystem.Instance.PlayerTable.OfType<VvVPlayerEntry>());
switch (Filter)
{
default:
case Filter.Score: list = list.OrderBy(e => -e.Score).ToList(); break;
case Filter.Kills: list = list.OrderBy(e => -e.Kills).ToList(); break;
case Filter.ReturnedSigils: list = list.OrderBy(e => -e.ReturnedSigils).ToList(); break;
}
int pages = (int)Math.Ceiling((double)list.Count / PerPage);
int y = 75;
int page = 1;
int pageindex = 0;
if (pages < 1)
pages = 1;
AddPage(page);
AddHtmlLocalized(60, 290, 150, 20, 1153561, String.Format("{0}\t{1}", page.ToString(), pages.ToString()), 0xFFFF, false, false); // Page ~1_CUR~ of ~2_MAX~
for (int i = 0; i < list.Count; i++)
{
VvVPlayerEntry entry = list[i];
if(entry.Player == null)
continue;
Guild g = entry.Player.Guild as Guild;
AddHtml(10, y, 65, 20, CenterGray((i + 1).ToString() + "."), false, false);
AddHtml(70, y, 160, 20, LeftGray(entry.Player.Name), false, false);
AddHtml(230, y, 70, 20, CenterGray(g == null ? "None" : g.Abbreviation), false, false);
AddHtml(300, y, 100, 20, Filter == Filter.Score ? RightGreen(entry.Score.ToString()) : RightGray(entry.Score.ToString()), false, false);
AddHtml(420, y, 55, 20, Filter == Filter.Kills ? RightGreen(entry.Kills.ToString()) : RightGray(entry.Kills.ToString()), false, false);
AddHtml(480, y, 55, 20, RightGray(entry.Deaths.ToString()), false, false);
AddHtml(540, y, 55, 20, RightGray(entry.Assists.ToString()), false, false);
AddHtml(610, y, 90, 20, Filter == Filter.ReturnedSigils ? RightGreen(entry.ReturnedSigils.ToString()) : RightGray(entry.ReturnedSigils.ToString()), false, false);
AddHtml(710, y, 100, 20, RightGray(entry.DisarmedTraps.ToString()), false, false);
AddHtml(810, y, 80, 20, RightGray(entry.StolenSigils.ToString()), false, false);
y += 20;
pageindex++;
if (pageindex == PerPage)
{
AddHtmlLocalized(60, 290, 150, 20, 1153561, String.Format("{0}\t{1}", page.ToString(), pages.ToString()), 0xFFFF, false, false); // Page ~1_CUR~ of ~2_MAX~
if (i > 0 && i < list.Count - 1)
{
AddButton(200, 290, 4005, 4007, 0, GumpButtonType.Page, page + 1);
page++;
y = 75;
pageindex = 0;
AddPage(page);
AddButton(170, 290, 4014, 4016, 0, GumpButtonType.Page, page - 1);
}
}
}
list.Clear();
list.TrimExcess();
}
public override void OnResponse(NetState state, RelayInfo info)
{
switch (info.ButtonID)
{
default: break;
case 1:
case 2:
case 3:
Filter f = (Filter)info.ButtonID - 1;
User.SendGump(new ViceVsVirtueLeaderboardGump(User, f));
break;
case 4:
User.SendGump(new GuildLeaderboardGump(User));
break;
}
}
private string CenterGray(string format)
{
return String.Format("<basefont color=#A9A9A9><DIV ALIGN=CENTER>{0}</DIV>", format);
}
private string RightGray(string format)
{
return String.Format("<basefont color=#A9A9A9><DIV ALIGN=RIGHT>{0}</DIV>", format);
}
private string LeftGray(string format)
{
return String.Format("<basefont color=#A9A9A9><DIV ALIGN=LEFT>{0}</DIV>", format);
}
private string RightGreen(string format)
{
return String.Format("<basefont color=#00FA9A><DIV ALIGN=RIGHT>{0}</DIV>", format);
}
}
}

View File

@@ -0,0 +1,97 @@
using System;
using Server;
using Server.Items;
using Server.Mobiles;
using Server.Gumps;
using Server.Guilds;
using Server.Network;
using Server.Engines.Points;
using System.Collections.Generic;
namespace Server.Engines.VvV
{
public class VvVRewardGump : BaseRewardGump
{
public VvVRewardGump(Mobile owner, PlayerMobile user)
: base(owner, user, VvVRewards.Rewards, 1155512)
{
}
public override double GetPoints(Mobile m)
{
return PointsSystem.ViceVsVirtue.GetPoints(m);
}
public override void OnConfirmed(CollectionItem citem, int index)
{
Item item;
if (citem.Type == typeof(VvVPotionKeg))
{
PotionType type;
switch (index)
{
default:
case 0: type = PotionType.GreaterStamina; break;
case 1: type = PotionType.Supernova; break;
case 2: type = PotionType.StatLossRemoval; break;
case 3: type = PotionType.AntiParalysis; break;
}
item = new VvVPotionKeg(type);
}
else if (citem.Type == typeof(VvVSteedStatuette))
{
SteedType type = index == 5 || index == 6 ? SteedType.WarHorse : SteedType.Ostard;
item = new VvVSteedStatuette(type, citem.Hue);
}
else if (citem.Type == typeof(VvVTrapKit))
{
VvVTrapType type;
switch (index - 11)
{
default:
case 0: type = VvVTrapType.Poison; break;
case 1: type = VvVTrapType.Cold; break;
case 2: type = VvVTrapType.Energy; break;
case 3: type = VvVTrapType.Blade; break;
case 4: type = VvVTrapType.Explosion; break;
}
item = new VvVTrapKit(type);
}
else if (citem.Type == typeof(VvVRobe) || citem.Type == typeof(VvVHairDye))
{
item = Activator.CreateInstance(citem.Type, citem.Hue) as Item;
}
else if (citem.Type == typeof(ScrollOfTranscendence))
{
item = ScrollOfTranscendence.CreateRandom(10, 10);
}
else
item = Activator.CreateInstance(citem.Type) as Item;
if (item != null)
{
VvVRewards.OnRewardItemCreated(User, item);
if (User.Backpack == null || !User.Backpack.TryDropItem(User, item, false))
{
User.SendLocalizedMessage(1074361); // The reward could not be given. Make sure you have room in your pack.
item.Delete();
}
else
{
if (User.AccessLevel == AccessLevel.Player)
PointsSystem.ViceVsVirtue.DeductPoints(User, citem.Points);
User.SendLocalizedMessage(1073621); // Your reward has been placed in your backpack.
User.PlaySound(0x5A7);
}
}
}
}
}

View File

@@ -0,0 +1,91 @@
using System;
using Server;
using Server.Items;
using Server.Mobiles;
using Server.Gumps;
using Server.Guilds;
using Server.Network;
using System.Collections.Generic;
namespace Server.Engines.VvV
{
public class VvVBattleStatusGump : BaseGump
{
public VvVBattle Battle { get; set; }
public override int GetTypeID()
{
return 0xF3ECC;
}
public VvVBattleStatusGump(PlayerMobile pm, VvVBattle battle) : base(pm, 50, 50)
{
Battle = battle;
}
public override void AddGumpLayout()
{
AddPage(0);
AddImage(0, 0, 30566);
if (DateTime.UtcNow >= Battle.NextSigilSpawn && Battle.Sigil != null && !Battle.Sigil.Deleted)
AddImage(200, 300, 30583);
List<BattleTeam> teams = new List<BattleTeam>(Battle.Teams);
teams.Sort();
double offset = 216 / (double)VvVBattle.ScoreToWin;
for (int i = 0; i < teams.Count; i++)
{
BattleTeam team = teams[i];
if(team.Guild != null)
AddHtml(87, 115 + (31 * i), 50, 20, String.Format("<basefont color=#FFFFFF>{0}", team.Guild.Abbreviation), false, false);
AddBackground(145, 120 + (31 * i), (int)Math.Min(216, (team.Score * offset)), 12, 30584);
if (i == 2) // stupid gump only allows 3 to be shown
break;
}
int count = Battle.Messages.Count - 1;
int y = 206;
for (int i = count; i >= 0; i--)
{
if (i <= count - 3)
break;
AddHtml(98, y, 250, 16, String.Format("<basefont color=#80BFFF>{0}", Battle.Messages[i]), false, false);
y += 16;
}
Guild gu = User.Guild as Guild;
if (gu != null)
{
BattleTeam t = Battle.GetTeam(gu);
AddHtml(87, 268, 50, 20, String.Format("<basefont color=#FFFFFF>{0}", gu.Abbreviation), false, false);
AddBackground(145, 271, (int)Math.Min(216, (t.Score * offset)), 12, 30584);
}
TimeSpan left = (Battle.StartTime + TimeSpan.FromMinutes(VvVBattle.Duration)) - DateTime.UtcNow;
AddHtml(210, 21, 100, 20, "<basefont color=#FF0000>" + String.Format("{0:mm\\:ss}", left), false, false);
}
/*public void Refresh(bool recompile = true)
{
Entries.Clear();
Entries.TrimExcess();
AddGumpLayout();
if (User.NetState != null)
User.NetState.RemoveGump(this);
User.SendGump(this, false);
}*/
}
}