Overwrite
Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
102
Scripts/Services/ViceVsVirtue/CityInfo.cs
Normal file
102
Scripts/Services/ViceVsVirtue/CityInfo.cs
Normal file
@@ -0,0 +1,102 @@
|
||||
using Server;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
public class CityInfo
|
||||
{
|
||||
public static Dictionary<VvVCity, CityInfo> Infos { get; set; }
|
||||
|
||||
public static void Configure()
|
||||
{
|
||||
Infos = new Dictionary<VvVCity, CityInfo>();
|
||||
|
||||
Infos[VvVCity.Britain] = new CityInfo(
|
||||
"Britain",
|
||||
new Point3D[] { new Point3D(1453, 1554, 30), new Point3D(1462, 1650, 10), new Point3D(1514, 1640, 20), new Point3D(1490, 1740, 0) },
|
||||
new Point3D[] { new Point3D(1592, 1680, 10), new Point3D(1423, 1625, 20), new Point3D(1461, 1734, 0) },
|
||||
new Rectangle2D(1441, 1695, 20, 20),
|
||||
new Point3D(1450, 1694, 0));
|
||||
|
||||
Infos[VvVCity.Jhelom] = new CityInfo(
|
||||
"Jhelom",
|
||||
new Point3D[] { new Point3D(1323, 3672, 0), new Point3D(1450, 3712, 8), new Point3D(1448, 3781, 0) },
|
||||
new Point3D[] { new Point3D(1336, 3769, 0), new Point3D(1401, 3839, 0), new Point3D(1423, 3803, 0) },
|
||||
new Rectangle2D(1311, 3758, 20, 20),
|
||||
new Point3D(1329, 3772, 0));
|
||||
|
||||
Infos[VvVCity.Minoc] = new CityInfo(
|
||||
"Minoc",
|
||||
new Point3D[] { new Point3D(2507, 475, 15), new Point3D(2418, 497, 15), new Point3D(2467, 535, 15), new Point3D(2507, 593, 0) },
|
||||
new Point3D[] { new Point3D(2476, 417, 15), new Point3D(2491, 485, 15), new Point3D(2517, 561, 0) },
|
||||
new Rectangle2D(2504, 542, 20, 20),
|
||||
new Point3D(2501, 560, 0));
|
||||
|
||||
Infos[VvVCity.Moonglow] = new CityInfo(
|
||||
"Moonglow",
|
||||
new Point3D[] { new Point3D(4479, 1122, 0), new Point3D(4413, 1136, 6), new Point3D(4419, 111, 0), new Point3D(4387, 1107, 0) },
|
||||
new Point3D[] { new Point3D(4436, 1089, 0), new Point3D(4421, 1157, 0), new Point3D(4471, 1142, 0) },
|
||||
new Rectangle2D(4476, 1168, 8, 8),
|
||||
new Point3D(4468, 1176, 0));
|
||||
|
||||
Infos[VvVCity.Ocllo] = new CityInfo(
|
||||
"Ocllo",
|
||||
new Point3D[] { new Point3D(3672, 2476, 6), new Point3D(3611, 2581, 0), new Point3D(3635, 2655, -2) },
|
||||
new Point3D[] { new Point3D(3660, 2484, 0), new Point3D(3650, 2540, 0), new Point3D(3652, 2646, 0) },
|
||||
new Rectangle2D(3614, 2593, 10, 10),
|
||||
new Point3D(3697, 2522, 0));
|
||||
|
||||
Infos[VvVCity.SkaraBrae] = new CityInfo(
|
||||
"Skara Brae",
|
||||
new Point3D[] { new Point3D(651, 2163, 6), new Point3D(624, 2142, 0), new Point3D(574, 2152, 0), new Point3D(640, 2247, -2) },
|
||||
new Point3D[] { new Point3D(635, 2142, 0), new Point3D(582, 2246, 0), new Point3D(575, 2199, 0) },
|
||||
new Rectangle2D(572, 2158, 15, 15),
|
||||
new Point3D(601, 2150, 0));
|
||||
|
||||
Infos[VvVCity.Trinsic] = new CityInfo(
|
||||
"Trinsic",
|
||||
new Point3D[] { new Point3D(1846, 2688, 0), new Point3D(1824, 2685, 0), new Point3D(1845, 2744, 0), new Point3D(1903, 2715, 20) },
|
||||
new Point3D[] { new Point3D(1976, 2701, 0), new Point3D(2047, 2853, 0), new Point3D(1832, 2814, 0) },
|
||||
new Rectangle2D(1905, 2684, 12, 12),
|
||||
new Point3D(1908, 2691, 0));
|
||||
|
||||
Infos[VvVCity.Yew] = new CityInfo(
|
||||
"Yew",
|
||||
new Point3D[] { new Point3D(453, 963, 0), new Point3D(334, 965, 0), new Point3D(613, 880, 0), new Point3D(640, 938, 6) },
|
||||
new Point3D[] { new Point3D(631, 883, 0), new Point3D(650, 976, 0), new Point3D(299, 1010, 0) },
|
||||
new Rectangle2D(628, 857, 12, 12),
|
||||
new Point3D(638, 858, 0));
|
||||
}
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public Point3D[] SigilLocs { get; set; }
|
||||
public Point3D[] AltarLocs { get; set; }
|
||||
public Point3D TraderLoc { get; set; }
|
||||
public Rectangle2D PriestLocation { get; set; }
|
||||
|
||||
public Region Region
|
||||
{
|
||||
get
|
||||
{
|
||||
Region r = Region.Regions.FirstOrDefault(reg => reg.Name == Name && reg.Map == Map.Felucca);
|
||||
|
||||
if (r == null)
|
||||
Console.WriteLine("WARNING: Region for {0} not found.", Name);
|
||||
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
public CityInfo(string name, Point3D[] sigillocs, Point3D[] altarlocs, Rectangle2D priestlocs, Point3D traderloc)
|
||||
{
|
||||
Name = name;
|
||||
SigilLocs = sigillocs;
|
||||
AltarLocs = altarlocs;
|
||||
TraderLoc = traderloc;
|
||||
PriestLocation = priestlocs;
|
||||
}
|
||||
}
|
||||
}
|
||||
268
Scripts/Services/ViceVsVirtue/GuildStats.cs
Normal file
268
Scripts/Services/ViceVsVirtue/GuildStats.cs
Normal file
@@ -0,0 +1,268 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using Server.Gumps;
|
||||
using System.Collections.Generic;
|
||||
using Server.Network;
|
||||
using Server.Guilds;
|
||||
using System.Linq;
|
||||
using Server.Engines.Points;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
public class VvVGuildStats
|
||||
{
|
||||
public Guild Guild { get; set; }
|
||||
public int Score { get; set; }
|
||||
public int Kills { get; set; }
|
||||
public int ReturnedSigils { get; set; }
|
||||
|
||||
public VvVGuildStats(Guild g)
|
||||
{
|
||||
Guild = g;
|
||||
}
|
||||
|
||||
public void Serialize(GenericWriter writer)
|
||||
{
|
||||
writer.Write(0);
|
||||
|
||||
writer.Write(Score);
|
||||
writer.Write(Kills);
|
||||
writer.Write(ReturnedSigils);
|
||||
}
|
||||
|
||||
public VvVGuildStats(Guild g, GenericReader reader)
|
||||
{
|
||||
int version = reader.ReadInt();
|
||||
|
||||
Guild = g;
|
||||
|
||||
Score = reader.ReadInt();
|
||||
Kills = reader.ReadInt();
|
||||
ReturnedSigils = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class BattleTeam : IComparable<BattleTeam>
|
||||
{
|
||||
public Guild Guild { get; set; }
|
||||
public int Score { get; set; }
|
||||
public int Silver { get; set; }
|
||||
|
||||
public int Kills { get; set; }
|
||||
public int Assists { get; set; }
|
||||
public int Deaths { get; set; }
|
||||
public int Stolen { get; set; }
|
||||
|
||||
public int ReturnedSigils { get { return ViceReturned + VirtueReturned; } }
|
||||
|
||||
public int ViceReturned { get; set; }
|
||||
public int VirtueReturned { get; set; }
|
||||
|
||||
public int Disarmed { get; set; }
|
||||
|
||||
public List<VvVPlayerBattleStats> PlayerStats { get; set; }
|
||||
|
||||
public int CompareTo(BattleTeam team)
|
||||
{
|
||||
if (Score > team.Score)
|
||||
return -1;
|
||||
|
||||
if (Score == team.Score)
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
public BattleTeam(Guild g)
|
||||
{
|
||||
Guild = g;
|
||||
|
||||
PlayerStats = new List<VvVPlayerBattleStats>();
|
||||
}
|
||||
|
||||
public BattleTeam(GenericReader reader)
|
||||
{
|
||||
int version = reader.ReadInt();
|
||||
|
||||
PlayerStats = new List<VvVPlayerBattleStats>();
|
||||
|
||||
Guild = reader.ReadGuild() as Guild;
|
||||
Score = reader.ReadInt();
|
||||
Silver = reader.ReadInt();
|
||||
|
||||
Kills = reader.ReadInt();
|
||||
Assists = reader.ReadInt();
|
||||
Deaths = reader.ReadInt();
|
||||
Stolen = reader.ReadInt();
|
||||
|
||||
ViceReturned = reader.ReadInt();
|
||||
VirtueReturned = reader.ReadInt();
|
||||
Disarmed = reader.ReadInt();
|
||||
|
||||
int count = reader.ReadInt();
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
PlayerMobile pm = reader.ReadMobile() as PlayerMobile;
|
||||
VvVPlayerBattleStats stats = new VvVPlayerBattleStats(reader, pm);
|
||||
|
||||
if(pm != null)
|
||||
PlayerStats.Add(stats);
|
||||
}
|
||||
}
|
||||
|
||||
public void Serialize(GenericWriter writer)
|
||||
{
|
||||
writer.Write(0);
|
||||
|
||||
writer.Write(Guild);
|
||||
writer.Write(Score);
|
||||
writer.Write(Silver);
|
||||
|
||||
writer.Write(Kills);
|
||||
writer.Write(Assists);
|
||||
writer.Write(Deaths);
|
||||
writer.Write(Stolen);
|
||||
|
||||
writer.Write(ViceReturned);
|
||||
writer.Write(VirtueReturned);
|
||||
writer.Write(Disarmed);
|
||||
|
||||
writer.Write(PlayerStats.Count);
|
||||
PlayerStats.ForEach(stats =>
|
||||
{
|
||||
writer.Write(stats.Player);
|
||||
stats.Serialize(writer);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public class VvVPlayerBattleStats
|
||||
{
|
||||
public PlayerMobile Player { get; set; }
|
||||
public double Points { get; set; }
|
||||
|
||||
public int Kills { get; set; }
|
||||
public int Assists { get; set; }
|
||||
public int Deaths { get; set; }
|
||||
public int Stolen { get; set; }
|
||||
|
||||
public int ReturnedSigils { get { return ViceReturned + VirtueReturned; } }
|
||||
|
||||
public int ViceReturned { get; set; }
|
||||
public int VirtueReturned { get; set; }
|
||||
|
||||
public int Disarmed { get; set; }
|
||||
|
||||
public VvVPlayerBattleStats(PlayerMobile pm)
|
||||
{
|
||||
Player = pm;
|
||||
}
|
||||
|
||||
public void Serialize(GenericWriter writer)
|
||||
{
|
||||
writer.Write(1);
|
||||
|
||||
writer.Write(Points);
|
||||
|
||||
writer.Write(Kills);
|
||||
writer.Write(Assists);
|
||||
writer.Write(Deaths);
|
||||
writer.Write(Stolen);
|
||||
writer.Write(ViceReturned);
|
||||
writer.Write(VirtueReturned);
|
||||
writer.Write(Disarmed);
|
||||
}
|
||||
|
||||
public VvVPlayerBattleStats(GenericReader reader, PlayerMobile pm)
|
||||
{
|
||||
int version = reader.ReadInt();
|
||||
|
||||
Player = pm;
|
||||
Points = reader.ReadDouble();
|
||||
|
||||
if(version == 0)
|
||||
reader.ReadInt();
|
||||
|
||||
Kills = reader.ReadInt();
|
||||
Assists = reader.ReadInt();
|
||||
Deaths = reader.ReadInt();
|
||||
Stolen = reader.ReadInt();
|
||||
ViceReturned = reader.ReadInt();
|
||||
VirtueReturned = reader.ReadInt();
|
||||
Disarmed = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Obsolete, no longer used. Left in for serialization purposes
|
||||
/// </summary>
|
||||
public class VvVGuildBattleStats : IComparable<VvVGuildBattleStats>
|
||||
{
|
||||
public Guild Guild { get; set; }
|
||||
public double Points { get; set; }
|
||||
|
||||
public int Silver { get; set; }
|
||||
public int Kills { get; set; }
|
||||
public int Assists { get; set; }
|
||||
public int Deaths { get; set; }
|
||||
public int Stolen { get; set; }
|
||||
|
||||
public int ReturnedSigils { get { return ViceReturned + VirtueReturned; } }
|
||||
|
||||
public int ViceReturned { get; set; }
|
||||
public int VirtueReturned { get; set; }
|
||||
|
||||
public int Disarmed { get; set; }
|
||||
|
||||
public VvVGuildBattleStats(Guild g)
|
||||
{
|
||||
Guild = g;
|
||||
}
|
||||
|
||||
public int CompareTo(VvVGuildBattleStats stats)
|
||||
{
|
||||
if (Points > stats.Points)
|
||||
return 1;
|
||||
|
||||
if (Points == stats.Points)
|
||||
return 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
public void Serialize(GenericWriter writer)
|
||||
{
|
||||
writer.Write(0);
|
||||
|
||||
writer.Write(Points);
|
||||
|
||||
writer.Write(Silver);
|
||||
writer.Write(Kills);
|
||||
writer.Write(Assists);
|
||||
writer.Write(Deaths);
|
||||
writer.Write(Stolen);
|
||||
writer.Write(ViceReturned);
|
||||
writer.Write(VirtueReturned);
|
||||
writer.Write(Disarmed);
|
||||
}
|
||||
|
||||
public VvVGuildBattleStats(GenericReader reader, Guild g)
|
||||
{
|
||||
int version = reader.ReadInt();
|
||||
|
||||
Guild = g;
|
||||
Points = reader.ReadDouble();
|
||||
|
||||
Silver = reader.ReadInt();
|
||||
Kills = reader.ReadInt();
|
||||
Assists = reader.ReadInt();
|
||||
Deaths = reader.ReadInt();
|
||||
Stolen = reader.ReadInt();
|
||||
ViceReturned = reader.ReadInt();
|
||||
VirtueReturned = reader.ReadInt();
|
||||
Disarmed = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
85
Scripts/Services/ViceVsVirtue/Gumps/BattleStatsGump.cs
Normal file
85
Scripts/Services/ViceVsVirtue/Gumps/BattleStatsGump.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
89
Scripts/Services/ViceVsVirtue/Gumps/BattleWarningGump.cs
Normal file
89
Scripts/Services/ViceVsVirtue/Gumps/BattleWarningGump.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
76
Scripts/Services/ViceVsVirtue/Gumps/ConfirmSignupGump.cs
Normal file
76
Scripts/Services/ViceVsVirtue/Gumps/ConfirmSignupGump.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
57
Scripts/Services/ViceVsVirtue/Gumps/ExemptCityGump.cs
Normal file
57
Scripts/Services/ViceVsVirtue/Gumps/ExemptCityGump.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
148
Scripts/Services/ViceVsVirtue/Gumps/GuildLeaderboardGump.cs
Normal file
148
Scripts/Services/ViceVsVirtue/Gumps/GuildLeaderboardGump.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
170
Scripts/Services/ViceVsVirtue/Gumps/LeaderboardGump.cs
Normal file
170
Scripts/Services/ViceVsVirtue/Gumps/LeaderboardGump.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
97
Scripts/Services/ViceVsVirtue/Gumps/RewardGump.cs
Normal file
97
Scripts/Services/ViceVsVirtue/Gumps/RewardGump.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
91
Scripts/Services/ViceVsVirtue/Gumps/VvVBattleStatusGump.cs
Normal file
91
Scripts/Services/ViceVsVirtue/Gumps/VvVBattleStatusGump.cs
Normal 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);
|
||||
}*/
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using Server;
|
||||
using System.Collections.Generic;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
[FlipableAttribute(39351, 39352)]
|
||||
public class CompassionBanner : Item
|
||||
{
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1123375;
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public CompassionBanner() : base(39351)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile m)
|
||||
{
|
||||
if (m.InRange(this.GetWorldLocation(), 2))
|
||||
{
|
||||
Gump g = new Gump(50, 50);
|
||||
g.AddImage(0, 0, 30575);
|
||||
m.SendGump(g);
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
list.Add(1154937); // vvv item
|
||||
}
|
||||
|
||||
public CompassionBanner(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using Server;
|
||||
using System.Collections.Generic;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
[FlipableAttribute(39335, 39336)]
|
||||
public class CovetousBanner : Item
|
||||
{
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1123359;
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public CovetousBanner() : base(39335)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile m)
|
||||
{
|
||||
if (m.InRange(this.GetWorldLocation(), 2))
|
||||
{
|
||||
Gump g = new Gump(50, 50);
|
||||
g.AddImage(0, 0, 30567);
|
||||
m.SendGump(g);
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
list.Add(1154937); // vvv item
|
||||
}
|
||||
|
||||
public CovetousBanner(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
using System;
|
||||
using Server;
|
||||
using System.Collections.Generic;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
[FlipableAttribute(39337, 39338)]
|
||||
public class DeceitBanner : Item
|
||||
{
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1123361;
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public DeceitBanner()
|
||||
: base(39337)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile m)
|
||||
{
|
||||
if (m.InRange(this.GetWorldLocation(), 2))
|
||||
{
|
||||
Gump g = new Gump(50, 50);
|
||||
g.AddImage(0, 0, 30568);
|
||||
m.SendGump(g);
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
list.Add(1154937); // vvv item
|
||||
}
|
||||
|
||||
public DeceitBanner(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
using System;
|
||||
using Server;
|
||||
using System.Collections.Generic;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
[FlipableAttribute(39339, 39340)]
|
||||
public class DespiseBanner : Item
|
||||
{
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1123363;
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public DespiseBanner()
|
||||
: base(39339)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile m)
|
||||
{
|
||||
if (m.InRange(this.GetWorldLocation(), 2))
|
||||
{
|
||||
Gump g = new Gump(50, 50);
|
||||
g.AddImage(0, 0, 30569);
|
||||
m.SendGump(g);
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
list.Add(1154937); // vvv item
|
||||
}
|
||||
|
||||
public DespiseBanner(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
using System;
|
||||
using Server;
|
||||
using System.Collections.Generic;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
[FlipableAttribute(39341, 39342)]
|
||||
public class DestardBanner : Item
|
||||
{
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1123365;
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public DestardBanner()
|
||||
: base(39341)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile m)
|
||||
{
|
||||
if (m.InRange(this.GetWorldLocation(), 2))
|
||||
{
|
||||
Gump g = new Gump(50, 50);
|
||||
g.AddImage(0, 0, 30570);
|
||||
m.SendGump(g);
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
list.Add(1154937); // vvv item
|
||||
}
|
||||
|
||||
public DestardBanner(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using Server;
|
||||
using System.Collections.Generic;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
[FlipableAttribute(39353, 39354)]
|
||||
public class HonestyBanner : Item
|
||||
{
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1123377;
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public HonestyBanner() : base(39353)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile m)
|
||||
{
|
||||
if (m.InRange(this.GetWorldLocation(), 2))
|
||||
{
|
||||
Gump g = new Gump(50, 50);
|
||||
g.AddImage(0, 0, 30576);
|
||||
m.SendGump(g);
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
list.Add(1154937); // vvv item
|
||||
}
|
||||
|
||||
public HonestyBanner(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using Server;
|
||||
using System.Collections.Generic;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
[FlipableAttribute(39355, 39356)]
|
||||
public class HonorBanner : Item
|
||||
{
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1123379;
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public HonorBanner() : base(39355)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile m)
|
||||
{
|
||||
if (m.InRange(this.GetWorldLocation(), 2))
|
||||
{
|
||||
Gump g = new Gump(50, 50);
|
||||
g.AddImage(0, 0, 30577);
|
||||
m.SendGump(g);
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
list.Add(1154937); // vvv item
|
||||
}
|
||||
|
||||
public HonorBanner(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using Server;
|
||||
using System.Collections.Generic;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
[FlipableAttribute(39357, 39358)]
|
||||
public class HumilityBanner : Item
|
||||
{
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1123381;
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public HumilityBanner() : base(39357)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile m)
|
||||
{
|
||||
if (m.InRange(this.GetWorldLocation(), 2))
|
||||
{
|
||||
Gump g = new Gump(50, 50);
|
||||
g.AddImage(0, 0, 30578);
|
||||
m.SendGump(g);
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
list.Add(1154937); // vvv item
|
||||
}
|
||||
|
||||
public HumilityBanner(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
using System;
|
||||
using Server;
|
||||
using System.Collections.Generic;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
[FlipableAttribute(39343, 39344)]
|
||||
public class HythlothBanner : Item
|
||||
{
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1123367;
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public HythlothBanner()
|
||||
: base(39343)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile m)
|
||||
{
|
||||
if (m.InRange(this.GetWorldLocation(), 2))
|
||||
{
|
||||
Gump g = new Gump(50, 50);
|
||||
g.AddImage(0, 0, 30571);
|
||||
m.SendGump(g);
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
list.Add(1154937); // vvv item
|
||||
}
|
||||
|
||||
public HythlothBanner(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using Server;
|
||||
using System.Collections.Generic;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
[FlipableAttribute(39359, 39360)]
|
||||
public class JusticeBanner : Item
|
||||
{
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1123383;
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public JusticeBanner() : base(39359)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile m)
|
||||
{
|
||||
if (m.InRange(this.GetWorldLocation(), 2))
|
||||
{
|
||||
Gump g = new Gump(50, 50);
|
||||
g.AddImage(0, 0, 30579);
|
||||
m.SendGump(g);
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
list.Add(1154937); // vvv item
|
||||
}
|
||||
|
||||
public JusticeBanner(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
using System;
|
||||
using Server;
|
||||
using System.Collections.Generic;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
[FlipableAttribute(39345, 39346)]
|
||||
public class PrideBanner : Item
|
||||
{
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1123369;
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public PrideBanner()
|
||||
: base(39345)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile m)
|
||||
{
|
||||
if (m.InRange(this.GetWorldLocation(), 2))
|
||||
{
|
||||
Gump g = new Gump(50, 50);
|
||||
g.AddImage(0, 0, 30572);
|
||||
m.SendGump(g);
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
list.Add(1154937); // vvv item
|
||||
}
|
||||
|
||||
public PrideBanner(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using Server;
|
||||
using System.Collections.Generic;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
[FlipableAttribute(39361, 39362)]
|
||||
public class SacraficeBanner : Item
|
||||
{
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1123385;
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public SacraficeBanner() : base(39361)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile m)
|
||||
{
|
||||
if (m.InRange(this.GetWorldLocation(), 2))
|
||||
{
|
||||
Gump g = new Gump(50, 50);
|
||||
g.AddImage(0, 0, 30580);
|
||||
m.SendGump(g);
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
list.Add(1154937); // vvv item
|
||||
}
|
||||
|
||||
public SacraficeBanner(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
using System;
|
||||
using Server;
|
||||
using System.Collections.Generic;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
[FlipableAttribute(39347, 39348)]
|
||||
public class ShameBanner : Item
|
||||
{
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1123371;
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public ShameBanner()
|
||||
: base(39347)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile m)
|
||||
{
|
||||
if (m.InRange(this.GetWorldLocation(), 2))
|
||||
{
|
||||
Gump g = new Gump(50, 50);
|
||||
g.AddImage(0, 0, 30573);
|
||||
m.SendGump(g);
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
list.Add(1154937); // vvv item
|
||||
}
|
||||
|
||||
public ShameBanner(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using Server;
|
||||
using System.Collections.Generic;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
[FlipableAttribute(39363, 39364)]
|
||||
public class SpiritualityBanner : Item
|
||||
{
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1123387;
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public SpiritualityBanner() : base(39363)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile m)
|
||||
{
|
||||
if (m.InRange(this.GetWorldLocation(), 2))
|
||||
{
|
||||
Gump g = new Gump(50, 50);
|
||||
g.AddImage(0, 0, 30581);
|
||||
m.SendGump(g);
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
list.Add(1154937); // vvv item
|
||||
}
|
||||
|
||||
public SpiritualityBanner(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using Server;
|
||||
using System.Collections.Generic;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
[FlipableAttribute(39365, 39366)]
|
||||
public class ValorBanner : Item
|
||||
{
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1123389;
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public ValorBanner() : base(39365)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile m)
|
||||
{
|
||||
if (m.InRange(this.GetWorldLocation(), 2))
|
||||
{
|
||||
Gump g = new Gump(50, 50);
|
||||
g.AddImage(0, 0, 30582);
|
||||
m.SendGump(g);
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
list.Add(1154937); // vvv item
|
||||
}
|
||||
|
||||
public ValorBanner(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
using System;
|
||||
using Server;
|
||||
using System.Collections.Generic;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
[FlipableAttribute(39349, 39350)]
|
||||
public class WrongBanner : Item
|
||||
{
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1123373;
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public WrongBanner()
|
||||
: base(39349)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile m)
|
||||
{
|
||||
if (m.InRange(this.GetWorldLocation(), 2))
|
||||
{
|
||||
Gump g = new Gump(50, 50);
|
||||
g.AddImage(0, 0, 30574);
|
||||
m.SendGump(g);
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
list.Add(1154937); // vvv item
|
||||
}
|
||||
|
||||
public WrongBanner(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
331
Scripts/Services/ViceVsVirtue/Items/Rewards/CannonTurret.cs
Normal file
331
Scripts/Services/ViceVsVirtue/Items/Rewards/CannonTurret.cs
Normal file
@@ -0,0 +1,331 @@
|
||||
using System;
|
||||
using Server;
|
||||
using System.Collections.Generic;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
using System.Linq;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
public class CannonTurret : BaseAddon
|
||||
{
|
||||
public const int ScanRange = 8;
|
||||
public const int ReloadDelay = 10;
|
||||
|
||||
private bool _NoShoot;
|
||||
private int _ShotsRemaining;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Mobile Owner { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int ShotsRemaining
|
||||
{
|
||||
get { return _ShotsRemaining; }
|
||||
set
|
||||
{
|
||||
_ShotsRemaining = value;
|
||||
|
||||
if (_ShotsRemaining <= 0)
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public CannonBase Base { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Item Turret { get; set; }
|
||||
|
||||
private DateTime _NextShot;
|
||||
|
||||
public override BaseAddonDeed Deed { get { return null; } }
|
||||
|
||||
[Constructable]
|
||||
public CannonTurret()
|
||||
: this(null)
|
||||
{
|
||||
}
|
||||
|
||||
public CannonTurret(Mobile m)
|
||||
{
|
||||
Owner = m;
|
||||
|
||||
ShotsRemaining = 20;
|
||||
|
||||
Base = new CannonBase(this);
|
||||
Base.MoveToWorld(this.Location, this.Map);
|
||||
|
||||
AddonComponent c = new LocalizedAddonComponent(16918, 1155505);
|
||||
AddComponent(c, 0, 0, 3);
|
||||
Turret = c;
|
||||
|
||||
_NextShot = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
public override void OnLocationChange(Point3D oldLocation)
|
||||
{
|
||||
base.OnLocationChange(oldLocation);
|
||||
|
||||
if (Base != null && !Base.Deleted)
|
||||
Base.Location = this.Location;
|
||||
}
|
||||
|
||||
public override void OnMapChange()
|
||||
{
|
||||
base.OnMapChange();
|
||||
|
||||
if (Base != null && !Base.Deleted)
|
||||
Base.Map = this.Map;
|
||||
}
|
||||
|
||||
public override void Delete()
|
||||
{
|
||||
base.Delete();
|
||||
|
||||
if (Base != null && !Base.Deleted)
|
||||
Base.Delete();
|
||||
}
|
||||
|
||||
public void Scan()
|
||||
{
|
||||
if (Deleted || this.Map == null || _ShotsRemaining <= 0 || _NoShoot)
|
||||
return;
|
||||
|
||||
IPooledEnumerable eable = this.Map.GetMobilesInRange(this.Location, ScanRange);
|
||||
List<Mobile> list = new List<Mobile>();
|
||||
|
||||
foreach (Mobile m in eable)
|
||||
{
|
||||
if (Owner == null || (ViceVsVirtueSystem.IsEnemy(Owner, m) && m.InLOS(this.Location)
|
||||
&& m is PlayerMobile
|
||||
&& m.AccessLevel == AccessLevel.Player))
|
||||
{
|
||||
list.Add(m);
|
||||
}
|
||||
}
|
||||
|
||||
eable.Free();
|
||||
Mobile target = null;
|
||||
double closest = ScanRange;
|
||||
|
||||
if (list.Count > 0)
|
||||
{
|
||||
foreach (Mobile m in list.Where(mob => target == null || mob.GetDistanceToSqrt(target) < closest))
|
||||
{
|
||||
target = m;
|
||||
closest = m.GetDistanceToSqrt(target);
|
||||
}
|
||||
}
|
||||
|
||||
if (target != null)
|
||||
{
|
||||
AimAndShoot(target, (int)Math.Ceiling(closest));
|
||||
}
|
||||
|
||||
list.Clear();
|
||||
list.TrimExcess();
|
||||
}
|
||||
|
||||
public void AimAndShoot(Mobile target, int range)
|
||||
{
|
||||
Direction d = Utility.GetDirection(this, target);
|
||||
|
||||
switch (d)
|
||||
{
|
||||
default:
|
||||
case Direction.North:
|
||||
case Direction.Right: Turret.ItemID = 16920; break;
|
||||
case Direction.East:
|
||||
case Direction.Down: Turret.ItemID = 16921; break;
|
||||
case Direction.South:
|
||||
case Direction.Left: Turret.ItemID = 16918; break;
|
||||
case Direction.West:
|
||||
case Direction.Up: Turret.ItemID = 16919; break;
|
||||
}
|
||||
|
||||
if (_NextShot > DateTime.UtcNow)
|
||||
return;
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromMilliseconds(250), () =>
|
||||
{
|
||||
Point3D p = new Point3D(this.X, this.Y, this.Z + 2);
|
||||
Map map = this.Map;
|
||||
|
||||
switch (Turret.ItemID)
|
||||
{
|
||||
case 16920: p.Y--; break;
|
||||
case 16921: p.X++; break;
|
||||
case 16918: p.Y++; break;
|
||||
case 16919: p.X--; break;
|
||||
}
|
||||
|
||||
Effects.SendLocationEffect(p, map, 14120, 15, 10);
|
||||
Effects.PlaySound(p, map, 0x664);
|
||||
});
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromMilliseconds(250 + (150 * (range))), () =>
|
||||
{
|
||||
if (Owner != null)
|
||||
Owner.DoHarmful(target);
|
||||
|
||||
AOS.Damage(target, Owner, Utility.RandomMinMax(75, 100), 100, 0, 0, 0, 0);
|
||||
|
||||
Effects.SendLocationEffect(target.Location, target.Map, Utility.RandomBool() ? 14000 : 14013, 15, 10);
|
||||
Effects.PlaySound(target.Location, target.Map, 0x207);
|
||||
|
||||
ShotsRemaining--;
|
||||
});
|
||||
|
||||
_NextShot = DateTime.UtcNow + TimeSpan.FromSeconds(ReloadDelay);
|
||||
}
|
||||
|
||||
public class CannonBase : DamageableItem
|
||||
{
|
||||
public override int LabelNumber { get { return 1155505; } }
|
||||
|
||||
public CannonTurret Turret { get; set; }
|
||||
|
||||
public CannonBase(CannonTurret turret)
|
||||
: base(1822, 1822)
|
||||
{
|
||||
Level = ItemLevel.Hard;
|
||||
Turret = turret;
|
||||
|
||||
Name = "a cannon turret";
|
||||
}
|
||||
|
||||
public override void Delete()
|
||||
{
|
||||
base.Delete();
|
||||
|
||||
if (Turret != null)
|
||||
Turret.Delete();
|
||||
}
|
||||
|
||||
public CannonBase(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public CannonTurret(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
|
||||
writer.Write(Owner);
|
||||
writer.Write(Base);
|
||||
writer.Write(Turret);
|
||||
writer.Write(ShotsRemaining);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
Owner = reader.ReadMobile();
|
||||
Base = reader.ReadItem() as CannonBase;
|
||||
Turret = reader.ReadItem();
|
||||
ShotsRemaining = reader.ReadInt();
|
||||
|
||||
_NoShoot = true;
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(10), () =>
|
||||
{
|
||||
if (Base != null)
|
||||
{
|
||||
if (ViceVsVirtueSystem.Instance.Battle.OnGoing)
|
||||
{
|
||||
Base.Turret = this;
|
||||
ViceVsVirtueSystem.Instance.Battle.Turrets.Add(this);
|
||||
_NoShoot = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Delete();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public class CannonTurretPlans : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1155503; } } // Plans for a Cannon Turret
|
||||
|
||||
[Constructable]
|
||||
public CannonTurretPlans() : base(5630)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile m)
|
||||
{
|
||||
if (IsChildOf(m.Backpack))
|
||||
{
|
||||
VvVBattle battle = ViceVsVirtueSystem.Instance.Battle;
|
||||
|
||||
if (!ViceVsVirtueSystem.IsVvV(m))
|
||||
{
|
||||
m.SendLocalizedMessage(1155496); // This item can only be used by VvV participants!
|
||||
}
|
||||
else if (battle == null || !battle.OnGoing || !battle.IsInActiveBattle(m))
|
||||
{
|
||||
m.SendLocalizedMessage(1155406); // This item can only be used in an active VvV battle region!
|
||||
}
|
||||
else if (battle.TurretCount > VvVBattle.MaxTurrets)
|
||||
{
|
||||
m.SendLocalizedMessage(1155502); // The turret limit for this battle has been reached!
|
||||
}
|
||||
else
|
||||
{
|
||||
CannonTurret t = new CannonTurret(m);
|
||||
t.MoveToWorld(m.Location, m.Map);
|
||||
|
||||
battle.Turrets.Add(t);
|
||||
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
list.Add(1154937); // vvv item
|
||||
}
|
||||
|
||||
public CannonTurretPlans(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using Server;
|
||||
using System.Collections.Generic;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
public class EssenceOfCourage : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1155554; } } // Essence of Courage
|
||||
|
||||
[Constructable]
|
||||
public EssenceOfCourage()
|
||||
: base(3838)
|
||||
{
|
||||
Hue = 2718;
|
||||
//TODO: ID and Stackable?
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile m)
|
||||
{
|
||||
if (IsChildOf(m.Backpack))
|
||||
{
|
||||
m.SendLocalizedMessage(1155555); // Feed this to VvV War Steeds to maintain their battle readiness!
|
||||
}
|
||||
}
|
||||
|
||||
public EssenceOfCourage(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
using System;
|
||||
using Server;
|
||||
using System.Collections.Generic;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
public class ForgedRoyalPardon : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1155524; } } // Forged Royal Pardon
|
||||
|
||||
[Constructable]
|
||||
public ForgedRoyalPardon()
|
||||
: base(18098)
|
||||
{
|
||||
Hue = 0x21;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile m)
|
||||
{
|
||||
if (IsChildOf(m.Backpack))
|
||||
{
|
||||
if (m is PlayerMobile && ViceVsVirtueSystem.IsVvV(m))
|
||||
{
|
||||
if (m.Kills <= 0)
|
||||
{
|
||||
m.SendMessage("You have no use for this item.");
|
||||
}
|
||||
else if (Server.Spells.SpellHelper.CheckCombat(m))
|
||||
{
|
||||
m.SendLocalizedMessage(1116588); //You cannot use a forged pardon while in combat.
|
||||
}
|
||||
else
|
||||
{
|
||||
m.SendGump(new ConfirmCallbackGump((PlayerMobile)m, 1155524, 1155525, null, null, (mobile, obj) =>
|
||||
{
|
||||
mobile.Kills = 0;
|
||||
|
||||
mobile.Delta(MobileDelta.Noto);
|
||||
|
||||
mobile.SendMessage("You have been pardoned from all murder counts.");
|
||||
Delete();
|
||||
|
||||
//TODO: Effects? Message?
|
||||
}));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m.SendLocalizedMessage(1155496); // This item can only be used by VvV participants!
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m.SendLocalizedMessage(1042004); //That must be in your pack for you to use it.
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
list.Add(1154937); // vvv item
|
||||
}
|
||||
|
||||
public ForgedRoyalPardon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
118
Scripts/Services/ViceVsVirtue/Items/Rewards/ManaSpike.cs
Normal file
118
Scripts/Services/ViceVsVirtue/Items/Rewards/ManaSpike.cs
Normal file
@@ -0,0 +1,118 @@
|
||||
using System;
|
||||
using Server;
|
||||
using System.Collections.Generic;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
public class ManaSpike : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1155508; } }
|
||||
|
||||
[Constructable]
|
||||
public ManaSpike() : base(2308)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile m)
|
||||
{
|
||||
if(IsChildOf(m.Backpack))
|
||||
{
|
||||
VvVBattle battle = ViceVsVirtueSystem.Instance.Battle;
|
||||
|
||||
if(!ViceVsVirtueSystem.IsVvV(m))
|
||||
{
|
||||
m.SendLocalizedMessage(1155496); // This item can only be used by VvV participants!
|
||||
}
|
||||
else if (battle == null || battle.Region == null || !battle.OnGoing || !battle.IsInActiveBattle(m))
|
||||
{
|
||||
m.SendLocalizedMessage(1155406); // This item can only be used in an active VvV battle region!
|
||||
}
|
||||
else if(battle.NextManaSpike > DateTime.UtcNow)
|
||||
{
|
||||
m.SendLocalizedMessage(1155497); // The ground is too charged to use a mana spike!
|
||||
}
|
||||
else if (m.Mana < 50)
|
||||
{
|
||||
m.SendLocalizedMessage(1155509); // You lack the mana required to use this.
|
||||
}
|
||||
else
|
||||
{
|
||||
m.FixedParticles(0x37C4, 1, 8, 9916, 39, 3, EffectLayer.CenterFeet);
|
||||
m.FixedParticles(0x37C4, 1, 8, 9502, 39, 4, EffectLayer.CenterFeet);
|
||||
m.PlaySound(0x210);
|
||||
m.PrivateOverheadMessage(Network.MessageType.Regular, 1154, 1155499, m.NetState); // *You drive the spike into the ground!*
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromMilliseconds(250), () =>
|
||||
{
|
||||
if (m.Mana < 50) // Another mana check!
|
||||
{
|
||||
m.SendLocalizedMessage(1155509); // You lack the mana required to use this.
|
||||
return;
|
||||
}
|
||||
|
||||
m.Mana = 0;
|
||||
|
||||
battle.NextManaSpike = DateTime.UtcNow + TimeSpan.FromMinutes(5);
|
||||
battle.ManaSpikeEndEffects = DateTime.UtcNow + TimeSpan.FromMinutes(2); // TODO: Duration?
|
||||
|
||||
foreach (Mobile mobile in battle.Region.GetEnumeratedMobiles())
|
||||
{
|
||||
if (ViceVsVirtueSystem.IsEnemy(mobile, m))
|
||||
{
|
||||
mobile.RevealingAction();
|
||||
|
||||
mobile.BoltEffect(0);
|
||||
AOS.Damage(mobile, m, Utility.RandomMinMax(50, 75), 0, 0, 0, 0, 100);
|
||||
|
||||
mobile.PrivateOverheadMessage(Network.MessageType.Regular, 1154, 1155498, mobile.NetState); // *Your body convulses as energy surges through it!*
|
||||
}
|
||||
}
|
||||
|
||||
Delete();
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m.SendLocalizedMessage(1042004); // That must be in your pack for you to use it.
|
||||
}
|
||||
}
|
||||
|
||||
public static bool UnderEffects(Mobile m)
|
||||
{
|
||||
VvVBattle battle = ViceVsVirtueSystem.Instance.Battle;
|
||||
|
||||
if (battle != null && battle.OnGoing && battle.ManaSpikeEndEffects != DateTime.MinValue && battle.ManaSpikeEndEffects > DateTime.UtcNow)
|
||||
{
|
||||
m.PrivateOverheadMessage(Network.MessageType.Regular, 1154, 1155500, m.NetState); // *Your body is too charged with electrical energy to hide!*
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
list.Add(1154937); // vvv item
|
||||
}
|
||||
|
||||
public ManaSpike(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
98
Scripts/Services/ViceVsVirtue/Items/Rewards/MorphEarrings.cs
Normal file
98
Scripts/Services/ViceVsVirtue/Items/Rewards/MorphEarrings.cs
Normal file
@@ -0,0 +1,98 @@
|
||||
using System;
|
||||
using Server;
|
||||
using System.Collections.Generic;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
using Server.Factions;
|
||||
using Server.Engines.VvV;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[TypeAlias("Server.Engines.VvV.MorphEarrings")]
|
||||
public class MorphEarrings : GoldEarrings
|
||||
{
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1094746; // Morph Earrings
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public MorphEarrings()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnRemoved(object parent)
|
||||
{
|
||||
base.OnRemoved(parent);
|
||||
|
||||
if (parent is Mobile)
|
||||
{
|
||||
ValidateEquipment((Mobile)parent);
|
||||
}
|
||||
}
|
||||
|
||||
private void ValidateEquipment(Mobile m)
|
||||
{
|
||||
if (m == null)
|
||||
return;
|
||||
|
||||
Race race = m.Race;
|
||||
bool didDrop = false;
|
||||
|
||||
List<Item> list = new List<Item>(m.Items);
|
||||
|
||||
foreach (Item item in list)
|
||||
{
|
||||
bool drop = false;
|
||||
|
||||
if (item is BaseArmor && ((BaseArmor)item).RequiredRace != null && ((BaseArmor)item).RequiredRace != race)
|
||||
drop = true;
|
||||
else if (item is BaseWeapon && ((BaseWeapon)item).RequiredRace != null && ((BaseWeapon)item).RequiredRace != race)
|
||||
drop = true;
|
||||
else if (item is BaseJewel && ((BaseJewel)item).RequiredRace != null && ((BaseJewel)item).RequiredRace != race)
|
||||
drop = true;
|
||||
else if (item is BaseClothing && ((BaseClothing)item).RequiredRace != null && ((BaseClothing)item).RequiredRace != race)
|
||||
drop = true;
|
||||
|
||||
if (drop)
|
||||
{
|
||||
if (!didDrop)
|
||||
didDrop = true;
|
||||
|
||||
if (m.Backpack == null || !m.Backpack.TryDropItem(m, item, false))
|
||||
{
|
||||
m.BankBox.DropItem(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ColUtility.Free(list);
|
||||
|
||||
if (didDrop)
|
||||
m.SendLocalizedMessage(500647); // Some equipment has been moved to your backpack.
|
||||
}
|
||||
|
||||
public MorphEarrings(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(1);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if (version == 0 && ViceVsVirtueSystem.Enabled)
|
||||
Timer.DelayCall(() => ViceVsVirtueSystem.Instance.AddVvVItem(this));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
using System;
|
||||
using Server;
|
||||
using System.Collections.Generic;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
public class CovetousTileAddon : BaseAddon
|
||||
{
|
||||
public override BaseAddonDeed Deed { get { return new CovetousTileDeed(); } }
|
||||
|
||||
public TileType TileType { get; set; }
|
||||
|
||||
private int offset;
|
||||
|
||||
[Constructable]
|
||||
public CovetousTileAddon(TileType type)
|
||||
{
|
||||
TileType = type;
|
||||
|
||||
offset = 0;
|
||||
|
||||
if (type != TileType.North)
|
||||
{
|
||||
offset = 4;
|
||||
}
|
||||
|
||||
AddComponent(new AddonComponent(39372 + offset), 0, 0, 0);
|
||||
AddComponent(new AddonComponent(39373 + offset), 1, 0, 0);
|
||||
AddComponent(new AddonComponent(39374 + offset), 0, 1, 0);
|
||||
AddComponent(new AddonComponent(39375 + offset), 1, 1, 0);
|
||||
}
|
||||
|
||||
public CovetousTileAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class CovetousTileDeed : BaseAddonDeed, IRewardOption
|
||||
{
|
||||
public override BaseAddon Addon { get { return new CovetousTileAddon(TileType); } }
|
||||
public override int LabelNumber { get { return 1155516; } } // Covetous Tile
|
||||
|
||||
public TileType TileType { get; set; }
|
||||
|
||||
[Constructable]
|
||||
public CovetousTileDeed()
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.CloseGump(typeof(RewardOptionGump));
|
||||
from.SendGump(new RewardOptionGump(this));
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
}
|
||||
|
||||
public CovetousTileDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public void GetOptions(RewardOptionList list)
|
||||
{
|
||||
list.Add((int)TileType.North, "Covetous (North)");
|
||||
list.Add((int)TileType.West, "Covetous (East)");
|
||||
}
|
||||
|
||||
|
||||
public void OnOptionSelected(Mobile from, int choice)
|
||||
{
|
||||
TileType = (TileType)choice;
|
||||
|
||||
if (!Deleted)
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
}
|
||||
}
|
||||
114
Scripts/Services/ViceVsVirtue/Items/Rewards/Tiles/DeceitTIle.cs
Normal file
114
Scripts/Services/ViceVsVirtue/Items/Rewards/Tiles/DeceitTIle.cs
Normal file
@@ -0,0 +1,114 @@
|
||||
using System;
|
||||
using Server;
|
||||
using System.Collections.Generic;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
public class DeceitTileAddon : BaseAddon
|
||||
{
|
||||
public override BaseAddonDeed Deed { get { return new DeceitTileDeed(); } }
|
||||
|
||||
public TileType TileType { get; set; }
|
||||
|
||||
private int offset;
|
||||
|
||||
[Constructable]
|
||||
public DeceitTileAddon(TileType type)
|
||||
{
|
||||
TileType = type;
|
||||
|
||||
offset = 0;
|
||||
|
||||
if (type != TileType.North)
|
||||
{
|
||||
offset = 4;
|
||||
}
|
||||
|
||||
AddComponent(new AddonComponent(39380 + offset), 0, 0, 0);
|
||||
AddComponent(new AddonComponent(39381 + offset), 1, 0, 0);
|
||||
AddComponent(new AddonComponent(39382 + offset), 0, 1, 0);
|
||||
AddComponent(new AddonComponent(39383 + offset), 1, 1, 0);
|
||||
}
|
||||
|
||||
public DeceitTileAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class DeceitTileDeed : BaseAddonDeed, IRewardOption
|
||||
{
|
||||
public override BaseAddon Addon { get { return new DeceitTileAddon(TileType); } }
|
||||
public override int LabelNumber { get { return 1155517; } } // Deceit Tile
|
||||
|
||||
public TileType TileType { get; set; }
|
||||
|
||||
[Constructable]
|
||||
public DeceitTileDeed()
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.CloseGump(typeof(RewardOptionGump));
|
||||
from.SendGump(new RewardOptionGump(this));
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
}
|
||||
|
||||
public DeceitTileDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public void GetOptions(RewardOptionList list)
|
||||
{
|
||||
list.Add((int)TileType.North, "Deceit (North)");
|
||||
list.Add((int)TileType.West, "Deceit (East)");
|
||||
}
|
||||
|
||||
|
||||
public void OnOptionSelected(Mobile from, int choice)
|
||||
{
|
||||
TileType = (TileType)choice;
|
||||
|
||||
if (!Deleted)
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
}
|
||||
}
|
||||
114
Scripts/Services/ViceVsVirtue/Items/Rewards/Tiles/DespiseTile.cs
Normal file
114
Scripts/Services/ViceVsVirtue/Items/Rewards/Tiles/DespiseTile.cs
Normal file
@@ -0,0 +1,114 @@
|
||||
using System;
|
||||
using Server;
|
||||
using System.Collections.Generic;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
public class DespiseTileAddon : BaseAddon
|
||||
{
|
||||
public override BaseAddonDeed Deed { get { return new DespiseTileDeed(); } }
|
||||
|
||||
public TileType TileType { get; set; }
|
||||
|
||||
private int offset;
|
||||
|
||||
[Constructable]
|
||||
public DespiseTileAddon(TileType type)
|
||||
{
|
||||
TileType = type;
|
||||
|
||||
offset = 0;
|
||||
|
||||
if (type != TileType.North)
|
||||
{
|
||||
offset = 4;
|
||||
}
|
||||
|
||||
AddComponent(new AddonComponent(39388 + offset), 0, 0, 0);
|
||||
AddComponent(new AddonComponent(39389 + offset), 1, 0, 0);
|
||||
AddComponent(new AddonComponent(39390 + offset), 0, 1, 0);
|
||||
AddComponent(new AddonComponent(39391 + offset), 1, 1, 0);
|
||||
}
|
||||
|
||||
public DespiseTileAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class DespiseTileDeed : BaseAddonDeed, IRewardOption
|
||||
{
|
||||
public override BaseAddon Addon { get { return new DespiseTileAddon(TileType); } }
|
||||
public override int LabelNumber { get { return 1155518; } } // Despise Tile
|
||||
|
||||
public TileType TileType { get; set; }
|
||||
|
||||
[Constructable]
|
||||
public DespiseTileDeed()
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.CloseGump(typeof(RewardOptionGump));
|
||||
from.SendGump(new RewardOptionGump(this));
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
}
|
||||
|
||||
public DespiseTileDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public void GetOptions(RewardOptionList list)
|
||||
{
|
||||
list.Add((int)TileType.North, "Despise (North)");
|
||||
list.Add((int)TileType.West, "Despise (East)");
|
||||
}
|
||||
|
||||
|
||||
public void OnOptionSelected(Mobile from, int choice)
|
||||
{
|
||||
TileType = (TileType)choice;
|
||||
|
||||
if (!Deleted)
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
}
|
||||
}
|
||||
114
Scripts/Services/ViceVsVirtue/Items/Rewards/Tiles/DestardTile.cs
Normal file
114
Scripts/Services/ViceVsVirtue/Items/Rewards/Tiles/DestardTile.cs
Normal file
@@ -0,0 +1,114 @@
|
||||
using System;
|
||||
using Server;
|
||||
using System.Collections.Generic;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
public class DestardTileAddon : BaseAddon
|
||||
{
|
||||
public override BaseAddonDeed Deed { get { return new DestardTileDeed(); } }
|
||||
|
||||
public TileType TileType { get; set; }
|
||||
|
||||
private int offset;
|
||||
|
||||
[Constructable]
|
||||
public DestardTileAddon(TileType type)
|
||||
{
|
||||
TileType = type;
|
||||
|
||||
offset = 0;
|
||||
|
||||
if (type != TileType.North)
|
||||
{
|
||||
offset = 4;
|
||||
}
|
||||
|
||||
AddComponent(new AddonComponent(39396 + offset), 0, 0, 0);
|
||||
AddComponent(new AddonComponent(39397 + offset), 1, 0, 0);
|
||||
AddComponent(new AddonComponent(39398 + offset), 0, 1, 0);
|
||||
AddComponent(new AddonComponent(39399 + offset), 1, 1, 0);
|
||||
}
|
||||
|
||||
public DestardTileAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class DestardTileDeed : BaseAddonDeed, IRewardOption
|
||||
{
|
||||
public override BaseAddon Addon { get { return new DestardTileAddon(TileType); } }
|
||||
public override int LabelNumber { get { return 1155519; } } // Destard Tile
|
||||
|
||||
public TileType TileType { get; set; }
|
||||
|
||||
[Constructable]
|
||||
public DestardTileDeed()
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.CloseGump(typeof(RewardOptionGump));
|
||||
from.SendGump(new RewardOptionGump(this));
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
}
|
||||
|
||||
public DestardTileDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public void GetOptions(RewardOptionList list)
|
||||
{
|
||||
list.Add((int)TileType.North, "Destard (North)");
|
||||
list.Add((int)TileType.West, "Destard (East)");
|
||||
}
|
||||
|
||||
|
||||
public void OnOptionSelected(Mobile from, int choice)
|
||||
{
|
||||
TileType = (TileType)choice;
|
||||
|
||||
if (!Deleted)
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
using System;
|
||||
using Server;
|
||||
using System.Collections.Generic;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
public class HythlothTileAddon : BaseAddon
|
||||
{
|
||||
public override BaseAddonDeed Deed { get { return new HythlothTileDeed(); } }
|
||||
|
||||
public TileType TileType { get; set; }
|
||||
|
||||
private int offset;
|
||||
|
||||
[Constructable]
|
||||
public HythlothTileAddon(TileType type)
|
||||
{
|
||||
TileType = type;
|
||||
|
||||
offset = 0;
|
||||
|
||||
if (type != TileType.North)
|
||||
{
|
||||
offset = 4;
|
||||
}
|
||||
|
||||
AddComponent(new AddonComponent(39404 + offset), 0, 0, 0);
|
||||
AddComponent(new AddonComponent(39405 + offset), 1, 0, 0);
|
||||
AddComponent(new AddonComponent(39406 + offset), 0, 1, 0);
|
||||
AddComponent(new AddonComponent(39407 + offset), 1, 1, 0);
|
||||
}
|
||||
|
||||
public HythlothTileAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class HythlothTileDeed : BaseAddonDeed, IRewardOption
|
||||
{
|
||||
public override BaseAddon Addon { get { return new HythlothTileAddon(TileType); } }
|
||||
public override int LabelNumber { get { return 1155520; } } // Hythloth Tile
|
||||
|
||||
public TileType TileType { get; set; }
|
||||
|
||||
[Constructable]
|
||||
public HythlothTileDeed()
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.CloseGump(typeof(RewardOptionGump));
|
||||
from.SendGump(new RewardOptionGump(this));
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
}
|
||||
|
||||
public HythlothTileDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public void GetOptions(RewardOptionList list)
|
||||
{
|
||||
list.Add((int)TileType.North, "Hythloth (North)");
|
||||
list.Add((int)TileType.West, "Hythloth (East)");
|
||||
}
|
||||
|
||||
|
||||
public void OnOptionSelected(Mobile from, int choice)
|
||||
{
|
||||
TileType = (TileType)choice;
|
||||
|
||||
if (!Deleted)
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
}
|
||||
}
|
||||
114
Scripts/Services/ViceVsVirtue/Items/Rewards/Tiles/PrideTile.cs
Normal file
114
Scripts/Services/ViceVsVirtue/Items/Rewards/Tiles/PrideTile.cs
Normal file
@@ -0,0 +1,114 @@
|
||||
using System;
|
||||
using Server;
|
||||
using System.Collections.Generic;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
public class PrideTileAddon : BaseAddon
|
||||
{
|
||||
public override BaseAddonDeed Deed { get { return new PrideTileDeed(); } }
|
||||
|
||||
public TileType TileType { get; set; }
|
||||
|
||||
private int offset;
|
||||
|
||||
[Constructable]
|
||||
public PrideTileAddon(TileType type)
|
||||
{
|
||||
TileType = type;
|
||||
|
||||
offset = 0;
|
||||
|
||||
if (type != TileType.North)
|
||||
{
|
||||
offset = 4;
|
||||
}
|
||||
|
||||
AddComponent(new AddonComponent(39412 + offset), 0, 0, 0);
|
||||
AddComponent(new AddonComponent(39413 + offset), 1, 0, 0);
|
||||
AddComponent(new AddonComponent(39414 + offset), 0, 1, 0);
|
||||
AddComponent(new AddonComponent(39415 + offset), 1, 1, 0);
|
||||
}
|
||||
|
||||
public PrideTileAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class PrideTileDeed : BaseAddonDeed, IRewardOption
|
||||
{
|
||||
public override BaseAddon Addon { get { return new PrideTileAddon(TileType); } }
|
||||
public override int LabelNumber { get { return 1155521; } } // Pride Tile
|
||||
|
||||
public TileType TileType { get; set; }
|
||||
|
||||
[Constructable]
|
||||
public PrideTileDeed()
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.CloseGump(typeof(RewardOptionGump));
|
||||
from.SendGump(new RewardOptionGump(this));
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
}
|
||||
|
||||
public PrideTileDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public void GetOptions(RewardOptionList list)
|
||||
{
|
||||
list.Add((int)TileType.North, "Pride (North)");
|
||||
list.Add((int)TileType.West, "Pride (East)");
|
||||
}
|
||||
|
||||
|
||||
public void OnOptionSelected(Mobile from, int choice)
|
||||
{
|
||||
TileType = (TileType)choice;
|
||||
|
||||
if (!Deleted)
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
}
|
||||
}
|
||||
114
Scripts/Services/ViceVsVirtue/Items/Rewards/Tiles/ShameTile.cs
Normal file
114
Scripts/Services/ViceVsVirtue/Items/Rewards/Tiles/ShameTile.cs
Normal file
@@ -0,0 +1,114 @@
|
||||
using System;
|
||||
using Server;
|
||||
using System.Collections.Generic;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
public class ShameTileAddon : BaseAddon
|
||||
{
|
||||
public override BaseAddonDeed Deed { get { return new ShameTileDeed(); } }
|
||||
|
||||
public TileType TileType { get; set; }
|
||||
|
||||
private int offset;
|
||||
|
||||
[Constructable]
|
||||
public ShameTileAddon(TileType type)
|
||||
{
|
||||
TileType = type;
|
||||
|
||||
offset = 0;
|
||||
|
||||
if (type != TileType.North)
|
||||
{
|
||||
offset = 4;
|
||||
}
|
||||
|
||||
AddComponent(new AddonComponent(39420 + offset), 0, 0, 0);
|
||||
AddComponent(new AddonComponent(39421 + offset), 1, 0, 0);
|
||||
AddComponent(new AddonComponent(39422 + offset), 0, 1, 0);
|
||||
AddComponent(new AddonComponent(39423 + offset), 1, 1, 0);
|
||||
}
|
||||
|
||||
public ShameTileAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class ShameTileDeed : BaseAddonDeed, IRewardOption
|
||||
{
|
||||
public override BaseAddon Addon { get { return new ShameTileAddon(TileType); } }
|
||||
public override int LabelNumber { get { return 1155522; } } // Shame Tile
|
||||
|
||||
public TileType TileType { get; set; }
|
||||
|
||||
[Constructable]
|
||||
public ShameTileDeed()
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.CloseGump(typeof(RewardOptionGump));
|
||||
from.SendGump(new RewardOptionGump(this));
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
}
|
||||
|
||||
public ShameTileDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public void GetOptions(RewardOptionList list)
|
||||
{
|
||||
list.Add((int)TileType.North, "Shame (North)");
|
||||
list.Add((int)TileType.West, "Shame (East)");
|
||||
}
|
||||
|
||||
|
||||
public void OnOptionSelected(Mobile from, int choice)
|
||||
{
|
||||
TileType = (TileType)choice;
|
||||
|
||||
if (!Deleted)
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
}
|
||||
}
|
||||
114
Scripts/Services/ViceVsVirtue/Items/Rewards/Tiles/WrongTile.cs
Normal file
114
Scripts/Services/ViceVsVirtue/Items/Rewards/Tiles/WrongTile.cs
Normal file
@@ -0,0 +1,114 @@
|
||||
using System;
|
||||
using Server;
|
||||
using System.Collections.Generic;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
using Server.Gumps;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
public class WrongTileAddon : BaseAddon
|
||||
{
|
||||
public override BaseAddonDeed Deed { get { return new WrongTileDeed(); } }
|
||||
|
||||
public TileType TileType { get; set; }
|
||||
|
||||
private int offset;
|
||||
|
||||
[Constructable]
|
||||
public WrongTileAddon(TileType type)
|
||||
{
|
||||
TileType = type;
|
||||
|
||||
offset = 0;
|
||||
|
||||
if (type != TileType.North)
|
||||
{
|
||||
offset = 4;
|
||||
}
|
||||
|
||||
AddComponent(new AddonComponent(39428 + offset), 0, 0, 0);
|
||||
AddComponent(new AddonComponent(39428 + offset), 1, 0, 0);
|
||||
AddComponent(new AddonComponent(39428 + offset), 0, 1, 0);
|
||||
AddComponent(new AddonComponent(39428 + offset), 1, 1, 0);
|
||||
}
|
||||
|
||||
public WrongTileAddon(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class WrongTileDeed : BaseAddonDeed, IRewardOption
|
||||
{
|
||||
public override BaseAddon Addon { get { return new WrongTileAddon(TileType); } }
|
||||
public override int LabelNumber { get { return 1155523; } } // Wrong Tile
|
||||
|
||||
public TileType TileType { get; set; }
|
||||
|
||||
[Constructable]
|
||||
public WrongTileDeed()
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.CloseGump(typeof(RewardOptionGump));
|
||||
from.SendGump(new RewardOptionGump(this));
|
||||
}
|
||||
else
|
||||
from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
|
||||
}
|
||||
|
||||
public WrongTileDeed(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public void GetOptions(RewardOptionList list)
|
||||
{
|
||||
list.Add((int)TileType.North, "Wrong (North)");
|
||||
list.Add((int)TileType.West, "Wrong (East)");
|
||||
}
|
||||
|
||||
|
||||
public void OnOptionSelected(Mobile from, int choice)
|
||||
{
|
||||
TileType = (TileType)choice;
|
||||
|
||||
if (!Deleted)
|
||||
base.OnDoubleClick(from);
|
||||
}
|
||||
}
|
||||
}
|
||||
171
Scripts/Services/ViceVsVirtue/Items/Rewards/VvVArms.cs
Normal file
171
Scripts/Services/ViceVsVirtue/Items/Rewards/VvVArms.cs
Normal file
@@ -0,0 +1,171 @@
|
||||
using System;
|
||||
using Server;
|
||||
using System.Collections.Generic;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
public class VvVWoodlandArms : WoodlandArms
|
||||
{
|
||||
public override int BasePhysicalResistance { get { return 15; } }
|
||||
public override int BaseFireResistance { get { return 6; } }
|
||||
public override int BaseColdResistance { get { return 17; } }
|
||||
public override int BasePoisonResistance { get { return 18; } }
|
||||
public override int BaseEnergyResistance { get { return 18; } }
|
||||
|
||||
public override int InitMinHits { get { return 255; } }
|
||||
public override int InitMaxHits { get { return 255; } }
|
||||
|
||||
public VvVWoodlandArms()
|
||||
{
|
||||
Attributes.BonusDex = 4;
|
||||
Attributes.BonusHits = 5;
|
||||
Attributes.BonusStam = 10;
|
||||
Attributes.RegenStam = 3;
|
||||
}
|
||||
|
||||
public VvVWoodlandArms(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(1);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
|
||||
if (version == 0)
|
||||
Timer.DelayCall(() => ViceVsVirtueSystem.Instance.AddVvVItem(this));
|
||||
}
|
||||
}
|
||||
|
||||
public class VvVDragonArms : DragonArms
|
||||
{
|
||||
public override int BasePhysicalResistance { get { return 15; } }
|
||||
public override int BaseFireResistance { get { return 6; } }
|
||||
public override int BaseColdResistance { get { return 17; } }
|
||||
public override int BasePoisonResistance { get { return 18; } }
|
||||
public override int BaseEnergyResistance { get { return 18; } }
|
||||
|
||||
public override int InitMinHits { get { return 255; } }
|
||||
public override int InitMaxHits { get { return 255; } }
|
||||
|
||||
public VvVDragonArms()
|
||||
{
|
||||
Attributes.BonusDex = 4;
|
||||
Attributes.BonusHits = 5;
|
||||
Attributes.BonusStam = 10;
|
||||
Attributes.RegenStam = 3;
|
||||
}
|
||||
|
||||
public VvVDragonArms(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(1);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if (version == 0)
|
||||
Timer.DelayCall(() => ViceVsVirtueSystem.Instance.AddVvVItem(this));
|
||||
}
|
||||
}
|
||||
|
||||
public class VvVGargishPlateArms : GargishPlateArms
|
||||
{
|
||||
public override int BasePhysicalResistance { get { return 15; } }
|
||||
public override int BaseFireResistance { get { return 6; } }
|
||||
public override int BaseColdResistance { get { return 17; } }
|
||||
public override int BasePoisonResistance { get { return 18; } }
|
||||
public override int BaseEnergyResistance { get { return 18; } }
|
||||
|
||||
public override int InitMinHits { get { return 255; } }
|
||||
public override int InitMaxHits { get { return 255; } }
|
||||
|
||||
public VvVGargishPlateArms()
|
||||
{
|
||||
Attributes.BonusDex = 4;
|
||||
Attributes.BonusHits = 5;
|
||||
Attributes.BonusStam = 10;
|
||||
Attributes.RegenStam = 3;
|
||||
}
|
||||
|
||||
public VvVGargishPlateArms(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(1);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if (version == 0)
|
||||
Timer.DelayCall(() => ViceVsVirtueSystem.Instance.AddVvVItem(this));
|
||||
}
|
||||
}
|
||||
|
||||
public class VvVPlateArms : PlateArms
|
||||
{
|
||||
public override int BasePhysicalResistance { get { return 15; } }
|
||||
public override int BaseFireResistance { get { return 6; } }
|
||||
public override int BaseColdResistance { get { return 17; } }
|
||||
public override int BasePoisonResistance { get { return 18; } }
|
||||
public override int BaseEnergyResistance { get { return 18; } }
|
||||
|
||||
public override int InitMinHits { get { return 255; } }
|
||||
public override int InitMaxHits { get { return 255; } }
|
||||
|
||||
public VvVPlateArms()
|
||||
{
|
||||
Resource = CraftResource.None;
|
||||
|
||||
Attributes.BonusDex = 4;
|
||||
Attributes.BonusHits = 5;
|
||||
Attributes.BonusStam = 10;
|
||||
Attributes.RegenStam = 3;
|
||||
}
|
||||
|
||||
public VvVPlateArms(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(1);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if (version == 0)
|
||||
Timer.DelayCall(() => ViceVsVirtueSystem.Instance.AddVvVItem(this));
|
||||
}
|
||||
}
|
||||
}
|
||||
90
Scripts/Services/ViceVsVirtue/Items/Rewards/VvVChests.cs
Normal file
90
Scripts/Services/ViceVsVirtue/Items/Rewards/VvVChests.cs
Normal file
@@ -0,0 +1,90 @@
|
||||
using System;
|
||||
using Server;
|
||||
using System.Collections.Generic;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
public class VvVGargishStoneChest : GargishStoneChest
|
||||
{
|
||||
public override int BasePhysicalResistance { get { return 17; } }
|
||||
public override int BaseFireResistance { get { return 19; } }
|
||||
public override int BaseColdResistance { get { return 18; } }
|
||||
public override int BasePoisonResistance { get { return 3; } }
|
||||
public override int BaseEnergyResistance { get { return 6; } }
|
||||
|
||||
public override int InitMinHits { get { return 255; } }
|
||||
public override int InitMaxHits { get { return 255; } }
|
||||
|
||||
public VvVGargishStoneChest()
|
||||
{
|
||||
AbsorptionAttributes.EaterEnergy = 15;
|
||||
Attributes.BonusStr = 3;
|
||||
Attributes.BonusStam = 10;
|
||||
Attributes.RegenStam = 3;
|
||||
}
|
||||
|
||||
public VvVGargishStoneChest(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(1);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
|
||||
if (version == 0)
|
||||
Timer.DelayCall(() => ViceVsVirtueSystem.Instance.AddVvVItem(this));
|
||||
}
|
||||
}
|
||||
|
||||
public class VvVStuddedChest : StuddedChest
|
||||
{
|
||||
public override int BasePhysicalResistance { get { return 17; } }
|
||||
public override int BaseFireResistance { get { return 19; } }
|
||||
public override int BaseColdResistance { get { return 18; } }
|
||||
public override int BasePoisonResistance { get { return 3; } }
|
||||
public override int BaseEnergyResistance { get { return 6; } }
|
||||
|
||||
public override int InitMinHits { get { return 255; } }
|
||||
public override int InitMaxHits { get { return 255; } }
|
||||
|
||||
public VvVStuddedChest()
|
||||
{
|
||||
AbsorptionAttributes.EaterEnergy = 15;
|
||||
Attributes.BonusStr = 3;
|
||||
Attributes.BonusStam = 10;
|
||||
Attributes.RegenStam = 3;
|
||||
}
|
||||
|
||||
public VvVStuddedChest(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(1);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
|
||||
if (version == 0)
|
||||
Timer.DelayCall(() => ViceVsVirtueSystem.Instance.AddVvVItem(this));
|
||||
}
|
||||
}
|
||||
}
|
||||
72
Scripts/Services/ViceVsVirtue/Items/Rewards/VvVEpaulettes.cs
Normal file
72
Scripts/Services/ViceVsVirtue/Items/Rewards/VvVEpaulettes.cs
Normal file
@@ -0,0 +1,72 @@
|
||||
using System;
|
||||
using Server;
|
||||
using System.Collections.Generic;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
public class VvVEpaulette : Epaulette
|
||||
{
|
||||
public override int InitMinHits { get { return 255; } }
|
||||
public override int InitMaxHits { get { return 255; } }
|
||||
|
||||
public VvVEpaulette()
|
||||
{
|
||||
Attributes.AttackChance = 5;
|
||||
}
|
||||
|
||||
public VvVEpaulette(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(1);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
|
||||
if (version == 0)
|
||||
Timer.DelayCall(() => ViceVsVirtueSystem.Instance.AddVvVItem(this));
|
||||
}
|
||||
}
|
||||
|
||||
public class VvVGargishEpaulette : GargishEpaulette
|
||||
{
|
||||
public override int InitMinHits { get { return 255; } }
|
||||
public override int InitMaxHits { get { return 255; } }
|
||||
|
||||
public VvVGargishEpaulette()
|
||||
{
|
||||
Attributes.AttackChance = 5;
|
||||
}
|
||||
|
||||
public VvVGargishEpaulette(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(1);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
|
||||
if (version == 0)
|
||||
Timer.DelayCall(() => ViceVsVirtueSystem.Instance.AddVvVItem(this));
|
||||
}
|
||||
}
|
||||
}
|
||||
72
Scripts/Services/ViceVsVirtue/Items/Rewards/VvVHairDye.cs
Normal file
72
Scripts/Services/ViceVsVirtue/Items/Rewards/VvVHairDye.cs
Normal file
@@ -0,0 +1,72 @@
|
||||
using System;
|
||||
using Server;
|
||||
using System.Collections.Generic;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
public class VvVHairDye : Item
|
||||
{
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.Hue == ViceVsVirtueSystem.VirtueHue)
|
||||
return 1155538;
|
||||
|
||||
return 1155539;
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public VvVHairDye(int hue)
|
||||
: base(3838)
|
||||
{
|
||||
Hue = hue;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile m)
|
||||
{
|
||||
if (IsChildOf(m.Backpack))
|
||||
{
|
||||
if (ViceVsVirtueSystem.IsVvV(m))
|
||||
{
|
||||
m.HairHue = this.Hue;
|
||||
m.FacialHairHue = this.Hue;
|
||||
|
||||
Delete();
|
||||
m.PlaySound(0x4E);
|
||||
m.SendLocalizedMessage(501199); // You dye your hair
|
||||
}
|
||||
else
|
||||
{
|
||||
m.SendLocalizedMessage(1155496); // This item can only be used by VvV participants!
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
list.Add(1154937); // vvv item
|
||||
}
|
||||
|
||||
public VvVHairDye(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
90
Scripts/Services/ViceVsVirtue/Items/Rewards/VvVHats.cs
Normal file
90
Scripts/Services/ViceVsVirtue/Items/Rewards/VvVHats.cs
Normal file
@@ -0,0 +1,90 @@
|
||||
using System;
|
||||
using Server;
|
||||
using System.Collections.Generic;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
public class VvVWizardsHat : WizardsHat
|
||||
{
|
||||
public override int BasePhysicalResistance { get { return 6; } }
|
||||
public override int BaseFireResistance { get { return 6; } }
|
||||
public override int BaseColdResistance { get { return 6; } }
|
||||
public override int BasePoisonResistance { get { return 6; } }
|
||||
public override int BaseEnergyResistance { get { return 25; } }
|
||||
|
||||
public override int InitMinHits { get { return 255; } }
|
||||
public override int InitMaxHits { get { return 255; } }
|
||||
|
||||
public VvVWizardsHat()
|
||||
{
|
||||
Attributes.BonusHits = 5;
|
||||
Attributes.RegenMana = 3;
|
||||
Attributes.DefendChance = 4;
|
||||
Attributes.SpellDamage = 10;
|
||||
Attributes.LowerRegCost = 20;
|
||||
}
|
||||
|
||||
public VvVWizardsHat(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(1);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if (version == 0)
|
||||
Timer.DelayCall(() => ViceVsVirtueSystem.Instance.AddVvVItem(this));
|
||||
}
|
||||
}
|
||||
|
||||
public class VvVGargishEarrings : GargishEarrings
|
||||
{
|
||||
public override int BasePhysicalResistance { get { return 6; } }
|
||||
public override int BaseFireResistance { get { return 6; } }
|
||||
public override int BaseColdResistance { get { return 6; } }
|
||||
public override int BasePoisonResistance { get { return 6; } }
|
||||
public override int BaseEnergyResistance { get { return 25; } }
|
||||
|
||||
public override int InitMinHits { get { return 255; } }
|
||||
public override int InitMaxHits { get { return 255; } }
|
||||
|
||||
public VvVGargishEarrings()
|
||||
{
|
||||
Attributes.BonusHits = 5;
|
||||
Attributes.RegenMana = 3;
|
||||
Attributes.DefendChance = 4;
|
||||
Attributes.SpellDamage = 10;
|
||||
Attributes.LowerRegCost = 20;
|
||||
}
|
||||
|
||||
public VvVGargishEarrings(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(1);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if (version == 0)
|
||||
Timer.DelayCall(() => ViceVsVirtueSystem.Instance.AddVvVItem(this));
|
||||
}
|
||||
}
|
||||
}
|
||||
614
Scripts/Services/ViceVsVirtue/Items/Rewards/VvVPotions.cs
Normal file
614
Scripts/Services/ViceVsVirtue/Items/Rewards/VvVPotions.cs
Normal file
@@ -0,0 +1,614 @@
|
||||
using Server;
|
||||
using System;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using System.Collections.Generic;
|
||||
using Server.Factions;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
public enum PotionType
|
||||
{
|
||||
None = 0x0,
|
||||
AntiParalysis = 0x1,
|
||||
Supernova = 0x2,
|
||||
StatLossRemoval = 0x4,
|
||||
GreaterStamina = 0x8,
|
||||
}
|
||||
|
||||
public class VvVPotionKeg : Item
|
||||
{
|
||||
private PotionType _PotionType;
|
||||
private int _Charges;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public PotionType PotionType { get { return _PotionType; } set { _PotionType = value; InvalidateProperties(); } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Charges { get { return _Charges; } set { _Charges = value; if (_Charges <= 0) Delete(); else InvalidateProperties(); } }
|
||||
|
||||
public override double DefaultWeight
|
||||
{
|
||||
get
|
||||
{
|
||||
return 10 + _Charges * 1.8;
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public VvVPotionKeg(PotionType type)
|
||||
: base(6870)
|
||||
{
|
||||
PotionType = type;
|
||||
Charges = 10;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
default:
|
||||
case PotionType.AntiParalysis: Hue = 2543; break;
|
||||
case PotionType.Supernova: Hue = 13; break;
|
||||
case PotionType.StatLossRemoval: Hue = 2500; break;
|
||||
case PotionType.GreaterStamina: Hue = 437; break;
|
||||
}
|
||||
}
|
||||
|
||||
public override void AddNameProperty(ObjectPropertyList list)
|
||||
{
|
||||
string str;
|
||||
|
||||
switch (_PotionType)
|
||||
{
|
||||
default:
|
||||
case PotionType.AntiParalysis: str = "#1155543"; break;
|
||||
case PotionType.Supernova: str = "#1094718"; break;
|
||||
case PotionType.StatLossRemoval: str = "#1155541"; break;
|
||||
case PotionType.GreaterStamina: str = "#1094764"; break;
|
||||
}
|
||||
|
||||
list.Add(1155535, str); // A Batch of ~1_ITEMS~
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile m)
|
||||
{
|
||||
if (IsChildOf(m.Backpack))
|
||||
{
|
||||
if (!ViceVsVirtueSystem.IsVvV(m))
|
||||
{
|
||||
m.SendLocalizedMessage(1155496); // This item can only be used by VvV participants!
|
||||
}
|
||||
else
|
||||
{
|
||||
Item potion = null;
|
||||
|
||||
switch (_PotionType)
|
||||
{
|
||||
case PotionType.AntiParalysis: potion = new AntiParalysisPotion(); break;
|
||||
case PotionType.Supernova: potion = new SupernovaPotion(); break;
|
||||
case PotionType.StatLossRemoval: potion = new StatLossRemovalPotion(); break;
|
||||
case PotionType.GreaterStamina: potion = new GreaterStaminaPotion(); break;
|
||||
}
|
||||
|
||||
if (potion != null)
|
||||
{
|
||||
m.SendLocalizedMessage(502242); // You pour some of the keg's contents into an empty bottle...
|
||||
|
||||
if (m.Backpack == null || !m.Backpack.TryDropItem(m, potion, false))
|
||||
{
|
||||
m.SendLocalizedMessage(1155570); // Your backpack could not hold the item. Free up some space and try again.
|
||||
potion.Delete();
|
||||
}
|
||||
else
|
||||
{
|
||||
m.SendLocalizedMessage(502243); // ...and place it into your backpack.
|
||||
m.PlaySound(0x240);
|
||||
|
||||
Charges--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m.SendLocalizedMessage(1042004); // That must be in your pack for you to use it
|
||||
}
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
list.Add(1155569, Charges.ToString()); // Potions: ~1_val~
|
||||
list.Add(1154937); // VvV Item
|
||||
}
|
||||
|
||||
public VvVPotionKeg(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
|
||||
writer.Write((int)PotionType);
|
||||
writer.Write(Charges);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
PotionType = (PotionType)reader.ReadInt();
|
||||
Charges = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class VvVPotion : Item, IFactionItem
|
||||
{
|
||||
#region Factions
|
||||
private FactionItem m_FactionState;
|
||||
|
||||
public FactionItem FactionItemState
|
||||
{
|
||||
get { return m_FactionState; }
|
||||
set
|
||||
{
|
||||
m_FactionState = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
public virtual TimeSpan CooldownDuration { get { return TimeSpan.MinValue; } }
|
||||
public virtual PotionType CooldownType { get { return PotionType.None; } }
|
||||
|
||||
public static Dictionary<Mobile, Dictionary<PotionType, DateTime>> _Cooldown = new Dictionary<Mobile, Dictionary<PotionType, DateTime>>();
|
||||
|
||||
public static void RemoveFromCooldown(Mobile m, PotionType type)
|
||||
{
|
||||
if (_Cooldown.ContainsKey(m) && _Cooldown[m].ContainsKey(type))
|
||||
{
|
||||
_Cooldown[m].Remove(type);
|
||||
|
||||
if (_Cooldown[m].Count == 0)
|
||||
_Cooldown.Remove(m);
|
||||
}
|
||||
}
|
||||
|
||||
public static void CheckCooldown()
|
||||
{
|
||||
List<Mobile> toRemove = new List<Mobile>();
|
||||
|
||||
foreach (KeyValuePair<Mobile, Dictionary<PotionType, DateTime>> kvp in _Cooldown)
|
||||
{
|
||||
List<PotionType> removeTypes = new List<PotionType>();
|
||||
|
||||
foreach (KeyValuePair<PotionType, DateTime> values in kvp.Value)
|
||||
{
|
||||
if (values.Value < DateTime.UtcNow)
|
||||
removeTypes.Add(values.Key);
|
||||
}
|
||||
|
||||
foreach (PotionType t in removeTypes)
|
||||
kvp.Value.Remove(t);
|
||||
|
||||
if (kvp.Value.Count == 0)
|
||||
toRemove.Add(kvp.Key);
|
||||
|
||||
removeTypes.Clear();
|
||||
removeTypes.TrimExcess();
|
||||
}
|
||||
|
||||
foreach (Mobile mob in toRemove)
|
||||
_Cooldown.Remove(mob);
|
||||
|
||||
toRemove.Clear();
|
||||
toRemove.TrimExcess();
|
||||
}
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (CooldownType)
|
||||
{
|
||||
case PotionType.AntiParalysis: return 1155543;
|
||||
case PotionType.Supernova: return 1094718;
|
||||
case PotionType.StatLossRemoval: return 1155541;
|
||||
case PotionType.GreaterStamina: return 1094764;
|
||||
}
|
||||
|
||||
return base.LabelNumber;
|
||||
}
|
||||
}
|
||||
|
||||
public VvVPotion()
|
||||
: base(3849)
|
||||
{
|
||||
Stackable = true;
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (!FactionEquipment.AddFactionProperties(this, list))
|
||||
{
|
||||
list.Add(1154937); // VvV Item
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsInCooldown(Mobile m, ref DateTime dt)
|
||||
{
|
||||
if (_Cooldown.ContainsKey(m))
|
||||
{
|
||||
if (_Cooldown[m].ContainsKey(PotionType.GreaterStamina))
|
||||
{
|
||||
dt = _Cooldown[m][PotionType.GreaterStamina];
|
||||
|
||||
if (dt < DateTime.UtcNow)
|
||||
{
|
||||
RemoveFromCooldown(m, PotionType.GreaterStamina);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if (_Cooldown[m].ContainsKey(CooldownType))
|
||||
{
|
||||
dt = _Cooldown[m][CooldownType];
|
||||
|
||||
if (dt < DateTime.UtcNow)
|
||||
{
|
||||
RemoveFromCooldown(m, CooldownType);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void AddToCooldown(Mobile m)
|
||||
{
|
||||
if (!_Cooldown.ContainsKey(m))
|
||||
_Cooldown[m] = new Dictionary<PotionType, DateTime>();
|
||||
|
||||
_Cooldown[m][CooldownType] = DateTime.UtcNow + CooldownDuration;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile m)
|
||||
{
|
||||
if (!Movable)
|
||||
return;
|
||||
|
||||
if (IsChildOf(m.Backpack))
|
||||
{
|
||||
DateTime dt = DateTime.UtcNow;
|
||||
|
||||
if (ViceVsVirtueSystem.Enabled && !ViceVsVirtueSystem.IsVvV(m))
|
||||
{
|
||||
m.SendLocalizedMessage(1155496); // This item can only be used by VvV participants!
|
||||
}
|
||||
else if (Server.Factions.Settings.Enabled && !FactionEquipment.CanUse(this, m))
|
||||
{
|
||||
}
|
||||
else if (!BasePotion.HasFreeHand(m))
|
||||
{
|
||||
m.SendLocalizedMessage(502172); // You must have a free hand to drink a potion.
|
||||
}
|
||||
else if (IsInCooldown(m, ref dt))
|
||||
{
|
||||
TimeSpan left = dt - DateTime.UtcNow;
|
||||
|
||||
if (left.TotalMinutes > 2)
|
||||
{
|
||||
m.SendLocalizedMessage(1114110, ((int)left.TotalMinutes).ToString()); // You must wait ~1_minutes~ minutes before using another one of these.
|
||||
}
|
||||
else
|
||||
{
|
||||
m.SendLocalizedMessage(1114109, ((int)left.TotalSeconds).ToString()); // You must wait ~1_seconds~ seconds before using another one of these.
|
||||
}
|
||||
}
|
||||
else if (CheckUse(m))
|
||||
{
|
||||
UseEffects(m);
|
||||
Use(m);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m.SendLocalizedMessage(1042004); // That must be in your pack for you to use it
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool CheckUse(Mobile m)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public abstract void Use(Mobile m);
|
||||
|
||||
public virtual void UseEffects(Mobile m)
|
||||
{
|
||||
m.RevealingAction();
|
||||
m.PlaySound(0x2D6);
|
||||
|
||||
if (m.Body.IsHuman && !m.Mounted)
|
||||
m.Animate(34, 5, 1, true, false, 0);
|
||||
|
||||
if (CooldownDuration != TimeSpan.MinValue)
|
||||
{
|
||||
AddToCooldown(m);
|
||||
}
|
||||
|
||||
Timer.DelayCall<Mobile>(TimeSpan.FromMilliseconds(500), DrinkEffects, m);
|
||||
}
|
||||
|
||||
public virtual void DrinkEffects(Mobile m)
|
||||
{
|
||||
}
|
||||
|
||||
public VvVPotion(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class AntiParalysisPotion : VvVPotion
|
||||
{
|
||||
public override PotionType CooldownType { get { return PotionType.AntiParalysis; } }
|
||||
|
||||
[Constructable]
|
||||
public AntiParalysisPotion()
|
||||
{
|
||||
Hue = 2543;
|
||||
}
|
||||
|
||||
public override bool CheckUse(Mobile m)
|
||||
{
|
||||
if (!m.Paralyzed)
|
||||
{
|
||||
m.SendLocalizedMessage(1155544); // You are not currently paralyzed
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void Use(Mobile m)
|
||||
{
|
||||
m.Paralyzed = false;
|
||||
m.Stam /= 2;
|
||||
|
||||
Consume();
|
||||
}
|
||||
|
||||
public override void DrinkEffects(Mobile m)
|
||||
{
|
||||
m.FixedEffect(0x375A, 10, 15);
|
||||
m.PlaySound(0x1E7);
|
||||
}
|
||||
|
||||
public AntiParalysisPotion(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class SupernovaPotion : VvVPotion
|
||||
{
|
||||
public override TimeSpan CooldownDuration { get { return TimeSpan.FromMinutes(2); } }
|
||||
public override PotionType CooldownType { get { return PotionType.Supernova; } }
|
||||
|
||||
[Constructable]
|
||||
public SupernovaPotion()
|
||||
{
|
||||
Hue = 13;
|
||||
}
|
||||
|
||||
public override void Use(Mobile m)
|
||||
{
|
||||
Effects.SendMovingEffect(m, new Entity(Serial.Zero, new Point3D(m.X, m.Y, m.Z + 25), m.Map), this.ItemID, 3, 0, false, false, this.Hue, 0);
|
||||
|
||||
int count = 5;
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(1), () =>
|
||||
{
|
||||
m.PlaySound(0x1DD);
|
||||
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
Timer.DelayCall(TimeSpan.FromMilliseconds(i * 170), index =>
|
||||
{
|
||||
Server.Misc.Geometry.Circle2D(m.Location, m.Map, index, (pnt, map) =>
|
||||
{
|
||||
Effects.SendLocationEffect(pnt, map, 0x3709, 30, 10, 0, 5);
|
||||
});
|
||||
}, i);
|
||||
}
|
||||
});
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromMilliseconds(170 * count), () =>
|
||||
{
|
||||
IPooledEnumerable eable = m.Map.GetMobilesInRange(m.Location, count);
|
||||
|
||||
foreach (Mobile mob in eable)
|
||||
{
|
||||
if (mob != m && Server.Spells.SpellHelper.ValidIndirectTarget(m, mob) && m.CanBeHarmful(mob, false))
|
||||
{
|
||||
m.DoHarmful(mob);
|
||||
AOS.Damage(mob, m, Utility.RandomMinMax(40, 60), 0, 100, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
eable.Free();
|
||||
});
|
||||
|
||||
if (m.AccessLevel == AccessLevel.Player)
|
||||
Consume();
|
||||
}
|
||||
|
||||
public override void UseEffects(Mobile m)
|
||||
{
|
||||
AddToCooldown(m);
|
||||
}
|
||||
|
||||
public SupernovaPotion(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class StatLossRemovalPotion : VvVPotion
|
||||
{
|
||||
public override TimeSpan CooldownDuration { get { return TimeSpan.FromMinutes(20); } }
|
||||
public override PotionType CooldownType { get { return PotionType.StatLossRemoval; } }
|
||||
|
||||
[Constructable]
|
||||
public StatLossRemovalPotion()
|
||||
{
|
||||
Hue = 2500;
|
||||
}
|
||||
|
||||
public override bool CheckUse(Mobile m)
|
||||
{
|
||||
if (!Server.Factions.Faction.InSkillLoss(m))
|
||||
{
|
||||
m.SendLocalizedMessage(1155542); // You are not currently under the effects of stat loss.
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void Use(Mobile m)
|
||||
{
|
||||
m.SendLocalizedMessage(1155540); // You feel the effects of your stat loss fade.
|
||||
Server.Factions.Faction.ClearSkillLoss(m);
|
||||
|
||||
Consume();
|
||||
}
|
||||
|
||||
public override void DrinkEffects(Mobile m)
|
||||
{
|
||||
m.PlaySound(0xF6);
|
||||
m.PlaySound(0x1F7);
|
||||
m.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head);
|
||||
}
|
||||
|
||||
public StatLossRemovalPotion(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class GreaterStaminaPotion : VvVPotion
|
||||
{
|
||||
public override TimeSpan CooldownDuration { get { return TimeSpan.FromSeconds(10); } }
|
||||
public override PotionType CooldownType { get { return PotionType.GreaterStamina; } }
|
||||
|
||||
[Constructable]
|
||||
public GreaterStaminaPotion()
|
||||
{
|
||||
Hue = 437;
|
||||
}
|
||||
|
||||
public override bool CheckUse(Mobile m)
|
||||
{
|
||||
//TODO: Message? Stam check?
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void Use(Mobile m)
|
||||
{
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(1), 10, () =>
|
||||
{
|
||||
int gain = Utility.RandomMinMax(10, 13);
|
||||
|
||||
if (m.Stam + gain > m.StamMax)
|
||||
gain = m.StamMax - m.Stam;
|
||||
|
||||
m.FixedParticles(0x376A, 9, 32, 5005, EffectLayer.Waist);
|
||||
m.Stam += gain;
|
||||
});
|
||||
|
||||
Consume();
|
||||
}
|
||||
|
||||
public override void DrinkEffects(Mobile m)
|
||||
{
|
||||
m.FixedEffect(0x375A, 10, 15);
|
||||
m.PlaySound(0x1E7);
|
||||
}
|
||||
|
||||
public GreaterStaminaPotion(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
51
Scripts/Services/ViceVsVirtue/Items/Rewards/VvVRobe.cs
Normal file
51
Scripts/Services/ViceVsVirtue/Items/Rewards/VvVRobe.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using Server;
|
||||
using System.Collections.Generic;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
public class VvVRobe : BaseOuterTorso
|
||||
{
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.Hue == ViceVsVirtueSystem.VirtueHue)
|
||||
return 1155532;
|
||||
|
||||
if (this.Hue == ViceVsVirtueSystem.ViceHue)
|
||||
return 1155533;
|
||||
|
||||
return base.LabelNumber;
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public VvVRobe(int hue)
|
||||
: base(0x2684, hue)
|
||||
{
|
||||
}
|
||||
|
||||
public VvVRobe(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(1);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if (version == 0)
|
||||
Timer.DelayCall(() => ViceVsVirtueSystem.Instance.AddVvVItem(this));
|
||||
}
|
||||
}
|
||||
}
|
||||
329
Scripts/Services/ViceVsVirtue/Items/Rewards/VvVSteeds.cs
Normal file
329
Scripts/Services/ViceVsVirtue/Items/Rewards/VvVSteeds.cs
Normal file
@@ -0,0 +1,329 @@
|
||||
using Server;
|
||||
using System;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
public enum SteedType
|
||||
{
|
||||
Ostard,
|
||||
WarHorse
|
||||
}
|
||||
|
||||
public class VvVSteedStatuette : BaseImprisonedMobile
|
||||
{
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public SteedType SteedType { get; set; }
|
||||
|
||||
public override BaseCreature Summon
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (this.SteedType)
|
||||
{
|
||||
default:
|
||||
case SteedType.Ostard: return new VvVMount("a war ostard", 0xDA, 0x3EA4, this.Hue);
|
||||
case SteedType.WarHorse: return new VvVMount("a war horse", 0xE2, 0x3EA0, this.Hue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public VvVSteedStatuette(SteedType mounttype, int hue)
|
||||
: base(mounttype == SteedType.Ostard ? 8501 : 8484)
|
||||
{
|
||||
Hue = hue;
|
||||
SteedType = mounttype;
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
list.Add(1154937); // vvv item
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile m)
|
||||
{
|
||||
if (!ViceVsVirtueSystem.IsVvV(m))
|
||||
{
|
||||
m.SendLocalizedMessage(1155496); // This item can only be used by VvV participants!
|
||||
return;
|
||||
}
|
||||
|
||||
base.OnDoubleClick(m);
|
||||
}
|
||||
|
||||
public VvVSteedStatuette(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
|
||||
writer.Write((int)SteedType);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
SteedType = (SteedType)reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class VvVMount : BaseMount
|
||||
{
|
||||
private int _Readiness;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int BattleReadiness
|
||||
{
|
||||
get { return _Readiness; }
|
||||
set
|
||||
{
|
||||
int old = _Readiness;
|
||||
_Readiness = value;
|
||||
|
||||
if(_Readiness > 20)
|
||||
_Readiness = 20;
|
||||
|
||||
if(old != value && ControlMaster != null && ControlMaster.NetState != null)
|
||||
{
|
||||
int cliloc;
|
||||
|
||||
if(old > value)
|
||||
{
|
||||
if(_Readiness < 5)
|
||||
cliloc = 1155551; // *Your steed's battle readiness is dangerously low!*
|
||||
else
|
||||
cliloc = 1155549; // *Your steed's battle readiness is fading...*
|
||||
}
|
||||
else
|
||||
{
|
||||
if(_Readiness == 20)
|
||||
cliloc = 1155553; // *Your steed is at maximum battle readiness!*
|
||||
else
|
||||
cliloc = 1155552;// *Your steed's battle readiness has increased!*
|
||||
}
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(1), () =>
|
||||
{
|
||||
if(!Deleted && ControlMaster != null)
|
||||
ControlMaster.PrivateOverheadMessage(Server.Network.MessageType.Regular, 1154, cliloc, ControlMaster.NetState);
|
||||
});
|
||||
}
|
||||
|
||||
if(_Readiness <= 0)
|
||||
GoPoof();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public DateTime NextReadinessAtrophy { get; set; }
|
||||
|
||||
public override bool DeleteOnRelease { get { return true; } }
|
||||
|
||||
public VvVMount(string name, int id, int itemid, int hue)
|
||||
: base(name, id, itemid, AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.4, .2)
|
||||
{
|
||||
Hue = hue;
|
||||
|
||||
if(id == 0xDA)
|
||||
BaseSoundID = 0x275;
|
||||
else
|
||||
BaseSoundID = 0xA8;
|
||||
|
||||
this.InitStats(Utility.Random(300, 100), 125, 60);
|
||||
|
||||
SetStr(400);
|
||||
SetDex(125);
|
||||
SetInt(51, 55);
|
||||
|
||||
SetHits(240);
|
||||
SetMana(0);
|
||||
|
||||
SetDamage(5, 8);
|
||||
|
||||
SetDamageType(ResistanceType.Physical, 100);
|
||||
|
||||
SetResistance(ResistanceType.Physical, 40, 50);
|
||||
SetResistance(ResistanceType.Fire, 30, 40);
|
||||
SetResistance(ResistanceType.Cold, 30, 40);
|
||||
SetResistance(ResistanceType.Poison, 30, 40);
|
||||
SetResistance(ResistanceType.Energy, 30, 40);
|
||||
|
||||
SetSkill(SkillName.MagicResist, 25.1, 30.0);
|
||||
SetSkill(SkillName.Tactics, 29.3, 44.0);
|
||||
SetSkill(SkillName.Wrestling, 29.3, 44.0);
|
||||
|
||||
Fame = 300;
|
||||
Karma = 300;
|
||||
|
||||
Tamable = true;
|
||||
ControlSlots = 1;
|
||||
MinTameSkill = 29.1;
|
||||
|
||||
_Readiness = 8;
|
||||
NextReadinessAtrophy = DateTime.UtcNow + TimeSpan.FromHours(24);
|
||||
|
||||
Steeds.Add(this);
|
||||
}
|
||||
|
||||
public void GoPoof()
|
||||
{
|
||||
if(Rider != null)
|
||||
{
|
||||
Rider = null;
|
||||
}
|
||||
|
||||
if(ControlMaster != null && ControlMaster.NetState != null)
|
||||
ControlMaster.PrivateOverheadMessage(Server.Network.MessageType.Regular, 1154, 1155550, ControlMaster.NetState); // *Your steed has depleted it's battle readiness!*
|
||||
|
||||
Delete();
|
||||
}
|
||||
|
||||
public override void OnDeath(Container c)
|
||||
{
|
||||
base.OnDeath(c);
|
||||
|
||||
if (BattleReadiness > 1)
|
||||
BattleReadiness--;
|
||||
}
|
||||
|
||||
public override bool OnDragDrop(Mobile from, Item dropped)
|
||||
{
|
||||
if(from == ControlMaster && dropped is EssenceOfCourage)
|
||||
{
|
||||
EssenceOfCourage ec = dropped as EssenceOfCourage;
|
||||
BattleReadiness += dropped.Amount;
|
||||
|
||||
dropped.Delete();
|
||||
|
||||
if (Body.IsAnimal)
|
||||
{
|
||||
Animate(3, 5, 1, true, false, 0);
|
||||
}
|
||||
else if (Body.IsMonster)
|
||||
{
|
||||
Animate(17, 5, 1, true, false, 0);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return base.OnDragDrop(from, dropped);
|
||||
}
|
||||
|
||||
public override void Delete()
|
||||
{
|
||||
base.Delete();
|
||||
|
||||
Steeds.Remove(this);
|
||||
}
|
||||
|
||||
public override bool CanTransfer(Mobile m)
|
||||
{
|
||||
if (ControlMaster != null && ControlMaster.NetState != null)
|
||||
ControlMaster.SendLocalizedMessage(1155547); // Pets obtained from VvV are non-transferable.
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CanFriend(Mobile m)
|
||||
{
|
||||
if (ControlMaster != null && ControlMaster.NetState != null)
|
||||
ControlMaster.SendLocalizedMessage(1155548); // You may not add friends to a VvV War Steed.
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override int Meat
|
||||
{
|
||||
get
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
|
||||
public override int Hides
|
||||
{
|
||||
get
|
||||
{
|
||||
return 10;
|
||||
}
|
||||
}
|
||||
|
||||
public override FoodType FavoriteFood
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Body == 0xDA)
|
||||
{
|
||||
return FoodType.Meat | FoodType.Fish | FoodType.Eggs | FoodType.FruitsAndVegies;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FoodType.FruitsAndVegies | FoodType.GrainsAndHay;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public VvVMount(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
|
||||
writer.Write(_Readiness);
|
||||
writer.Write(NextReadinessAtrophy);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
_Readiness = reader.ReadInt();
|
||||
NextReadinessAtrophy = reader.ReadDateTime();
|
||||
|
||||
Steeds.Add(this);
|
||||
}
|
||||
|
||||
public static List<VvVMount> Steeds { get; set; }
|
||||
|
||||
public static void Configure()
|
||||
{
|
||||
Steeds = new List<VvVMount>();
|
||||
}
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
Timer.DelayCall(TimeSpan.FromMinutes(10), TimeSpan.FromMinutes(10), () =>
|
||||
{
|
||||
List<VvVMount> steeds = new List<VvVMount>(Steeds);
|
||||
|
||||
steeds.ForEach(s =>
|
||||
{
|
||||
if((s.Map != Map.Internal || (s.Rider != null && s.Rider.Map != Map.Internal)) && s.NextReadinessAtrophy < DateTime.UtcNow)
|
||||
{
|
||||
s.BattleReadiness--;
|
||||
|
||||
if(!s.Deleted)
|
||||
s.NextReadinessAtrophy = DateTime.UtcNow + TimeSpan.FromHours(24);
|
||||
}
|
||||
});
|
||||
|
||||
steeds.Clear();
|
||||
steeds.TrimExcess();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
253
Scripts/Services/ViceVsVirtue/Items/Rewards/VvVTrapKit.cs
Normal file
253
Scripts/Services/ViceVsVirtue/Items/Rewards/VvVTrapKit.cs
Normal file
@@ -0,0 +1,253 @@
|
||||
using Server;
|
||||
using System;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using System.Collections.Generic;
|
||||
using Server.Targeting;
|
||||
using Server.ContextMenus;
|
||||
using System.Linq;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
public class VvVTrapKit : Item
|
||||
{
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public DeploymentType DeploymentType { get; set;}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public VvVTrapType TrapType { get; set; }
|
||||
|
||||
public override int LabelNumber { get { return 1154944; } } // Trap Kit
|
||||
|
||||
private static Dictionary<Mobile, DateTime> _Cooldown = new Dictionary<Mobile, DateTime>();
|
||||
|
||||
[Constructable]
|
||||
public VvVTrapKit(VvVTrapType type) : base(7866)
|
||||
{
|
||||
TrapType = type;
|
||||
DeploymentType = DeploymentType.Proximaty;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
CheckCooldown();
|
||||
|
||||
if(IsChildOf(from.Backpack))
|
||||
{
|
||||
ViceVsVirtueSystem sys = ViceVsVirtueSystem.Instance;
|
||||
|
||||
if(sys != null)
|
||||
{
|
||||
if(!ViceVsVirtueSystem.IsVvV(from))
|
||||
{
|
||||
from.SendLocalizedMessage(1155415); // Only participants in Vice vs Virtue may use this item.
|
||||
}
|
||||
else if(!sys.Battle.OnGoing || !from.Region.IsPartOf(sys.Battle.Region))
|
||||
{
|
||||
from.SendLocalizedMessage(1155406); // This item can only be used in an active VvV battle region!
|
||||
}
|
||||
else if (sys.Battle.TrapCount >= VvVBattle.MaxTraps)
|
||||
{
|
||||
from.SendLocalizedMessage(1155407); // The trap limit for this battle has been reached!
|
||||
}
|
||||
else if (_Cooldown != null && _Cooldown.ContainsKey(from))
|
||||
{
|
||||
from.SendLocalizedMessage(1155408); // You must wait a few moments before attempting to place another trap.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1155409); // Where do you want to place the trap?
|
||||
from.BeginTarget(2, true, Server.Targeting.TargetFlags.None, (m, targeted) =>
|
||||
{
|
||||
IPoint3D p = targeted as IPoint3D;
|
||||
|
||||
if(p != null)
|
||||
{
|
||||
if (!sys.Battle.OnGoing || !m.Region.IsPartOf(sys.Battle.Region))
|
||||
{
|
||||
m.SendLocalizedMessage(1155406); // This item can only be used in an active VvV battle region!
|
||||
}
|
||||
else if (sys.Battle.Traps.Count >= VvVBattle.MaxTraps)
|
||||
{
|
||||
m.SendLocalizedMessage(1155407); // The trap limit for this battle has been reached!
|
||||
}
|
||||
else if (!from.InLOS(p))
|
||||
{
|
||||
m.SendLocalizedMessage(1042261); // You cannot place the trap there.
|
||||
}
|
||||
else
|
||||
{
|
||||
TryDeployTrap(m, new Point3D(p));
|
||||
}
|
||||
}
|
||||
else
|
||||
m.SendLocalizedMessage(1042261); // You cannot place the trap there.
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1042004); // That must be in your pack for you to use it
|
||||
}
|
||||
}
|
||||
|
||||
public void TryDeployTrap(Mobile m, Point3D trapLocation)
|
||||
{
|
||||
VvVTrap trap = null;
|
||||
|
||||
if(this.DeploymentType == DeploymentType.Tripwire)
|
||||
{
|
||||
m.SendLocalizedMessage(1155410); // Target the location to run the tripwire...
|
||||
m.BeginTarget(5, true, TargetFlags.None, (from, targeted) =>
|
||||
{
|
||||
IPoint3D p = targeted as IPoint3D;
|
||||
|
||||
if(p != null)
|
||||
{
|
||||
Point3D point = new Point3D(p);
|
||||
|
||||
//TODO: Rules? For now, must be within 3 tiles of trap
|
||||
if (!Utility.InRange(point, trapLocation, 3) || point == trapLocation)
|
||||
{
|
||||
m.SendLocalizedMessage(1011577); // This is an invalid location.
|
||||
}
|
||||
else
|
||||
{
|
||||
trap = ConstructTrap(m);
|
||||
|
||||
if (!trap.SetTripwire(this, trapLocation, point, m.Map))
|
||||
{
|
||||
trap.Delete();
|
||||
m.SendLocalizedMessage(1042261); // You cannot place the trap there.
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
m.PrivateOverheadMessage(Server.Network.MessageType.Regular, 1154, 1155411, m.NetState); // *You successfully lay the tripwire*
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m.SendLocalizedMessage(1042261); // You cannot place the trap there.
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
m.PrivateOverheadMessage(Server.Network.MessageType.Regular, 1154, 1155412, m.NetState); // *You successfully set the trap*
|
||||
trap = ConstructTrap(m);
|
||||
}
|
||||
|
||||
if(trap != null)
|
||||
{
|
||||
trap.MoveToWorld(trapLocation, m.Map);
|
||||
Delete();
|
||||
|
||||
ViceVsVirtueSystem.Instance.Battle.Traps.Add(trap);
|
||||
|
||||
AddToCooldown(m);
|
||||
}
|
||||
}
|
||||
|
||||
private void AddToCooldown(Mobile m)
|
||||
{
|
||||
_Cooldown[m] = DateTime.UtcNow + TimeSpan.FromSeconds(30);
|
||||
}
|
||||
|
||||
private void CheckCooldown()
|
||||
{
|
||||
if(_Cooldown.Count == 0)
|
||||
return;
|
||||
|
||||
List<Mobile> mobs = new List<Mobile>(_Cooldown.Keys);
|
||||
|
||||
foreach(Mobile m in mobs.Where(mob => _Cooldown[mob] < DateTime.UtcNow))
|
||||
{
|
||||
_Cooldown.Remove(m);
|
||||
}
|
||||
|
||||
mobs.Clear();
|
||||
mobs.TrimExcess();
|
||||
}
|
||||
|
||||
public VvVTrap ConstructTrap(Mobile m)
|
||||
{
|
||||
switch(this.TrapType)
|
||||
{
|
||||
case VvVTrapType.Explosion: return new VvVExplosionTrap(m, this.DeploymentType);
|
||||
case VvVTrapType.Poison: return new VvVPoisonTrap(m, this.DeploymentType);
|
||||
case VvVTrapType.Cold: return new VvVColdTrap(m, this.DeploymentType);
|
||||
case VvVTrapType.Energy: return new VvVEnergyTrap(m, this.DeploymentType);
|
||||
case VvVTrapType.Blade: return new VvVBladeTrap(m, this.DeploymentType);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public override void GetContextMenuEntries(Mobile m, List<ContextMenuEntry> list)
|
||||
{
|
||||
list.Add(new InternalEntry(this, m));
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
list.Add(1154938, String.Format("#{0}", ((int)this.DeploymentType).ToString())); // Deployment Type: ~1_DEPLOYTYPE~
|
||||
list.Add(1154941, String.Format("#{0}", ((int)this.TrapType).ToString())); // Damage Type: ~1_DMGTYPE~
|
||||
list.Add(1154937); // VvV Item
|
||||
}
|
||||
|
||||
private class InternalEntry : ContextMenuEntry
|
||||
{
|
||||
public VvVTrapKit Deed { get; set; }
|
||||
public Mobile Clicker { get; set; }
|
||||
|
||||
public InternalEntry(VvVTrapKit deed, Mobile m)
|
||||
: base(1155514, -1)
|
||||
{
|
||||
Deed = deed;
|
||||
Clicker = m;
|
||||
|
||||
if (!Deed.IsChildOf(m.Backpack))
|
||||
Enabled = false;
|
||||
}
|
||||
|
||||
public override void OnClick()
|
||||
{
|
||||
if (Deed.DeploymentType == DeploymentType.Proximaty)
|
||||
Deed.DeploymentType = DeploymentType.Tripwire;
|
||||
else
|
||||
Deed.DeploymentType = DeploymentType.Proximaty;
|
||||
|
||||
Deed.InvalidateProperties();
|
||||
|
||||
Clicker.PrivateOverheadMessage(Server.Network.MessageType.Regular, 1154, 1155515, Clicker.NetState); // *You adjust the deployment mechanism*
|
||||
}
|
||||
}
|
||||
|
||||
public VvVTrapKit(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
|
||||
writer.Write((int)DeploymentType);
|
||||
writer.Write((int)TrapType);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
DeploymentType = (DeploymentType)reader.ReadInt();
|
||||
TrapType = (VvVTrapType)reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
457
Scripts/Services/ViceVsVirtue/Items/Rewards/VvVTraps.cs
Normal file
457
Scripts/Services/ViceVsVirtue/Items/Rewards/VvVTraps.cs
Normal file
@@ -0,0 +1,457 @@
|
||||
using Server;
|
||||
using System;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using System.Collections.Generic;
|
||||
using Server.Spells;
|
||||
using Server.Spells.Necromancy;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
public enum VvVTrapType
|
||||
{
|
||||
Explosion = 1015027, // Explosion
|
||||
Poison = 1028000, // Poison
|
||||
Cold = 1113466, // Freezing
|
||||
Energy = 1154942, // Shocking
|
||||
Blade = 1154943, // Blades
|
||||
}
|
||||
|
||||
public enum DeploymentType
|
||||
{
|
||||
Proximaty = 1154939,
|
||||
Tripwire = 1154940
|
||||
}
|
||||
|
||||
public class VvVTrap : Item, IRevealableItem
|
||||
{
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Mobile Owner { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public DeploymentType DeploymentType { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public VvVTrap ParentTrap { get; set; }
|
||||
|
||||
public List<VvVTrap> Links { get; set; }
|
||||
|
||||
public override bool HandlesOnMovement { get { return true; } }
|
||||
public bool CheckWhenHidden { get { return true; } }
|
||||
|
||||
public virtual int MinDamage { get { return 0; } }
|
||||
public virtual int MaxDamage { get { return 0; } }
|
||||
public virtual VvVTrapType TrapType { get { return VvVTrapType.Explosion; } }
|
||||
|
||||
public static int HiddenID = 8600;
|
||||
public static int VisibleID = 39818;
|
||||
|
||||
public VvVTrap(Mobile owner, DeploymentType type) : base(HiddenID)
|
||||
{
|
||||
Owner = owner;
|
||||
DeploymentType = type;
|
||||
|
||||
Movable = false;
|
||||
Hue = 0x3D8;
|
||||
}
|
||||
|
||||
public bool SetTripwire(VvVTrapKit deed, Point3D myLocation, Point3D wireLocation, Map map)
|
||||
{
|
||||
Links = new List<VvVTrap>();
|
||||
|
||||
MovementPath path = new MovementPath(myLocation, wireLocation, map);
|
||||
int x = myLocation.X;
|
||||
int y = myLocation.Y;
|
||||
|
||||
if(path.Success)
|
||||
{
|
||||
for (int i = 0; i < path.Directions.Length; ++i)
|
||||
{
|
||||
Movement.Movement.Offset(path.Directions[i], ref x, ref y);
|
||||
|
||||
Point3D p = new Point3D(x, y, this.Map.GetAverageZ(x, y));
|
||||
|
||||
if (p == myLocation)
|
||||
continue;
|
||||
|
||||
VvVTrap trap = deed.ConstructTrap(Owner);
|
||||
Links.Add(trap);
|
||||
trap.ParentTrap = this;
|
||||
|
||||
trap.MoveToWorld(p, map);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnMovement(Mobile m, Point3D oldLocation)
|
||||
{
|
||||
if(IsEnemy(m) && DeploymentType == DeploymentType.Proximaty && m.InRange(this.Location, 3) && ViceVsVirtueSystem.IsEnemy(m, Owner))
|
||||
{
|
||||
Detonate(m);
|
||||
}
|
||||
}
|
||||
|
||||
public bool CheckReveal(Mobile m)
|
||||
{
|
||||
if (!ViceVsVirtueSystem.IsVvV(m) || ItemID != VvVTrap.HiddenID)
|
||||
return false;
|
||||
|
||||
return Utility.Random(100) <= m.Skills[SkillName.DetectHidden].Value;
|
||||
}
|
||||
|
||||
public void OnRevealed(Mobile m)
|
||||
{
|
||||
ItemID = VisibleID;
|
||||
|
||||
if (Links != null)
|
||||
{
|
||||
Links.ForEach(l =>
|
||||
{
|
||||
if (!l.Deleted && l.ItemID == HiddenID)
|
||||
l.ItemID = VisibleID;
|
||||
});
|
||||
}
|
||||
|
||||
if (ParentTrap != null)
|
||||
{
|
||||
if (ParentTrap.ItemID == HiddenID)
|
||||
ParentTrap.ItemID = VisibleID;
|
||||
|
||||
ParentTrap.OnRevealed(m);
|
||||
}
|
||||
}
|
||||
|
||||
public bool CheckPassiveDetect(Mobile m)
|
||||
{
|
||||
if (m.InRange(this.Location, 6))
|
||||
{
|
||||
int skill = (int)m.Skills[SkillName.DetectHidden].Value;
|
||||
|
||||
if (skill >= 80 && Utility.Random(600) < skill)
|
||||
this.PrivateOverheadMessage(Server.Network.MessageType.Regular, 0x21, 500813, m.NetState); // [trapped]
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool OnMoveOver(Mobile m)
|
||||
{
|
||||
if(IsEnemy(m))
|
||||
{
|
||||
Detonate(m);
|
||||
}
|
||||
|
||||
return base.OnMoveOver(m);
|
||||
}
|
||||
|
||||
public bool IsEnemy(Mobile m)
|
||||
{
|
||||
if(Owner == null)
|
||||
return true;
|
||||
|
||||
return ViceVsVirtueSystem.IsVvV(m) && ViceVsVirtueSystem.IsVvV(Owner) && ViceVsVirtueSystem.IsEnemy(m, Owner);
|
||||
}
|
||||
|
||||
public virtual void Detonate(Mobile m)
|
||||
{
|
||||
if(Owner != null)
|
||||
Owner.DoHarmful(m);
|
||||
|
||||
Delete();
|
||||
}
|
||||
|
||||
public override void Delete()
|
||||
{
|
||||
base.Delete();
|
||||
|
||||
if (Links != null)
|
||||
{
|
||||
Links.ForEach(l =>
|
||||
{
|
||||
if (!l.Deleted)
|
||||
l.Delete();
|
||||
});
|
||||
}
|
||||
|
||||
if (ParentTrap != null && !ParentTrap.Deleted)
|
||||
ParentTrap.Delete();
|
||||
}
|
||||
|
||||
public VvVTrap(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
|
||||
writer.Write(Owner);
|
||||
writer.Write((int)DeploymentType);
|
||||
|
||||
writer.Write(Links != null ? Links.Count : 0);
|
||||
|
||||
if (Links != null)
|
||||
{
|
||||
Links.ForEach(l => writer.Write(l));
|
||||
}
|
||||
|
||||
writer.Write(ParentTrap);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
Owner = reader.ReadMobile();
|
||||
DeploymentType = (DeploymentType)reader.ReadInt();
|
||||
|
||||
int count = reader.ReadInt();
|
||||
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
if(Links == null)
|
||||
Links = new List<VvVTrap>();
|
||||
|
||||
VvVTrap link = reader.ReadItem() as VvVTrap;
|
||||
|
||||
if (link != null)
|
||||
Links.Add(link);
|
||||
}
|
||||
|
||||
ParentTrap = reader.ReadItem() as VvVTrap;
|
||||
}
|
||||
}
|
||||
|
||||
public class VvVExplosionTrap : VvVTrap
|
||||
{
|
||||
public override int MinDamage { get { return 40; } }
|
||||
public override int MaxDamage { get { return 50; } }
|
||||
|
||||
public VvVExplosionTrap(Mobile owner, DeploymentType type)
|
||||
: base(owner, type)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Detonate(Mobile m)
|
||||
{
|
||||
int dam = Utility.RandomMinMax(MinDamage, MaxDamage);
|
||||
|
||||
if (DeploymentType == DeploymentType.Tripwire)
|
||||
dam *= 2;
|
||||
|
||||
AOS.Damage(m, Owner, dam, 50, 50, 0, 0, 0);
|
||||
|
||||
Effects.SendLocationEffect(this.GetWorldLocation(), this.Map, 0x36BD, 15, 10);
|
||||
Effects.PlaySound(this.GetWorldLocation(), this.Map, 0x307);
|
||||
|
||||
base.Detonate(m);
|
||||
}
|
||||
|
||||
public VvVExplosionTrap(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class VvVPoisonTrap : VvVTrap
|
||||
{
|
||||
public override int MinDamage { get { return 25; } }
|
||||
public override int MaxDamage { get { return 35; } }
|
||||
public override VvVTrapType TrapType { get { return VvVTrapType.Poison; } }
|
||||
|
||||
public VvVPoisonTrap(Mobile owner, DeploymentType type)
|
||||
: base(owner, type)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Detonate(Mobile m)
|
||||
{
|
||||
int dam = Utility.RandomMinMax(MinDamage, MaxDamage);
|
||||
|
||||
if (DeploymentType == DeploymentType.Tripwire)
|
||||
dam *= 2;
|
||||
|
||||
AOS.Damage(m, Owner, dam, 0, 0, 0, 100, 0);
|
||||
m.ApplyPoison(Owner, Poison.Deadly);
|
||||
|
||||
Effects.SendTargetEffect(m, 0x1145, 3, 16);
|
||||
Effects.PlaySound(this.GetWorldLocation(), this.Map, 0x230);
|
||||
|
||||
base.Detonate(m);
|
||||
}
|
||||
|
||||
public VvVPoisonTrap(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class VvVColdTrap : VvVTrap
|
||||
{
|
||||
public override int MinDamage { get { return 25; } }
|
||||
public override int MaxDamage { get { return 35; } }
|
||||
public override VvVTrapType TrapType { get { return VvVTrapType.Cold; } }
|
||||
|
||||
public VvVColdTrap(Mobile owner, DeploymentType type)
|
||||
: base(owner, type)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Detonate(Mobile m)
|
||||
{
|
||||
int dam = Utility.RandomMinMax(MinDamage, MaxDamage);
|
||||
|
||||
if (DeploymentType == DeploymentType.Tripwire)
|
||||
dam *= 2;
|
||||
|
||||
AOS.Damage(m, Owner, dam, 0, 0, 100, 0, 0);
|
||||
m.FixedParticles(0x374A, 1, 15, 9502, 97, 3, (EffectLayer)255);
|
||||
|
||||
m.Paralyze(TimeSpan.FromSeconds(5));
|
||||
|
||||
Effects.SendLocationParticles(m, 0x374A, 1, 30, 97, 3, 9502, 0);
|
||||
Effects.PlaySound(this.GetWorldLocation(), this.Map, 0x1FB);
|
||||
|
||||
base.Detonate(m);
|
||||
}
|
||||
|
||||
public VvVColdTrap(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class VvVEnergyTrap : VvVTrap
|
||||
{
|
||||
public override int MinDamage { get { return 25; } }
|
||||
public override int MaxDamage { get { return 35; } }
|
||||
public override VvVTrapType TrapType { get { return VvVTrapType.Energy; } }
|
||||
|
||||
public VvVEnergyTrap(Mobile owner, DeploymentType type)
|
||||
: base(owner, type)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Detonate(Mobile m)
|
||||
{
|
||||
int dam = Utility.RandomMinMax(MinDamage, MaxDamage);
|
||||
|
||||
if (DeploymentType == DeploymentType.Tripwire)
|
||||
dam *= 2;
|
||||
|
||||
Effects.SendBoltEffect(m, true, 0);
|
||||
AOS.Damage(m, Owner, dam, 0, 0, 100, 0, 0);
|
||||
|
||||
MortalStrike.BeginWound(m, TimeSpan.FromSeconds(3));
|
||||
|
||||
base.Detonate(m);
|
||||
}
|
||||
|
||||
public VvVEnergyTrap(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class VvVBladeTrap : VvVTrap
|
||||
{
|
||||
public override int MinDamage { get { return 25; } }
|
||||
public override int MaxDamage { get { return 35; } }
|
||||
public override VvVTrapType TrapType { get { return VvVTrapType.Blade; } }
|
||||
|
||||
public VvVBladeTrap(Mobile owner, DeploymentType type)
|
||||
: base(owner, type)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Detonate(Mobile m)
|
||||
{
|
||||
int dam = Utility.RandomMinMax(MinDamage, MaxDamage);
|
||||
|
||||
if (DeploymentType == DeploymentType.Tripwire)
|
||||
dam *= 2;
|
||||
|
||||
AOS.Damage(m, Owner, dam, 100, 0, 0, 0, 0);
|
||||
Effects.SendLocationEffect(m.Location, m.Map, 0x11AD, 25, 10);
|
||||
Effects.PlaySound(m.Location, m.Map, 0x218);
|
||||
|
||||
TransformContext context = TransformationSpellHelper.GetContext(m);
|
||||
|
||||
if ((context != null && (context.Type == typeof(LichFormSpell) || context.Type == typeof(WraithFormSpell))) ||
|
||||
(m is BaseCreature && ((BaseCreature)m).BleedImmune))
|
||||
return;
|
||||
|
||||
m.SendLocalizedMessage(1060160); // You are bleeding!
|
||||
BleedAttack.BeginBleed(m, Owner, false);
|
||||
|
||||
base.Detonate(m);
|
||||
}
|
||||
|
||||
public VvVBladeTrap(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
268
Scripts/Services/ViceVsVirtue/Items/Rewards/VvVWands.cs
Normal file
268
Scripts/Services/ViceVsVirtue/Items/Rewards/VvVWands.cs
Normal file
@@ -0,0 +1,268 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
public class VvVWand1 : BaseWand, IArcaneEquip
|
||||
{
|
||||
public override int InitMinHits { get { return 255; } }
|
||||
public override int InitMaxHits { get { return 255; } }
|
||||
|
||||
#region Arcane Impl
|
||||
private int m_MaxArcaneCharges, m_CurArcaneCharges;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int MaxArcaneCharges
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_MaxArcaneCharges;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_MaxArcaneCharges = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int CurArcaneCharges
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_CurArcaneCharges;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_CurArcaneCharges = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
public int TempHue { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool IsArcane
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_MaxArcaneCharges > 0 && m_CurArcaneCharges >= 0;
|
||||
}
|
||||
}
|
||||
|
||||
public override void AddCraftedProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.AddCraftedProperties(list);
|
||||
|
||||
if (IsArcane)
|
||||
list.Add(1061837, "{0}\t{1}", m_CurArcaneCharges, m_MaxArcaneCharges); // arcane charges: ~1_val~ / ~2_val~
|
||||
}
|
||||
#endregion
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1023570; // Wand
|
||||
}
|
||||
}
|
||||
|
||||
public VvVWand1()
|
||||
: base(WandEffect.None, 0, 0)
|
||||
{
|
||||
ItemID = 3571;
|
||||
|
||||
Attributes.SpellChanneling = 1;
|
||||
WeaponAttributes.UseBestSkill = 1;
|
||||
|
||||
m_MaxArcaneCharges = 50;
|
||||
m_CurArcaneCharges = 50;
|
||||
}
|
||||
|
||||
public VvVWand1(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)2); // version
|
||||
|
||||
if (IsArcane)
|
||||
{
|
||||
writer.Write(true);
|
||||
writer.Write(TempHue);
|
||||
writer.Write((int)m_CurArcaneCharges);
|
||||
writer.Write((int)m_MaxArcaneCharges);
|
||||
}
|
||||
else
|
||||
{
|
||||
writer.Write(false);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 2:
|
||||
{
|
||||
if (reader.ReadBool())
|
||||
{
|
||||
TempHue = reader.ReadInt();
|
||||
m_CurArcaneCharges = reader.ReadInt();
|
||||
m_MaxArcaneCharges = reader.ReadInt();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
if (reader.ReadBool())
|
||||
{
|
||||
m_CurArcaneCharges = reader.ReadInt();
|
||||
m_MaxArcaneCharges = reader.ReadInt();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (version == 0)
|
||||
Timer.DelayCall(() => ViceVsVirtueSystem.Instance.AddVvVItem(this));
|
||||
}
|
||||
}
|
||||
|
||||
public class VvVWand2 : BaseWand, IArcaneEquip
|
||||
{
|
||||
public override int InitMinHits { get { return 255; } }
|
||||
public override int InitMaxHits { get { return 255; } }
|
||||
|
||||
#region Arcane Impl
|
||||
private int m_MaxArcaneCharges, m_CurArcaneCharges;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int MaxArcaneCharges
|
||||
{
|
||||
get { return m_MaxArcaneCharges; }
|
||||
set
|
||||
{
|
||||
m_MaxArcaneCharges = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int CurArcaneCharges
|
||||
{
|
||||
get { return m_CurArcaneCharges; }
|
||||
set
|
||||
{
|
||||
m_CurArcaneCharges = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
public int TempHue { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool IsArcane
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_MaxArcaneCharges > 0 && m_CurArcaneCharges >= 0;
|
||||
}
|
||||
}
|
||||
|
||||
public override void AddCraftedProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.AddCraftedProperties(list);
|
||||
|
||||
if (IsArcane)
|
||||
list.Add(1061837, "{0}\t{1}", m_CurArcaneCharges, m_MaxArcaneCharges); // arcane charges: ~1_val~ / ~2_val~
|
||||
}
|
||||
#endregion
|
||||
|
||||
public override int LabelNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return 1023570; // Wand
|
||||
}
|
||||
}
|
||||
|
||||
public VvVWand2()
|
||||
: base(WandEffect.None, 0, 0)
|
||||
{
|
||||
ItemID = 3571;
|
||||
|
||||
Attributes.SpellChanneling = 1;
|
||||
WeaponAttributes.MageWeapon = 15;
|
||||
|
||||
m_MaxArcaneCharges = 50;
|
||||
m_CurArcaneCharges = 50;
|
||||
}
|
||||
|
||||
public VvVWand2(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)2); // version
|
||||
|
||||
if (IsArcane)
|
||||
{
|
||||
writer.Write(true);
|
||||
writer.Write(TempHue);
|
||||
writer.Write((int)m_CurArcaneCharges);
|
||||
writer.Write((int)m_MaxArcaneCharges);
|
||||
}
|
||||
else
|
||||
{
|
||||
writer.Write(false);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 2:
|
||||
{
|
||||
if (reader.ReadBool())
|
||||
{
|
||||
TempHue = reader.ReadInt();
|
||||
m_CurArcaneCharges = reader.ReadInt();
|
||||
m_MaxArcaneCharges = reader.ReadInt();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
if (reader.ReadBool())
|
||||
{
|
||||
m_CurArcaneCharges = reader.ReadInt();
|
||||
m_MaxArcaneCharges = reader.ReadInt();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (version == 0)
|
||||
Timer.DelayCall(() => ViceVsVirtueSystem.Instance.AddVvVItem(this));
|
||||
}
|
||||
}
|
||||
}
|
||||
466
Scripts/Services/ViceVsVirtue/Items/VvVAltar.cs
Normal file
466
Scripts/Services/ViceVsVirtue/Items/VvVAltar.cs
Normal file
@@ -0,0 +1,466 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using Server.Gumps;
|
||||
using System.Collections.Generic;
|
||||
using Server.Network;
|
||||
using Server.Guilds;
|
||||
using System.Linq;
|
||||
using Server.Engines.Points;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
public class VvVAltar : BaseAddon
|
||||
{
|
||||
public VvVBattle Battle { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool IsActive { get; set; }
|
||||
|
||||
public List<Item> Braziers { get; set; }
|
||||
public List<Item> Torches { get; set; }
|
||||
|
||||
public override bool HandlesOnMovement { get { return IsActive; } }
|
||||
|
||||
public OccupyTimer OccupationTimer { get; set; }
|
||||
public Timer CheckTimer { get; set; }
|
||||
|
||||
public VvVAltar(VvVBattle battle)
|
||||
{
|
||||
Battle = battle;
|
||||
|
||||
Braziers = new List<Item>();
|
||||
Torches = new List<Item>();
|
||||
|
||||
int virtue = Utility.Random(8);
|
||||
|
||||
AddComponent(new AddonComponent(1822), -2, -2, 0);
|
||||
AddComponent(new AddonComponent(1822), -1, -2, 0);
|
||||
AddComponent(new AddonComponent(1822), 0, -2, 0);
|
||||
AddComponent(new AddonComponent(1822), 1, -2, 0);
|
||||
AddComponent(new AddonComponent(1822), 2, -2, 0);
|
||||
|
||||
AddComponent(new AddonComponent(1822), -2, -1, 0);
|
||||
AddComponent(new AddonComponent(1822), -1, -1, 0);
|
||||
AddComponent(new AddonComponent(1822), 0, -1, 0);
|
||||
AddComponent(new AddonComponent(1822), 1, -1, 0);
|
||||
AddComponent(new AddonComponent(1822), 2, -1, 0);
|
||||
|
||||
AddComponent(new AddonComponent(1822), -2, 0, 0);
|
||||
AddComponent(new AddonComponent(1822), -1, 0, 0);
|
||||
AddComponent(new AddonComponent(1822), 0, 0, 0);
|
||||
AddComponent(new AddonComponent(1822), 1, 0, 0);
|
||||
AddComponent(new AddonComponent(1822), 2, 0, 0);
|
||||
|
||||
AddComponent(new AddonComponent(1822), -2, 1, 0);
|
||||
AddComponent(new AddonComponent(1822), -1, 1, 0);
|
||||
AddComponent(new AddonComponent(1822), 0, 1, 0);
|
||||
AddComponent(new AddonComponent(1822), 1, 1, 0);
|
||||
AddComponent(new AddonComponent(1822), 2, 1, 0);
|
||||
|
||||
AddComponent(new AddonComponent(1822), -2, 2, 0);
|
||||
AddComponent(new AddonComponent(1822), -1, 2, 0);
|
||||
AddComponent(new AddonComponent(1822), 0, 2, 0);
|
||||
AddComponent(new AddonComponent(1822), 1, 2, 0);
|
||||
AddComponent(new AddonComponent(1822), 2, 2, 0);
|
||||
|
||||
//NorthWest
|
||||
AddComponent(new AddonComponent(_Tiles[0][virtue]), -2, -2, 5);
|
||||
AddComponent(new AddonComponent(_Tiles[0][virtue] + 1), -2, -1, 5);
|
||||
AddComponent(new AddonComponent(_Tiles[0][virtue] + 2), -1, -1, 5);
|
||||
AddComponent(new AddonComponent(_Tiles[0][virtue] + 3), -1, -2, 5);
|
||||
|
||||
// SouthEast
|
||||
AddComponent(new AddonComponent(_Tiles[0][virtue]), 1, 1, 5);
|
||||
AddComponent(new AddonComponent(_Tiles[0][virtue] + 1), 1, 2, 5);
|
||||
AddComponent(new AddonComponent(_Tiles[0][virtue] + 2), 2, 2, 5);
|
||||
AddComponent(new AddonComponent(_Tiles[0][virtue] + 3), 2, 1, 5);
|
||||
|
||||
//SouthWest
|
||||
AddComponent(new AddonComponent(_Tiles[1][virtue]), -2, 1, 5);
|
||||
AddComponent(new AddonComponent(_Tiles[1][virtue] + 1), -1, 1, 5);
|
||||
AddComponent(new AddonComponent(_Tiles[1][virtue] + 2), -2, 2, 5);
|
||||
AddComponent(new AddonComponent(_Tiles[1][virtue] + 3), -1, 2, 5);
|
||||
|
||||
//NorthEast
|
||||
AddComponent(new AddonComponent(_Tiles[1][virtue]), 1, -2, 5);
|
||||
AddComponent(new AddonComponent(_Tiles[1][virtue] + 1), 2, -2, 5);
|
||||
AddComponent(new AddonComponent(_Tiles[1][virtue] + 2), 1, -1, 5);
|
||||
AddComponent(new AddonComponent(_Tiles[1][virtue] + 3), 2, -1, 5);
|
||||
|
||||
AddComponent(new AddonComponent(1866), -1, -3, 0);
|
||||
AddComponent(new AddonComponent(1847), 0, -3, 0);
|
||||
AddComponent(new AddonComponent(1868), 1, -3, 0);
|
||||
|
||||
AddComponent(new AddonComponent(1868), 3, -1, 0);
|
||||
AddComponent(new AddonComponent(1846), 3, 0, 0);
|
||||
AddComponent(new AddonComponent(1867), 3, 1, 0);
|
||||
|
||||
AddComponent(new AddonComponent(1869), -1, 3, 0);
|
||||
AddComponent(new AddonComponent(1823), 0, 3, 0);
|
||||
AddComponent(new AddonComponent(1867), 1, 3, 0);
|
||||
|
||||
AddComponent(new AddonComponent(1866), -3, -1, 0);
|
||||
AddComponent(new AddonComponent(1865), -3, 0, 0);
|
||||
AddComponent(new AddonComponent(1869), -3, 1, 0);
|
||||
|
||||
AddonComponent c = new AddonComponent(6570);
|
||||
AddComponent(c, 3, -3, 0);
|
||||
Braziers.Add(c);
|
||||
|
||||
c = new AddonComponent(6570);
|
||||
AddComponent(c, 3, 3, 0);
|
||||
Braziers.Add(c);
|
||||
|
||||
c = new AddonComponent(6570);
|
||||
AddComponent(c, -3, 3, 0);
|
||||
Braziers.Add(c);
|
||||
|
||||
c = new AddonComponent(6570);
|
||||
AddComponent(c, -3, -3, 0);
|
||||
Braziers.Add(c);
|
||||
}
|
||||
|
||||
public bool Contains(IPoint3D p)
|
||||
{
|
||||
if (p is IEntity && ((IEntity)p).Map != this.Map)
|
||||
return false;
|
||||
|
||||
return p.X >= this.X - 2 && p.X <= this.X + 2 && p.Y >= this.Y - 2 && p.Y <= this.Y + 2;
|
||||
}
|
||||
|
||||
public void Activate()
|
||||
{
|
||||
IsActive = true;
|
||||
|
||||
CheckTimer = Timer.DelayCall(TimeSpan.FromMilliseconds(500), TimeSpan.FromMilliseconds(500), CheckOccupy);
|
||||
CheckTimer.Start();
|
||||
}
|
||||
|
||||
public void Complete(Guild g)
|
||||
{
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(5), DoOccupy, new object[] { Battle, g });
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(2), DoFireworks);
|
||||
IsActive = false;
|
||||
|
||||
if (OccupationTimer != null)
|
||||
{
|
||||
OccupationTimer = null;
|
||||
}
|
||||
|
||||
if (CheckTimer != null)
|
||||
{
|
||||
CheckTimer.Stop();
|
||||
CheckTimer = null;
|
||||
}
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromMinutes(2), () =>
|
||||
{
|
||||
Torches.ForEach(t => t.Delete());
|
||||
Torches.Clear();
|
||||
});
|
||||
}
|
||||
|
||||
public static void DoOccupy(object obj)
|
||||
{
|
||||
object[] objs = obj as object[];
|
||||
VvVBattle battle = objs[0] as VvVBattle;
|
||||
Guild g = objs[1] as Guild;
|
||||
|
||||
if (battle != null && g != null)
|
||||
battle.OccupyAltar(g);
|
||||
}
|
||||
|
||||
public void DoFireworks()
|
||||
{
|
||||
if (Deleted)
|
||||
return;
|
||||
|
||||
for (int i = 2; i <= 8; i += 2)
|
||||
{
|
||||
Server.Timer.DelayCall(TimeSpan.FromMilliseconds((i - 2) * 600), o =>
|
||||
{
|
||||
Server.Misc.Geometry.Circle2D(this.Location, this.Map, (int)o, (pnt, map) =>
|
||||
{
|
||||
LaunchFireworks(pnt, map);
|
||||
});
|
||||
}, i);
|
||||
}
|
||||
}
|
||||
|
||||
public static void LaunchFireworks(Point3D p, Map map)
|
||||
{
|
||||
if (map == null || map == Map.Internal)
|
||||
return;
|
||||
|
||||
Point3D startLoc = new Point3D(p.X, p.Y, p.Z + 10);
|
||||
Point3D endLoc = new Point3D(p.X + Utility.RandomMinMax(-1, 1), p.Y + Utility.RandomMinMax(-1, 1), p.Z + 32);
|
||||
|
||||
Effects.SendMovingEffect(new Entity(Serial.Zero, startLoc, map), new Entity(Serial.Zero, endLoc, map),
|
||||
0x36E4, 5, 0, false, false);
|
||||
|
||||
Server.Timer.DelayCall(TimeSpan.FromSeconds(1.0), () =>
|
||||
{
|
||||
int hue = Utility.Random(40);
|
||||
|
||||
if (hue < 8)
|
||||
hue = 0x66D;
|
||||
else if (hue < 10)
|
||||
hue = 0x482;
|
||||
else if (hue < 12)
|
||||
hue = 0x47E;
|
||||
else if (hue < 16)
|
||||
hue = 0x480;
|
||||
else if (hue < 20)
|
||||
hue = 0x47F;
|
||||
else
|
||||
hue = 0;
|
||||
|
||||
if (Utility.RandomBool())
|
||||
hue = Utility.RandomList(0x47E, 0x47F, 0x480, 0x482, 0x66D);
|
||||
|
||||
int renderMode = Utility.RandomList(0, 2, 3, 4, 5, 7);
|
||||
|
||||
Effects.PlaySound(endLoc, map, Utility.Random(0x11B, 4));
|
||||
Effects.SendLocationEffect(endLoc, map, 0x373A + (0x10 * Utility.Random(4)), 16, 10, hue, renderMode);
|
||||
});
|
||||
}
|
||||
|
||||
public void CheckOccupy()
|
||||
{
|
||||
if (!IsActive || this.Map == null || this.Map == Map.Internal)
|
||||
return;
|
||||
|
||||
IPooledEnumerable eable = this.Map.GetMobilesInBounds(new Rectangle2D(this.X - 2, this.Y - 2, 5, 5));
|
||||
int count = 0;
|
||||
|
||||
foreach (Mobile m in eable)
|
||||
{
|
||||
VvVPlayerEntry entry;
|
||||
|
||||
if (m.Alive && ViceVsVirtueSystem.IsVvV(m, out entry, false, true))
|
||||
{
|
||||
count++;
|
||||
|
||||
if (OccupationTimer != null)
|
||||
{
|
||||
Guild g = OccupationTimer.Occupier;
|
||||
|
||||
if (g == null || (entry.Guild != g && !entry.Guild.IsAlly(g)))
|
||||
{
|
||||
Clear();
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.OccupationTimer = new OccupyTimer(this, entry.Guild);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this.OccupationTimer != null && !this.OccupationTimer.Running && count > 0)
|
||||
{
|
||||
this.OccupationTimer.Start();
|
||||
}
|
||||
else if (OccupationTimer != null && count == 0)
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
eable.Free();
|
||||
}
|
||||
|
||||
private void Clear()
|
||||
{
|
||||
OccupationTimer.Stop();
|
||||
OccupationTimer = null;
|
||||
|
||||
Torches.ForEach(t => t.Delete());
|
||||
Torches.Clear();
|
||||
}
|
||||
|
||||
public class OccupyTimer : Timer
|
||||
{
|
||||
public Guild Occupier { get; set; }
|
||||
public VvVAltar Altar { get; set; }
|
||||
|
||||
private int _Tick;
|
||||
|
||||
public OccupyTimer(VvVAltar altar, Guild occupier)
|
||||
: base(TimeSpan.FromSeconds(2), TimeSpan.FromSeconds(2))
|
||||
{
|
||||
Occupier = occupier;
|
||||
Altar = altar;
|
||||
_Tick = 0;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if (_Tick < 0)
|
||||
{
|
||||
_Tick = 0;
|
||||
}
|
||||
|
||||
if (_Tick >= _Locs.Length)
|
||||
{
|
||||
Altar.Complete(Occupier);
|
||||
Stop();
|
||||
return;
|
||||
}
|
||||
|
||||
Point3D p = _Locs[_Tick];
|
||||
|
||||
Effects.SendLocationEffect(new Point3D(Altar.X + p.X, Altar.Y + p.Y, Altar.Z + p.Z), Altar.Map, 0x3709, 30, 10);
|
||||
Effects.PlaySound(Altar.Location, Altar.Map, 0x208);
|
||||
|
||||
int index = _Tick / 4;
|
||||
|
||||
if (_Tick > 0 && index < Altar.Braziers.Count && (_Tick + 1) % 4 == 0)
|
||||
{
|
||||
Server.Timer.DelayCall(TimeSpan.FromSeconds(1), () =>
|
||||
{
|
||||
AddonComponent torch = new AddonComponent(6571);
|
||||
Altar.Torches.Add(torch);
|
||||
|
||||
Point3D to = Altar.Braziers[index].Location;
|
||||
|
||||
torch.MoveToWorld(new Point3D(to.X, to.Y, to.Z + 17), Altar.Map);
|
||||
Effects.PlaySound(to, Altar.Map, 0x47);
|
||||
});
|
||||
}
|
||||
|
||||
_Tick++;
|
||||
|
||||
if (_Tick >= _Locs.Length)
|
||||
{
|
||||
Altar.Complete(Occupier);
|
||||
Stop();
|
||||
}
|
||||
}
|
||||
|
||||
private Point3D[] _Locs =
|
||||
{
|
||||
new Point3D(-1, -2, 7), new Point3D(0, -2, 7), new Point3D(1, -2, 7), new Point3D(2, -2, 7),
|
||||
new Point3D(2, -1, 7), new Point3D(2, 0, 7), new Point3D(2, 1, 7), new Point3D(2, 2, 7),
|
||||
new Point3D(1, 2, 7), new Point3D(0, 2, 7), new Point3D(-1, 2, 7), new Point3D(-2, 2, 7),
|
||||
new Point3D(-2, 1, 7), new Point3D(-2, 0, 7), new Point3D(-2, -1, 7), new Point3D(-2, -2, 7),
|
||||
};
|
||||
}
|
||||
|
||||
public override void Delete()
|
||||
{
|
||||
base.Delete();
|
||||
|
||||
Torches.ForEach(t => t.Delete());
|
||||
}
|
||||
|
||||
public VvVAltar(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
|
||||
writer.Write(IsActive);
|
||||
|
||||
writer.Write(Braziers.Count);
|
||||
Braziers.ForEach(b => writer.Write(b));
|
||||
|
||||
writer.Write(Torches.Count);
|
||||
Torches.ForEach(t => writer.Write(t));
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
Braziers = new List<Item>();
|
||||
Torches = new List<Item>();
|
||||
|
||||
IsActive = reader.ReadBool();
|
||||
|
||||
int count = reader.ReadInt();
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
Item item = reader.ReadItem();
|
||||
if (item != null)
|
||||
Braziers.Add(item);
|
||||
}
|
||||
|
||||
count = reader.ReadInt();
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
Item item = reader.ReadItem();
|
||||
if (item != null)
|
||||
Torches.Add(item);
|
||||
}
|
||||
|
||||
if (IsActive)
|
||||
{
|
||||
CheckTimer = Timer.DelayCall(TimeSpan.FromMilliseconds(500), TimeSpan.FromMilliseconds(500), CheckOccupy);
|
||||
CheckTimer.Start();
|
||||
}
|
||||
}
|
||||
|
||||
private int[][] _Tiles =
|
||||
{
|
||||
new int[] { 5283, 5291, 5299, 5307, 5315, 5323, 5331, 5390 },
|
||||
new int[] { 39372, 39380, 39388, 39396, 39404, 39412, 39420, 39428 }
|
||||
};
|
||||
}
|
||||
|
||||
public class AltarArrow : QuestArrow
|
||||
{
|
||||
public Timer Timer { get; private set; }
|
||||
public VvVAltar Altar { get; private set; }
|
||||
|
||||
public int LastX { get; private set; }
|
||||
public int LastY { get; private set; }
|
||||
|
||||
public AltarArrow(Mobile from, IEntity target)
|
||||
: base(from, target)
|
||||
{
|
||||
Altar = target as VvVAltar;
|
||||
|
||||
Timer = Timer.DelayCall(TimeSpan.FromSeconds(0.25), TimeSpan.FromSeconds(2.5), OnTick); //new TrackTimer(from, target, range, this);
|
||||
Timer.Start();
|
||||
}
|
||||
|
||||
public void OnTick()
|
||||
{
|
||||
if (!Running)
|
||||
{
|
||||
Timer.Stop();
|
||||
return;
|
||||
}
|
||||
else if (this.Mobile.NetState == null || this.Mobile.Deleted || Altar.Deleted || this.Mobile.Map != Altar.Map
|
||||
|| ViceVsVirtueSystem.Instance.Battle == null || !ViceVsVirtueSystem.Instance.Battle.OnGoing || !this.Mobile.Region.IsPartOf(ViceVsVirtueSystem.Instance.Battle.Region)
|
||||
|| Altar.Contains(this.Mobile))
|
||||
{
|
||||
Stop();
|
||||
return;
|
||||
}
|
||||
|
||||
// this should never happen!
|
||||
if (LastX != Target.X || LastY != Target.Y)
|
||||
{
|
||||
LastX = Target.X;
|
||||
LastY = Target.Y;
|
||||
|
||||
Update();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnStop()
|
||||
{
|
||||
Timer.Stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
151
Scripts/Services/ViceVsVirtue/Items/VvVSigil.cs
Normal file
151
Scripts/Services/ViceVsVirtue/Items/VvVSigil.cs
Normal file
@@ -0,0 +1,151 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using Server.Gumps;
|
||||
using System.Collections.Generic;
|
||||
using Server.Network;
|
||||
using Server.Guilds;
|
||||
using System.Linq;
|
||||
using Server.Engines.Points;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
public class VvVSigil : Item, IRevealableItem
|
||||
{
|
||||
public const int OwnershipHue = 0xB;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public VvVBattle Battle { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Point3D HomeLocation { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public DateTime LastStolen { get; set; }
|
||||
|
||||
public override int LabelNumber { get { return 1123391; } } // Sigil
|
||||
public override bool HandlesOnMovement { get { return !Visible; } }
|
||||
public bool CheckWhenHidden { get { return true; } }
|
||||
|
||||
public VvVSigil(VvVBattle battle, Point3D home)
|
||||
: base(0x99C7)
|
||||
{
|
||||
Battle = battle;
|
||||
Visible = false;
|
||||
|
||||
Hue = 2721;
|
||||
|
||||
LootType = LootType.Cursed;
|
||||
}
|
||||
|
||||
public void OnStolen(VvVPlayerEntry entry)
|
||||
{
|
||||
if (Battle != null && RootParentEntity == null)
|
||||
{
|
||||
Battle.SpawnPriests();
|
||||
Battle.Update(null, entry, UpdateType.Steal);
|
||||
|
||||
LastStolen = DateTime.UtcNow;
|
||||
HomeLocation = Location;
|
||||
|
||||
Movable = true;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CheckLift(Mobile from, Item item, ref LRReason reject)
|
||||
{
|
||||
if (LastStolen == DateTime.MinValue)
|
||||
{
|
||||
from.SendLocalizedMessage(1005225); // You must use the stealing skill to pick up the sigil
|
||||
return false;
|
||||
}
|
||||
|
||||
return base.CheckLift(from, item, ref reject);
|
||||
}
|
||||
|
||||
private Mobile FindOwner(object parent)
|
||||
{
|
||||
if (parent is Item)
|
||||
return ((Item)parent).RootParent as Mobile;
|
||||
|
||||
if (parent is Mobile)
|
||||
return (Mobile)parent;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public void ReturnToHome()
|
||||
{
|
||||
MoveToWorld(HomeLocation, Map.Felucca);
|
||||
Visible = false;
|
||||
Movable = false;
|
||||
}
|
||||
|
||||
public static bool CheckMovement(PlayerMobile pm, Direction d)
|
||||
{
|
||||
if (!ViceVsVirtueSystem.Enabled)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
int x = pm.X;
|
||||
int y = pm.Y;
|
||||
|
||||
Movement.Movement.Offset(d, ref x, ref y);
|
||||
|
||||
Region r = Region.Find(new Point3D(x, y, pm.Map.GetAverageZ(x, y)), pm.Map);
|
||||
|
||||
return ViceVsVirtueSystem.IsBattleRegion(r);
|
||||
}
|
||||
|
||||
public bool CheckReveal(Mobile m)
|
||||
{
|
||||
if (!ViceVsVirtueSystem.IsVvV(m))
|
||||
return false;
|
||||
|
||||
return Utility.Random(100) <= m.Skills[SkillName.DetectHidden].Value;
|
||||
}
|
||||
|
||||
public virtual void OnRevealed(Mobile m)
|
||||
{
|
||||
Visible = true;
|
||||
}
|
||||
|
||||
public virtual bool CheckPassiveDetect(Mobile m)
|
||||
{
|
||||
if (m.InRange(this.Location, 4))
|
||||
{
|
||||
int skill = (int)m.Skills[SkillName.DetectHidden].Value;
|
||||
|
||||
if (skill >= 80 && Utility.Random(300) < skill)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public VvVSigil(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
|
||||
writer.Write(LastStolen);
|
||||
writer.Write(HomeLocation);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
LastStolen = reader.ReadDateTime();
|
||||
HomeLocation = reader.ReadPoint3D();
|
||||
}
|
||||
}
|
||||
}
|
||||
233
Scripts/Services/ViceVsVirtue/Mobiles/SilverTrader.cs
Normal file
233
Scripts/Services/ViceVsVirtue/Mobiles/SilverTrader.cs
Normal file
@@ -0,0 +1,233 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using Server.Gumps;
|
||||
using Server.Guilds;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
public class SilverTrader : BaseVendor
|
||||
{
|
||||
public override bool IsActiveVendor { get { return false; } }
|
||||
public override bool DisallowAllMoves { get { return true; } }
|
||||
public override bool ClickTitle { get { return true; } }
|
||||
public override bool CanTeach { get { return false; } }
|
||||
|
||||
protected List<SBInfo> m_SBInfos = new List<SBInfo>();
|
||||
protected override List<SBInfo> SBInfos { get { return this.m_SBInfos; } }
|
||||
public override void InitSBInfo() { }
|
||||
|
||||
[Constructable]
|
||||
public SilverTrader() : base("the Silver Trader")
|
||||
{
|
||||
}
|
||||
|
||||
public override void InitBody()
|
||||
{
|
||||
base.InitBody();
|
||||
|
||||
Name = NameList.RandomName("male");
|
||||
|
||||
SpeechHue = 0x3B2;
|
||||
Hue = Utility.RandomSkinHue();
|
||||
Body = 0x190;
|
||||
}
|
||||
|
||||
public override void InitOutfit()
|
||||
{
|
||||
Robe robe = new Robe();
|
||||
robe.ItemID = 0x2684;
|
||||
robe.Name = "a robe";
|
||||
|
||||
SetWearable(robe, 1109);
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(10), StockInventory);
|
||||
}
|
||||
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
list.Add(1155513); // Vice vs Virtue Reward Vendor
|
||||
}
|
||||
|
||||
private DateTime _NextSpeak;
|
||||
|
||||
public override void OnMovement(Mobile m, Point3D oldLocation)
|
||||
{
|
||||
base.OnMovement(m, oldLocation);
|
||||
|
||||
if (_NextSpeak < DateTime.UtcNow && ViceVsVirtueSystem.IsVvV(m) && InRange(m.Location, 6) && m.Race == Race.Gargoyle)
|
||||
{
|
||||
SayTo(m, 1155534); // I will convert your human artifacts to gargoyle versions if you hand them to me.
|
||||
_NextSpeak = DateTime.UtcNow + TimeSpan.FromSeconds(25);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile m)
|
||||
{
|
||||
if (ViceVsVirtueSystem.Enabled && m is PlayerMobile && InRange(m.Location, 3))
|
||||
{
|
||||
if (ViceVsVirtueSystem.IsVvV(m))
|
||||
{
|
||||
m.SendGump(new VvVRewardGump(this, (PlayerMobile)m));
|
||||
}
|
||||
else
|
||||
{
|
||||
SayTo(m, 1155585); // You have no silver to trade with. Join Vice vs Virtue and return to me.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void StockInventory()
|
||||
{
|
||||
if (Backpack == null)
|
||||
AddItem(new Backpack());
|
||||
|
||||
foreach (CollectionItem item in VvVRewards.Rewards)
|
||||
{
|
||||
if (item.Tooltip == 0)
|
||||
{
|
||||
if (Backpack.GetAmount(item.Type) > 0)
|
||||
{
|
||||
Item itm = Backpack.FindItemByType(item.Type);
|
||||
|
||||
if (itm is IVvVItem)
|
||||
((IVvVItem)itm).IsVvVItem = true;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
Item i = Activator.CreateInstance(item.Type) as Item;
|
||||
|
||||
if (i != null)
|
||||
{
|
||||
if (i is IOwnerRestricted)
|
||||
((IOwnerRestricted)i).OwnerName = "Your Player Name";
|
||||
|
||||
if (i is IVvVItem)
|
||||
((IVvVItem)i).IsVvVItem = true;
|
||||
|
||||
NegativeAttributes neg = RunicReforging.GetNegativeAttributes(i);
|
||||
|
||||
if (neg != null)
|
||||
{
|
||||
neg.Antique = 1;
|
||||
|
||||
if (i is IDurability && ((IDurability)i).MaxHitPoints == 0)
|
||||
{
|
||||
((IDurability)i).MaxHitPoints = 255;
|
||||
((IDurability)i).HitPoints = 255;
|
||||
}
|
||||
}
|
||||
|
||||
ViceVsVirtueSystem.Instance.AddVvVItem(i, true);
|
||||
|
||||
Backpack.DropItem(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Type[][] _Table =
|
||||
{
|
||||
new Type[] { typeof(CrimsonCincture), typeof(GargishCrimsonCincture) },
|
||||
new Type[] { typeof(MaceAndShieldGlasses), typeof(GargishMaceAndShieldGlasses) },
|
||||
new Type[] { typeof(WizardsCrystalGlasses), typeof(GargishWizardsCrystalGlasses) },
|
||||
new Type[] { typeof(FoldedSteelGlasses), typeof(GargishFoldedSteelGlasses) },
|
||||
};
|
||||
|
||||
public override bool OnDragDrop(Mobile from, Item dropped)
|
||||
{
|
||||
if (ViceVsVirtueSystem.IsVvV(from))
|
||||
{
|
||||
if (!(dropped is IOwnerRestricted) || ((IOwnerRestricted)dropped).Owner == from)
|
||||
{
|
||||
if (dropped is IVvVItem && from.Race == Race.Gargoyle)
|
||||
{
|
||||
foreach (var t in _Table)
|
||||
{
|
||||
if (dropped.GetType() == t[0])
|
||||
{
|
||||
IDurability dur = dropped as IDurability;
|
||||
|
||||
if (dur != null && dur.MaxHitPoints == 255 && dur.HitPoints == 255)
|
||||
{
|
||||
var item = Loot.Construct(t[1]);
|
||||
|
||||
if (item != null)
|
||||
{
|
||||
VvVRewards.OnRewardItemCreated(from, item);
|
||||
|
||||
if (item is GargishCrimsonCincture)
|
||||
{
|
||||
((GargishCrimsonCincture)item).Attributes.BonusDex = 10;
|
||||
}
|
||||
|
||||
if (item is GargishMaceAndShieldGlasses)
|
||||
{
|
||||
((GargishMaceAndShieldGlasses)item).Attributes.WeaponDamage = 10;
|
||||
}
|
||||
|
||||
if (item is GargishFoldedSteelGlasses)
|
||||
{
|
||||
((GargishFoldedSteelGlasses)item).Attributes.DefendChance = 25;
|
||||
}
|
||||
|
||||
if (item is GargishWizardsCrystalGlasses)
|
||||
{
|
||||
((GargishWizardsCrystalGlasses)item).PhysicalBonus = 5;
|
||||
((GargishWizardsCrystalGlasses)item).FireBonus = 5;
|
||||
((GargishWizardsCrystalGlasses)item).ColdBonus = 5;
|
||||
((GargishWizardsCrystalGlasses)item).PoisonBonus = 5;
|
||||
((GargishWizardsCrystalGlasses)item).EnergyBonus = 5;
|
||||
}
|
||||
|
||||
from.AddToBackpack(item);
|
||||
dropped.Delete();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SayTo(from, 1157365); // I'm sorry, I cannot accept this item.
|
||||
return false;
|
||||
}
|
||||
|
||||
public SilverTrader(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(1);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if (version == 0)
|
||||
{
|
||||
Timer.DelayCall(() =>
|
||||
{
|
||||
ColUtility.SafeDelete<Item>(Backpack.Items, null);
|
||||
});
|
||||
}
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(5), StockInventory);
|
||||
}
|
||||
}
|
||||
}
|
||||
100
Scripts/Services/ViceVsVirtue/Mobiles/VvVPriest.cs
Normal file
100
Scripts/Services/ViceVsVirtue/Mobiles/VvVPriest.cs
Normal file
@@ -0,0 +1,100 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using Server.Gumps;
|
||||
using Server.Guilds;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
public class VvVPriest : BaseVendor
|
||||
{
|
||||
public override bool IsActiveVendor { get { return false; } }
|
||||
public override bool DisallowAllMoves { get { return true; } }
|
||||
public override bool ClickTitle { get { return true; } }
|
||||
public override bool CanTeach { get { return false; } }
|
||||
|
||||
protected List<SBInfo> m_SBInfos = new List<SBInfo>();
|
||||
protected override List<SBInfo> SBInfos { get { return this.m_SBInfos; } }
|
||||
public override void InitSBInfo() { }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public VvVType VvVType { get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public VvVBattle Battle { get; set; }
|
||||
|
||||
[Constructable]
|
||||
public VvVPriest(VvVType type, VvVBattle battle) : base(type == VvVType.Vice ? "the Priest of Vice" : "the Priest of Virtue")
|
||||
{
|
||||
this.VvVType = type;
|
||||
Battle = battle;
|
||||
}
|
||||
|
||||
public override void InitBody()
|
||||
{
|
||||
base.InitBody();
|
||||
|
||||
Name = NameList.RandomName("male");
|
||||
|
||||
SpeechHue = 0x3B2;
|
||||
Hue = Utility.RandomSkinHue();
|
||||
Body = 0x190;
|
||||
}
|
||||
|
||||
public override bool OnDragDrop(Mobile from, Item dropped)
|
||||
{
|
||||
if(ViceVsVirtueSystem.Instance == null || Battle == null)
|
||||
return false;
|
||||
|
||||
VvVPlayerEntry entry = ViceVsVirtueSystem.Instance.GetPlayerEntry<VvVPlayerEntry>(from);
|
||||
|
||||
if (from.InRange(Location, 2) && entry != null && ViceVsVirtueSystem.IsVvV(from) && dropped is VvVSigil)
|
||||
{
|
||||
VvVSigil sigil = dropped as VvVSigil;
|
||||
Battle.Update(null, entry, this.VvVType == VvVType.Vice ? UpdateType.TurnInVice : UpdateType.TurnInVirtue);
|
||||
|
||||
sigil.Delete();
|
||||
Battle.Sigil = null;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void InitOutfit()
|
||||
{
|
||||
Robe robe = new Robe();
|
||||
robe.ItemID = 19357;
|
||||
robe.Name = this.VvVType == VvVType.Virtue ? "Robe of Virtue" : "Robe of Vice";
|
||||
|
||||
Timer.DelayCall<Item>(TimeSpan.FromSeconds(1), item =>
|
||||
{
|
||||
item.Hue = this.VvVType == VvVType.Virtue ? ViceVsVirtueSystem.VirtueHue : ViceVsVirtueSystem.ViceHue;
|
||||
}, robe);
|
||||
|
||||
SetWearable(robe, this.VvVType == VvVType.Virtue ? ViceVsVirtueSystem.VirtueHue : ViceVsVirtueSystem.ViceHue); // TODO: Get Hues
|
||||
}
|
||||
|
||||
public VvVPriest(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(0);
|
||||
|
||||
writer.Write((int)VvVType);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
this.VvVType = (VvVType)reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
1171
Scripts/Services/ViceVsVirtue/ViceVsVirtueSystem.cs
Normal file
1171
Scripts/Services/ViceVsVirtue/ViceVsVirtueSystem.cs
Normal file
File diff suppressed because it is too large
Load Diff
1157
Scripts/Services/ViceVsVirtue/VvVBattle.cs
Normal file
1157
Scripts/Services/ViceVsVirtue/VvVBattle.cs
Normal file
File diff suppressed because it is too large
Load Diff
145
Scripts/Services/ViceVsVirtue/VvVRewards.cs
Normal file
145
Scripts/Services/ViceVsVirtue/VvVRewards.cs
Normal file
@@ -0,0 +1,145 @@
|
||||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using Server.Gumps;
|
||||
using System.Collections.Generic;
|
||||
using Server.Network;
|
||||
using Server.Guilds;
|
||||
using System.Linq;
|
||||
using Server.Engines.Points;
|
||||
|
||||
namespace Server.Engines.VvV
|
||||
{
|
||||
public enum TileType
|
||||
{
|
||||
North = 0,
|
||||
West = 1,
|
||||
}
|
||||
|
||||
public static class VvVRewards
|
||||
{
|
||||
public static List<CollectionItem> Rewards { get; set; }
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
Rewards = new List<CollectionItem>();
|
||||
|
||||
Rewards.Add(new CollectionItem(typeof(VvVPotionKeg), 6870, 1094764, 437, 500)); // Greater Stam
|
||||
Rewards.Add(new CollectionItem(typeof(VvVPotionKeg), 6870, 1094718, 13, 500)); // Supernova
|
||||
Rewards.Add(new CollectionItem(typeof(VvVPotionKeg), 6870, 1155541, 2500, 500)); // Stat Loss Removal
|
||||
Rewards.Add(new CollectionItem(typeof(VvVPotionKeg), 6870, 1155543, 2543, 500)); // ANti Paralysis
|
||||
|
||||
Rewards.Add(new CollectionItem(typeof(EssenceOfCourage), 3838, 1155554, 2718, 250)); // Essence of Courage
|
||||
|
||||
Rewards.Add(new CollectionItem(typeof(VvVSteedStatuette), 8484, 1155545, ViceVsVirtueSystem.VirtueHue, 500)); // Virtue War Horse
|
||||
Rewards.Add(new CollectionItem(typeof(VvVSteedStatuette), 8484, 1155545, ViceVsVirtueSystem.ViceHue, 500)); // Vice War Horse
|
||||
Rewards.Add(new CollectionItem(typeof(VvVSteedStatuette), 8501, 1155546, ViceVsVirtueSystem.VirtueHue, 500)); // Virtue War Ostard
|
||||
Rewards.Add(new CollectionItem(typeof(VvVSteedStatuette), 8501, 1155546, ViceVsVirtueSystem.ViceHue, 500)); // Vice War Ostard
|
||||
|
||||
Rewards.Add(new CollectionItem(typeof(VvVHairDye), 3838, 1155538, ViceVsVirtueSystem.VirtueHue, 2500)); // Virtue Hair Dye
|
||||
Rewards.Add(new CollectionItem(typeof(VvVHairDye), 3838, 1155539, ViceVsVirtueSystem.ViceHue, 2500)); // Vice Hair DYe
|
||||
|
||||
Rewards.Add(new CollectionItem(typeof(VvVTrapKit), 7866, 1155527, 0, 250)); // Poison Trap Kit
|
||||
Rewards.Add(new CollectionItem(typeof(VvVTrapKit), 7866, 1155528, 0, 250)); // Freezing Trap Kit
|
||||
Rewards.Add(new CollectionItem(typeof(VvVTrapKit), 7866, 1155529, 0, 250)); // Shocking Trap Kit
|
||||
Rewards.Add(new CollectionItem(typeof(VvVTrapKit), 7866, 1155530, 0, 250)); // Blades Trap Kit
|
||||
Rewards.Add(new CollectionItem(typeof(VvVTrapKit), 7866, 1155531, 0, 250)); // Explosion Trap Kit
|
||||
|
||||
Rewards.Add(new CollectionItem(typeof(CannonTurretPlans), 5360, 1155503, 0, 3000)); // Cannon Turret
|
||||
Rewards.Add(new CollectionItem(typeof(ManaSpike), 2308, 1155508, 0, 1000)); // Mana Spike
|
||||
|
||||
Rewards.Add(new CollectionItem(typeof(ForgedRoyalPardon), 18098, 1155524, 0, 10000)); // Royal Forged Pardon
|
||||
Rewards.Add(new CollectionItem(typeof(ScrollOfTranscendence), 5360, 1094934, 0x490, 10000)); // Scroll of Transcendence
|
||||
|
||||
Rewards.Add(new CollectionItem(typeof(VvVRobe), 9859, 1155532, ViceVsVirtueSystem.VirtueHue, 5000)); // virtue robe
|
||||
Rewards.Add(new CollectionItem(typeof(VvVRobe), 9859, 1155533, ViceVsVirtueSystem.ViceHue, 5000)); // virtue robe
|
||||
|
||||
Rewards.Add(new CollectionItem(typeof(CovetousTileDeed), 5360, 1155516, 0, 10000)); // Covetous Tile
|
||||
Rewards.Add(new CollectionItem(typeof(DeceitTileDeed), 5360, 1155517, 0, 10000)); // Deceit Tile
|
||||
Rewards.Add(new CollectionItem(typeof(DespiseTileDeed), 5360, 1155518, 0, 10000)); // Depise Tile
|
||||
Rewards.Add(new CollectionItem(typeof(DestardTileDeed), 5360, 1155519, 0, 10000)); // Destard Tile
|
||||
Rewards.Add(new CollectionItem(typeof(HythlothTileDeed), 5360, 1155520, 0, 10000)); // Hythloth Tile
|
||||
Rewards.Add(new CollectionItem(typeof(PrideTileDeed), 5360, 1155521, 0, 10000)); // Pride Tile
|
||||
Rewards.Add(new CollectionItem(typeof(ShameTileDeed), 5360, 1155522, 0, 10000)); // Shame Tile
|
||||
Rewards.Add(new CollectionItem(typeof(WrongTileDeed), 5360, 1155523, 0, 10000)); // Wrong Tile
|
||||
|
||||
Rewards.Add(new CollectionItem(typeof(MorphEarrings), 4231, 0, 0, 500));
|
||||
Rewards.Add(new CollectionItem(typeof(MaceAndShieldGlasses), 12216, 0, 477, 500));
|
||||
Rewards.Add(new CollectionItem(typeof(InquisitorsResolution), 5140, 0, 1266, 500));
|
||||
Rewards.Add(new CollectionItem(typeof(OrnamentOfTheMagician), 4230, 0, 1364, 500));
|
||||
Rewards.Add(new CollectionItem(typeof(VesperOrderShield), 7108, 0, 0, 500)); // Needs 0 FC
|
||||
Rewards.Add(new CollectionItem(typeof(ClaininsSpellbook), 3834, 0, 2125, 500));
|
||||
Rewards.Add(new CollectionItem(typeof(FoldedSteelGlasses), 12216, 0, 1150, 500));
|
||||
Rewards.Add(new CollectionItem(typeof(CrystallineRing), 4234, 0, 1152, 500));
|
||||
Rewards.Add(new CollectionItem(typeof(SpiritOfTheTotem), 5445, 0, 1109, 500));
|
||||
Rewards.Add(new CollectionItem(typeof(WizardsCrystalGlasses), 12216, 0, 688, 500));
|
||||
Rewards.Add(new CollectionItem(typeof(PrimerOnArmsTalisman), 12121, 0, 0, 500));
|
||||
Rewards.Add(new CollectionItem(typeof(TomeOfLostKnowledge), 3834, 0, 1328, 500));
|
||||
Rewards.Add(new CollectionItem(typeof(HuntersHeaddress), 5447, 0, 1428, 500));
|
||||
Rewards.Add(new CollectionItem(typeof(HeartOfTheLion), 5141, 0, 1281, 500));
|
||||
Rewards.Add(new CollectionItem(typeof(CrimsonCincture), 5435, 0, 1157, 500));
|
||||
Rewards.Add(new CollectionItem(typeof(RingOfTheVile), 4234, 0, 1271, 500));
|
||||
Rewards.Add(new CollectionItem(typeof(HumanFeyLeggings), 5054, 0, 0, 500));
|
||||
Rewards.Add(new CollectionItem(typeof(Stormgrip), 10130, 0, 0, 500));
|
||||
Rewards.Add(new CollectionItem(typeof(RuneBeetleCarapace), 10109, 0, 0, 500));
|
||||
Rewards.Add(new CollectionItem(typeof(KasaOfTheRajin), 10136, 0, 0, 500));
|
||||
|
||||
Rewards.Add(new CollectionItem(typeof(VvVWand1), 3571, 0, 0, 500));
|
||||
Rewards.Add(new CollectionItem(typeof(VvVWand2), 3571, 0, 0, 500));
|
||||
Rewards.Add(new CollectionItem(typeof(VvVWizardsHat), 5912, 0, 0, 500));
|
||||
Rewards.Add(new CollectionItem(typeof(VvVWand1), 3571, 0, 0, 500));
|
||||
Rewards.Add(new CollectionItem(typeof(VvVWoodlandArms), 11116, 0, 0, 500));
|
||||
Rewards.Add(new CollectionItem(typeof(VvVDragonArms), 9815, 0, 0, 500));
|
||||
Rewards.Add(new CollectionItem(typeof(VvVGargishPlateArms), 776, 0, 0, 500));
|
||||
Rewards.Add(new CollectionItem(typeof(VvVPlateArms), 5136, 0, 0, 500));
|
||||
Rewards.Add(new CollectionItem(typeof(VvVEpaulette), 0x9985, 0, 0, 500));
|
||||
Rewards.Add(new CollectionItem(typeof(VvVGargishEpaulette), 0x9986, 0, 0, 500));
|
||||
Rewards.Add(new CollectionItem(typeof(VvVGargishStoneChest), 0x286, 0, 0, 500));
|
||||
Rewards.Add(new CollectionItem(typeof(VvVStuddedChest), 5083, 0, 0, 500));
|
||||
Rewards.Add(new CollectionItem(typeof(VvVGargishEarrings), 16915, 0, 0, 500));
|
||||
|
||||
Rewards.Add(new CollectionItem(typeof(CompassionBanner), 39351, 1123375, 0, 10000)); // Compassion Banner
|
||||
Rewards.Add(new CollectionItem(typeof(HonestyBanner), 39353, 1123377, 0, 10000)); // Honesty Banner
|
||||
Rewards.Add(new CollectionItem(typeof(HonorBanner), 39355, 1123379, 0, 10000)); // Honor Banner
|
||||
Rewards.Add(new CollectionItem(typeof(HumilityBanner), 39357, 1123381, 0, 10000)); // Humility Banner
|
||||
Rewards.Add(new CollectionItem(typeof(JusticeBanner), 39359, 1123383, 0, 10000)); // Justice Banner
|
||||
Rewards.Add(new CollectionItem(typeof(SacraficeBanner), 39361, 1123385, 0, 10000)); // Sacrafice Banner
|
||||
Rewards.Add(new CollectionItem(typeof(SpiritualityBanner), 39363, 1123387, 0, 10000)); // Spirituality Banner
|
||||
Rewards.Add(new CollectionItem(typeof(ValorBanner), 39365, 1123389, 0, 10000)); // Valor Banner
|
||||
|
||||
Rewards.Add(new CollectionItem(typeof(CovetousBanner), 39335, 1123359, 0, 10000)); // Covetous Banner
|
||||
Rewards.Add(new CollectionItem(typeof(DeceitBanner), 39337, 1123361, 0, 10000)); // Deceit Banner
|
||||
Rewards.Add(new CollectionItem(typeof(DespiseBanner), 39339, 1123363, 0, 10000)); // Depise Banner
|
||||
Rewards.Add(new CollectionItem(typeof(DestardBanner), 39341, 1123365, 0, 10000)); // Destard Banner
|
||||
Rewards.Add(new CollectionItem(typeof(HythlothBanner), 39343, 1123367, 0, 10000)); // Hythloth Banner
|
||||
Rewards.Add(new CollectionItem(typeof(PrideBanner), 39345, 1123369, 0, 10000)); // Pride Banner
|
||||
Rewards.Add(new CollectionItem(typeof(ShameBanner), 39347, 1123371, 0, 10000)); // Shame Banner
|
||||
Rewards.Add(new CollectionItem(typeof(WrongBanner), 39349, 1123373, 0, 10000)); // Wrong Banner
|
||||
}
|
||||
|
||||
public static void OnRewardItemCreated(Mobile from, Item item)
|
||||
{
|
||||
if (item is IOwnerRestricted)
|
||||
((IOwnerRestricted)item).Owner = from;
|
||||
|
||||
if (item is IAccountRestricted && from.Account != null)
|
||||
((IAccountRestricted)item).Account = from.Account.Username;
|
||||
|
||||
NegativeAttributes neg = RunicReforging.GetNegativeAttributes(item);
|
||||
|
||||
if (neg != null && !(item is Spellbook))
|
||||
{
|
||||
neg.Antique = 1;
|
||||
|
||||
if (item is IDurability && ((IDurability)item).MaxHitPoints == 0)
|
||||
{
|
||||
((IDurability)item).MaxHitPoints = 255;
|
||||
((IDurability)item).HitPoints = 255;
|
||||
}
|
||||
}
|
||||
|
||||
ViceVsVirtueSystem.Instance.AddVvVItem(item, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user