Initial commit
This commit is contained in:
+152
@@ -0,0 +1,152 @@
|
||||
using System;
|
||||
using Server.Misc;
|
||||
using System.Linq;
|
||||
|
||||
namespace Server.Custom.UOSurvivalEvent.Islands
|
||||
{
|
||||
public enum IslandType
|
||||
{
|
||||
Default,
|
||||
Grass,
|
||||
Forest,
|
||||
Desert,
|
||||
Snow,
|
||||
Swamp,
|
||||
Fire,
|
||||
Blood
|
||||
}
|
||||
|
||||
public class BaseIsland
|
||||
{
|
||||
public string Name { get; private set; } = string.Empty;
|
||||
|
||||
public IslandType IslandBiome { get; private set; } = IslandType.Default;
|
||||
|
||||
public Rectangle2D IslandBounds { get; private set; }
|
||||
|
||||
public DefaultIsland IslandEntity { get; private set; }
|
||||
|
||||
public bool TeamOne { get; private set; } = true;
|
||||
|
||||
public BaseIsland(Rectangle2D bounds)
|
||||
{
|
||||
if (bounds.Width > 10 && bounds.Height > 10)
|
||||
{
|
||||
IslandBounds = bounds;
|
||||
}
|
||||
else
|
||||
{
|
||||
IslandBounds = new Rectangle2D(bounds.Start, new Point2D(bounds.Start.X + 11, bounds.Start.Y + 11));
|
||||
}
|
||||
}
|
||||
|
||||
public void SpawnIsland(SurvivalTeam team, Map map, IslandType biome)
|
||||
{
|
||||
IslandBiome = biome;
|
||||
|
||||
IslandEntity = SurvivalUtility.GetIslandEntity(IslandBiome);
|
||||
|
||||
SurvivalUtility.AddIsland(team, map, map.GetAverageZ(IslandBounds.Start.X, IslandBounds.Start.Y));
|
||||
}
|
||||
|
||||
private bool inCallBack = false;
|
||||
|
||||
public void CheckTotem(SurvivalTeam myTeam, SurvivalTeam theirTeam, Mobile m)
|
||||
{
|
||||
if (!inCallBack)
|
||||
{
|
||||
var mobs = theirTeam.TeamTotem.GetMobilesInRange(1).ToList();
|
||||
|
||||
if (mobs == null || mobs.Count == 0)
|
||||
{
|
||||
if (theirTeam.TotemTime > 0)
|
||||
{
|
||||
theirTeam.TotemTime--;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mobs != null && mobs.Contains(m))
|
||||
{
|
||||
if (theirTeam.TotemTime == 0)
|
||||
{
|
||||
SurvivalCore.SendTotemMsg(theirTeam, "I am being deactivated, help!");
|
||||
}
|
||||
else
|
||||
{
|
||||
var timeLeft = SurvivalCore.TotemDeactivation - theirTeam.TotemTime;
|
||||
|
||||
SurvivalCore.SendTotemMsg(theirTeam, $"I am being deactivated, {timeLeft}");
|
||||
}
|
||||
|
||||
if (theirTeam.TotemTime < SurvivalCore.TotemDeactivation)
|
||||
{
|
||||
theirTeam.TotemTime++;
|
||||
|
||||
inCallBack = true;
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(3), () =>
|
||||
{
|
||||
inCallBack = false;
|
||||
|
||||
IslandEntity.CheckIslandMove(myTeam, theirTeam, m);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
SurvivalCore.SendTotemMsg(theirTeam, "I am deactivated, Game Over!");
|
||||
|
||||
theirTeam.TeamTotem.Hue = Utility.RandomRedHue();
|
||||
|
||||
inCallBack = true;
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(3), () =>
|
||||
{
|
||||
SurvivalCore.Winner = myTeam;
|
||||
|
||||
SurvivalCore.EndMatch();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Weather
|
||||
private static bool hasWeather = false;
|
||||
|
||||
internal static bool HasWeather()
|
||||
{
|
||||
return hasWeather;
|
||||
}
|
||||
|
||||
internal static void SetWeather(bool isHot)
|
||||
{
|
||||
if (!hasWeather)
|
||||
{
|
||||
hasWeather = true;
|
||||
|
||||
Rectangle2D[] rectArray = { SurvivalCore.GameBounds };
|
||||
|
||||
if (isHot)
|
||||
{
|
||||
_ = new Weather(Map.Felucca, rectArray, 15, 100, 0, TimeSpan.FromSeconds(5));
|
||||
}
|
||||
else
|
||||
{
|
||||
_ = new Weather(Map.Felucca, rectArray, -15, 100, 0, TimeSpan.FromSeconds(5));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal static void EndWeather()
|
||||
{
|
||||
if (hasWeather)
|
||||
{
|
||||
hasWeather = false;
|
||||
|
||||
Weather.Initialize();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+107
@@ -0,0 +1,107 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Server.Custom.UOSurvivalEvent.Islands
|
||||
{
|
||||
internal class BloodIsland : DefaultIsland
|
||||
{
|
||||
public BloodIsland() : base(nameof(BloodIsland))
|
||||
{
|
||||
}
|
||||
|
||||
public override (int ID, int Hue) GetRandomLandTile()
|
||||
{
|
||||
int hue = Utility.RandomList(Utility.RandomRedHue());
|
||||
|
||||
return Utility.RandomList((0x0495, hue), (0x0496, hue), (0x0497, hue), (0x0498, hue), (0x07BD, 1175), (0x07BE, 1175)); // marble
|
||||
}
|
||||
|
||||
public override int GetRandomDecorTile()
|
||||
{
|
||||
if (Utility.RandomDouble() < 0.95)
|
||||
{
|
||||
if (Utility.RandomDouble() < 0.4)
|
||||
{
|
||||
return Utility.RandomList // splatter
|
||||
(
|
||||
0x122A, 0x122B,
|
||||
0x122C, 0x122D,
|
||||
0x122E, 0x122F
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
return Utility.RandomList // blood decor
|
||||
(
|
||||
0x1CDD, 0x1CDE, 0x1CDF,
|
||||
0x1CE0, 0x1CE1, 0x1CE2,
|
||||
0x1CE3, 0x1CE4, 0x1CE5,
|
||||
0x1CE6, 0x1CE7, 0x1CE8,
|
||||
0x1CE9, 0x1CEA, 0x1CEB,
|
||||
0x1CEC, 0x1CED, 0x1CEE,
|
||||
0x1CEF, 0x1CF0, 0x1E90,
|
||||
0x1E91, 0x1E88, 0x1E89
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return Utility.RandomList // Animations
|
||||
(
|
||||
0x374A, 0x42CF,
|
||||
0x4AA4
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
private readonly List<int> m_Splatter = new List<int>()
|
||||
{
|
||||
0x122A, 0x122B,
|
||||
0x122C, 0x122D,
|
||||
0x122E, 0x122F
|
||||
};
|
||||
|
||||
public override void CheckIslandMove(SurvivalTeam myTeam, SurvivalTeam theirTeam, Mobile m)
|
||||
{
|
||||
if (m.Alive && theirTeam.IslandHasPlayer(m))
|
||||
{
|
||||
theirTeam.TeamIsland.CheckTotem(myTeam, theirTeam, m);
|
||||
|
||||
var tiles = theirTeam.IslandStatics?.FindAll(s => s.Location.X == m.Location.X && s.Location.Y == m.Location.Y)?.ToList();
|
||||
|
||||
if (tiles != null && tiles.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < tiles.Count; i++)
|
||||
{
|
||||
if (m_Splatter.Contains(tiles[i].ItemID))
|
||||
{
|
||||
if (Utility.RandomDouble() > m.Skills.MagicResist.Value * 0.01)
|
||||
{
|
||||
SurvivalUtility.PlayBloodEffect(m.Map, m.Location);
|
||||
|
||||
m.Damage(Utility.Random(m.Hits / 2));
|
||||
|
||||
m.SendMessage(53, "You are bleeding to death!");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Utility.RandomDouble() < 0.5 && m.Z <= myTeam.HomeLocation.Z)
|
||||
{
|
||||
SurvivalUtility.PlayBloodEffect(m.Map, m.Location);
|
||||
|
||||
m.Damage(Utility.RandomMinMax(5, 15));
|
||||
|
||||
m.SendMessage(53, "You are bleeding to death!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SurvivalUtility.TryResPlayer(m, myTeam);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+138
@@ -0,0 +1,138 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Custom.UOSurvivalEvent.Islands
|
||||
{
|
||||
public class DefaultIsland
|
||||
{
|
||||
public string Name { get; private set; } = nameof(DefaultIsland);
|
||||
|
||||
public DefaultIsland()
|
||||
{
|
||||
}
|
||||
|
||||
public DefaultIsland(string name)
|
||||
{
|
||||
Name = name;
|
||||
}
|
||||
|
||||
public virtual (int ID, int Hue) GetRandomLandTile()
|
||||
{
|
||||
if (Utility.RandomDouble() < 0.5)
|
||||
{
|
||||
return Utility.RandomList((0x9B34, 2498), (0x9B39, 2749), (0x9B3A, 2753), (0x9B3B, 2743));
|
||||
}
|
||||
else
|
||||
{
|
||||
return (0x9B34, 2498);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual int GetRandomDecorTile()
|
||||
{
|
||||
return Utility.RandomList(-1);
|
||||
}
|
||||
|
||||
public virtual void CheckIslandMove(SurvivalTeam myTeam, SurvivalTeam theirTeam, Mobile m)
|
||||
{
|
||||
if (m.Alive && theirTeam.IslandHasPlayer(m))
|
||||
{
|
||||
var tiles = theirTeam.IslandStatics?.FindAll(s => s.Location.X == m.Location.X && s.Location.Y == m.Location.Y)?.ToList();
|
||||
|
||||
if (tiles != null && tiles.Count > 0)
|
||||
{
|
||||
theirTeam.TeamIsland.CheckTotem(myTeam, theirTeam, m);
|
||||
|
||||
foreach (var tile in tiles)
|
||||
{
|
||||
if (SurvivalCore.MaskTiles.Contains(tile.ItemID))
|
||||
{
|
||||
tile.Delete();
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (tile.ItemID)
|
||||
{
|
||||
case 0x9B34: // Safe Tile
|
||||
{
|
||||
m.SendMessage(62, "That was safe!");
|
||||
|
||||
SurvivalUtility.PlayHealEffect(myTeam.TeamTotem.Map, myTeam.TeamTotem.Location);
|
||||
|
||||
if (Utility.RandomDouble() < 0.1)
|
||||
{
|
||||
m.Heal(Utility.RandomMinMax(1, 10));
|
||||
|
||||
m.Say(62, "That felt goood!");
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 0x9B39: // Damage Tile
|
||||
{
|
||||
m.SendMessage(42, "That was damaging, opps!");
|
||||
|
||||
SurvivalUtility.PlayDamageEffect(myTeam.TeamTotem.Map, myTeam.TeamTotem.Location);
|
||||
|
||||
if (m.Alive)
|
||||
{
|
||||
if (m.Hits > 10)
|
||||
{
|
||||
m.Damage(Utility.RandomMinMax(m.Hits / 10, m.Hits / 2));
|
||||
}
|
||||
else
|
||||
{
|
||||
m.Damage(Utility.RandomMinMax(1, m.Hits - 1));
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 0x9B3A: // Lethal
|
||||
{
|
||||
m.SendMessage(42, "That was lethal, oh my you might die!");
|
||||
|
||||
if (m.Alive && m.Hits > 0)
|
||||
{
|
||||
m.Damage(m.Hits - 1);
|
||||
|
||||
if (!m.Poisoned)
|
||||
{
|
||||
m.ApplyPoison(m, Poison.Lethal);
|
||||
|
||||
SurvivalUtility.PlayPoisonEffect(m, myTeam.TeamTotem.Map, myTeam.TeamTotem.Location);
|
||||
}
|
||||
else
|
||||
{
|
||||
SurvivalUtility.PlayDamageEffect(myTeam.TeamTotem.Map, myTeam.TeamTotem.Location);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 0x9B3B: // Teleport
|
||||
{
|
||||
m.SendMessage(42, "That was unlucky, start again!");
|
||||
|
||||
SurvivalUtility.ReturnHome(m, myTeam);
|
||||
|
||||
SurvivalCore.SendTotemMsg(myTeam, "Hurry up, get back into the fight!");
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SurvivalUtility.TryResPlayer(m, myTeam);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+232
@@ -0,0 +1,232 @@
|
||||
using System.Linq;
|
||||
|
||||
namespace Server.Custom.UOSurvivalEvent.Islands
|
||||
{
|
||||
internal class DesertIsland : DefaultIsland
|
||||
{
|
||||
public DesertIsland() : base(nameof(DesertIsland))
|
||||
{
|
||||
}
|
||||
|
||||
public override (int ID, int Hue) GetRandomLandTile()
|
||||
{
|
||||
return Utility.RandomList // sand
|
||||
(
|
||||
(0x245E, 0), (0x245F, 0),
|
||||
(0x2460, 0), (0x2461, 0),
|
||||
(0x2462, 0), (0x2463, 0),
|
||||
(0x2468, 0), (0x2469, 0),
|
||||
(0x246A, 0), (0x246B, 0)
|
||||
);
|
||||
}
|
||||
|
||||
public override int GetRandomDecorTile()
|
||||
{
|
||||
if (Utility.RandomDouble() < 0.5)
|
||||
{
|
||||
if (Utility.RandomDouble() < 0.2)
|
||||
{
|
||||
return Utility.RandomList(0x2464, 0x2465); // hot rocks
|
||||
}
|
||||
else
|
||||
{
|
||||
return Utility.RandomList // misc items
|
||||
(
|
||||
0x24D5, 0x24D6, 0x24D7,
|
||||
0x24D8, 0x24D9, 0x24DA,
|
||||
0x24DB, 0x24DC, 0x24DD,
|
||||
0x24DE, 0x24DF, 0x24E0
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Utility.RandomDouble() < 0.2)
|
||||
{
|
||||
return Utility.RandomList(0x2466, 0x2467); // hot rocks
|
||||
}
|
||||
else
|
||||
{
|
||||
return Utility.RandomList(0x246C, 0x246D, 0x246E, 0x246F, 0x2470); // Bamboo
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void CheckIslandMove(SurvivalTeam myTeam, SurvivalTeam theirTeam, Mobile m)
|
||||
{
|
||||
if (m.Alive && theirTeam.IslandHasPlayer(m))
|
||||
{
|
||||
theirTeam.TeamIsland.CheckTotem(myTeam, theirTeam, m);
|
||||
|
||||
var tiles = theirTeam.IslandStatics?.FindAll(s => s.Location.X == m.Location.X && s.Location.Y == m.Location.Y)?.ToList();
|
||||
|
||||
if (tiles != null && tiles.Count > 0)
|
||||
{
|
||||
bool wasHit = false;
|
||||
|
||||
for (int i = 0; i < tiles.Count; i++)
|
||||
{
|
||||
switch (tiles[i].ItemID)
|
||||
{
|
||||
case 0x2464:
|
||||
{
|
||||
if (Utility.RandomDouble() > m.FireResistance * 0.01)
|
||||
{
|
||||
SurvivalUtility.PlayFireEffect(m.Map, m.Location);
|
||||
|
||||
m.Damage(Utility.RandomMinMax(1, m.Hits / 4));
|
||||
|
||||
m.SendMessage(53, "You sustain heat damage!");
|
||||
|
||||
wasHit = true;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 0x2465:
|
||||
{
|
||||
if (Utility.RandomDouble() > m.ColdResistance * 0.01)
|
||||
{
|
||||
SurvivalUtility.PlayColdEffect(m.Map, m.Location);
|
||||
|
||||
m.Damage(Utility.RandomMinMax(1, m.Hits / 4));
|
||||
|
||||
m.SendMessage(53, "You sustain cold damage!");
|
||||
|
||||
wasHit = true;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 0x2466:
|
||||
{
|
||||
if (Utility.RandomDouble() > m.PoisonResistance * 0.01)
|
||||
{
|
||||
SurvivalUtility.PlayPoisonEffect(m, m.Map, m.Location);
|
||||
|
||||
m.Damage(Utility.RandomMinMax(1, m.Hits / 4));
|
||||
|
||||
m.ApplyPoison(m, Poison.Lesser);
|
||||
|
||||
m.SendMessage(53, "You sustain poison damage!");
|
||||
|
||||
wasHit = true;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 0x2467:
|
||||
{
|
||||
if (Utility.RandomDouble() > m.EnergyResistance * 0.01)
|
||||
{
|
||||
m.BoltEffect(Utility.RandomYellowHue());
|
||||
|
||||
m.Damage(Utility.RandomMinMax(1, m.Hits / 4));
|
||||
|
||||
m.SendMessage(53, "You sustain electrical damage!");
|
||||
|
||||
wasHit = true;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!wasHit && Utility.RandomDouble() < 0.05)
|
||||
{
|
||||
m.Frozen = true;
|
||||
|
||||
SurvivalUtility.PlayWindEffect(m.Map, m.Location);
|
||||
|
||||
if (m.Hits > 9)
|
||||
{
|
||||
m.Damage(Utility.RandomMinMax(1, m.Hits / 10));
|
||||
}
|
||||
else
|
||||
{
|
||||
m.Damage(Utility.RandomMinMax(1, m.Hits - 1));
|
||||
}
|
||||
|
||||
if (Utility.RandomDouble() < 0.1)
|
||||
{
|
||||
m.SendMessage(53, "You sustained damage slipping in the sand!");
|
||||
|
||||
switch (Utility.Random(7))
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
m.Direction = Direction.North;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 1:
|
||||
{
|
||||
m.Direction = Direction.Up;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 2:
|
||||
{
|
||||
m.Direction = Direction.South;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 3:
|
||||
{
|
||||
m.Direction = Direction.Down;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 4:
|
||||
{
|
||||
m.Direction = Direction.West;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 5:
|
||||
{
|
||||
m.Direction = Direction.Left;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 6:
|
||||
{
|
||||
m.Direction = Direction.East;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 7:
|
||||
{
|
||||
m.Direction = Direction.Right;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m.SendMessage(53, "You sustained damage from the sand!");
|
||||
}
|
||||
|
||||
m.Frozen = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SurvivalUtility.TryResPlayer(m, myTeam);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+102
@@ -0,0 +1,102 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Server.Custom.UOSurvivalEvent.Islands
|
||||
{
|
||||
internal class FireIsland : DefaultIsland
|
||||
{
|
||||
public FireIsland() : base(nameof(FireIsland))
|
||||
{
|
||||
}
|
||||
|
||||
public override (int ID, int Hue) GetRandomLandTile()
|
||||
{
|
||||
int hue = Utility.RandomList(Utility.RandomRedHue(), Utility.RandomYellowHue(), Utility.RandomOrangeHue(), 1175);
|
||||
|
||||
return Utility.RandomList((0x0495, hue), (0x0496, hue), (0x0497, hue), (0x0498, hue)); // marble
|
||||
}
|
||||
|
||||
public override int GetRandomDecorTile()
|
||||
{
|
||||
if (Utility.RandomDouble() < 0.9)
|
||||
{
|
||||
if (Utility.RandomDouble() < 0.3)
|
||||
{
|
||||
return Utility.RandomList // cracks
|
||||
(
|
||||
0x1B01, 0x1B02, 0x1B03,
|
||||
0x1B04, 0x1B05, 0x1B06,
|
||||
0x1B07, 0x1B08
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
return Utility.RandomList // stone steps
|
||||
(
|
||||
0x0915, 0x0916,
|
||||
0x0917, 0x0918
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return Utility.RandomList // Animations
|
||||
(
|
||||
0x1A75, 0x2AE4,
|
||||
0x3709, 0x0DE3,
|
||||
0x29FD
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
private readonly List<int> m_Cracks = new List<int>()
|
||||
{
|
||||
0x1B01, 0x1B02, 0x1B03,
|
||||
0x1B04, 0x1B05, 0x1B06,
|
||||
0x1B07, 0x1B08
|
||||
};
|
||||
|
||||
public override void CheckIslandMove(SurvivalTeam myTeam, SurvivalTeam theirTeam, Mobile m)
|
||||
{
|
||||
if (m.Alive && theirTeam.IslandHasPlayer(m))
|
||||
{
|
||||
theirTeam.TeamIsland.CheckTotem(myTeam, theirTeam, m);
|
||||
|
||||
var tiles = theirTeam.IslandStatics?.FindAll(s => s.Location.X == m.Location.X && s.Location.Y == m.Location.Y)?.ToList();
|
||||
|
||||
if (tiles != null && tiles.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < tiles.Count; i++)
|
||||
{
|
||||
if (m_Cracks.Contains(tiles[i].ItemID))
|
||||
{
|
||||
if (Utility.RandomDouble() > m.FireResistance * 0.01)
|
||||
{
|
||||
SurvivalUtility.PlayFireEffect(m.Map, m.Location);
|
||||
|
||||
m.Damage(Utility.Random(m.Hits / 2));
|
||||
|
||||
m.SendMessage(53, "You are burning to death!");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Utility.RandomDouble() < 0.5 && m.Z <= myTeam.HomeLocation.Z)
|
||||
{
|
||||
SurvivalUtility.PlayFireEffect(m.Map, m.Location);
|
||||
|
||||
m.Damage(Utility.RandomMinMax(5, 15));
|
||||
|
||||
m.SendMessage(53, "You are burning to death!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SurvivalUtility.TryResPlayer(m, myTeam);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
using System.Linq;
|
||||
|
||||
namespace Server.Custom.UOSurvivalEvent.Islands
|
||||
{
|
||||
internal class ForestIsland : DefaultIsland
|
||||
{
|
||||
public ForestIsland() : base(nameof(ForestIsland))
|
||||
{
|
||||
}
|
||||
|
||||
public override (int ID, int Hue) GetRandomLandTile()
|
||||
{
|
||||
return (0x337A, 0); // forest
|
||||
}
|
||||
|
||||
public override int GetRandomDecorTile()
|
||||
{
|
||||
if (Utility.RandomDouble() < 0.5)
|
||||
{
|
||||
if (Utility.RandomDouble() < 0.2)
|
||||
{
|
||||
return 0x1125; // killer mushroom
|
||||
}
|
||||
else
|
||||
{
|
||||
return Utility.RandomList(0x0C9F, 0x0CA0, 0x0CA1, 0x0CA2, 0x0CA3, 0x0CA4); // trees
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Utility.RandomDouble() < 0.2)
|
||||
{
|
||||
return 0x1125; // killer mushroom
|
||||
}
|
||||
else
|
||||
{
|
||||
return Utility.RandomList(0xA63F, 0xA640, 0xA641, 0xA642, 0xA643, 0xA644); // ferns
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void CheckIslandMove(SurvivalTeam myTeam, SurvivalTeam theirTeam, Mobile m)
|
||||
{
|
||||
SurvivalUtility.UpdateWeather(true);
|
||||
|
||||
if (m.Alive && theirTeam.IslandHasPlayer(m))
|
||||
{
|
||||
theirTeam.TeamIsland.CheckTotem(myTeam, theirTeam, m);
|
||||
|
||||
var tiles = theirTeam.IslandStatics?.FindAll(s => s.Location.X == m.Location.X && s.Location.Y == m.Location.Y)?.ToList();
|
||||
|
||||
if (tiles != null && tiles.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < tiles.Count; i++)
|
||||
{
|
||||
if (tiles[i].ItemID == 0x1125)
|
||||
{
|
||||
if (Utility.RandomDouble() > (int)m.Skills.DetectHidden.Value * 0.01)
|
||||
{
|
||||
SurvivalUtility.PlayMushroomEffect(tiles[i], tiles[i].Map, tiles[i].Location);
|
||||
|
||||
m.Damage(Utility.RandomMinMax(1, m.Hits - 1));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Utility.RandomDouble() < 0.05)
|
||||
{
|
||||
m.BoltEffect(Utility.RandomBlueHue());
|
||||
|
||||
m.Damage(Utility.RandomMinMax(1, m.Hits - 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SurvivalUtility.TryResPlayer(m, myTeam);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
using Server.Items;
|
||||
using System;
|
||||
|
||||
namespace Server.Custom.UOSurvivalEvent.Islands
|
||||
{
|
||||
public class GrassIsland : DefaultIsland
|
||||
{
|
||||
public GrassIsland() : base(nameof(GrassIsland))
|
||||
{
|
||||
}
|
||||
|
||||
public override (int ID, int Hue) GetRandomLandTile()
|
||||
{
|
||||
return Utility.RandomList((0x177D, 0), (0x177E, 0), (0x177F, 0), (0x1780, 0), (0x1781, 0));
|
||||
}
|
||||
|
||||
public override int GetRandomDecorTile()
|
||||
{
|
||||
return Utility.RandomList(0x0CAC, 0x0CAD, 0x0CAE, 0x0CAF, 0x0CB0, 0x0CB1, 0x0CB2, 0x0CB3, 0x0CB4, 0x0CB5, 0x0CB6, 0x0CC5);
|
||||
}
|
||||
|
||||
private bool inCallBack = false;
|
||||
|
||||
public override void CheckIslandMove(SurvivalTeam myTeam, SurvivalTeam theirTeam, Mobile m)
|
||||
{
|
||||
if (m.Alive && theirTeam.IslandHasPlayer(m))
|
||||
{
|
||||
theirTeam.TeamIsland.CheckTotem(myTeam, theirTeam, m);
|
||||
|
||||
if (!inCallBack && Utility.RandomDouble() > (int)m.Skills.RemoveTrap.Value * 0.01)
|
||||
{
|
||||
inCallBack = true;
|
||||
|
||||
m.Frozen = true;
|
||||
|
||||
m.SendMessage(53, "You are snared by the sticky grass!");
|
||||
|
||||
Static grass = new Static(Utility.RandomList(0x0C55, 0x0C56, 0x0C57, 0x0C58, 0x0C59, 0x0C5A, 0x0C5B))
|
||||
{
|
||||
Hue = Utility.RandomList(2758, 2760)
|
||||
};
|
||||
|
||||
grass.MoveToWorld(new Point3D(m.Location.X, m.Location.Y, m.Location.Z + 3), m.Map);
|
||||
|
||||
Effects.PlaySound(m.Location, m.Map, 0x4F);
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(3), () =>
|
||||
{
|
||||
inCallBack = false;
|
||||
|
||||
m.Frozen = false;
|
||||
|
||||
grass.Delete();
|
||||
|
||||
Effects.PlaySound(m.Location, m.Map, 0x4F);
|
||||
|
||||
if (Utility.RandomDouble() > (int)m.Skills.Wrestling.Value * 0.01)
|
||||
{
|
||||
var max = (int)m.Skills.Wrestling.Value > m.Hits - 1 ? m.Hits - 1 : (int)m.Skills.Wrestling.Value;
|
||||
|
||||
m.Damage(Utility.Random(1, max));
|
||||
|
||||
m.SendMessage(53, "You were damaged by the sticky grass!");
|
||||
}
|
||||
else
|
||||
{
|
||||
m.SendMessage(53, "You freed yourself from the sticky grass!");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SurvivalUtility.TryResPlayer(m, myTeam);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Server.Custom.UOSurvivalEvent.Islands
|
||||
{
|
||||
internal class SnowIsland : DefaultIsland
|
||||
{
|
||||
public SnowIsland() : base(nameof(SnowIsland))
|
||||
{
|
||||
}
|
||||
|
||||
public override (int ID, int Hue) GetRandomLandTile()
|
||||
{
|
||||
return Utility.RandomList((0x17BD, 0), (0x17BE, 0), (0x17BF, 0), (0x17C0, 0), (0x4C0E, 0), (0x4C0F, 0), (0x4C10, 0), (0x4C11, 0)); // snow
|
||||
}
|
||||
|
||||
public override int GetRandomDecorTile()
|
||||
{
|
||||
if (Utility.RandomDouble() < 0.9)
|
||||
{
|
||||
if (Utility.RandomDouble() < 0.3)
|
||||
{
|
||||
return Utility.RandomList(0xA672, 0xA673, 0xA674, 0xA675, 0x17CD, 0x17CE); // Snow Piles
|
||||
}
|
||||
else
|
||||
{
|
||||
return Utility.RandomList // Crystals
|
||||
(
|
||||
0x2FDC, 0x2FDD, 0x2FE6,
|
||||
0x2FE7, 0x9CB6, 0x9CB5,
|
||||
0x2207, 0x2208, 0x2211,
|
||||
0x2212, 0x221B, 0x221C,
|
||||
0x2225, 0x2226, 0x9CB7,
|
||||
0x9CB8, 0x9CAA, 0x9CAB,
|
||||
0x9CAC
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return Utility.RandomList // Animations
|
||||
(
|
||||
0x1153, 0x9CBB, 0x9CC1,
|
||||
0x9CC8, 0x9CB8, 0x9CAC,
|
||||
0x9CAB, 0x483B, 0x4853,
|
||||
0x4883, 0x3967, 0x3979
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
private readonly List<int> m_Piles = new List<int>() { 0xA672, 0xA673, 0xA674, 0xA675, 0x17CD, 0x17CE };
|
||||
|
||||
public override void CheckIslandMove(SurvivalTeam myTeam, SurvivalTeam theirTeam, Mobile m)
|
||||
{
|
||||
SurvivalUtility.UpdateWeather(false);
|
||||
|
||||
if (m.Alive && theirTeam.IslandHasPlayer(m))
|
||||
{
|
||||
theirTeam.TeamIsland.CheckTotem(myTeam, theirTeam, m);
|
||||
|
||||
var tiles = theirTeam.IslandStatics?.FindAll(s => s.Location.X == m.Location.X && s.Location.Y == m.Location.Y)?.ToList();
|
||||
|
||||
if (tiles != null && tiles.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < tiles.Count; i++)
|
||||
{
|
||||
if (m_Piles.Contains(tiles[i].ItemID))
|
||||
{
|
||||
if (Utility.RandomDouble() > m.ColdResistance * 0.01)
|
||||
{
|
||||
SurvivalUtility.PlayColdEffect(m.Map, m.Location);
|
||||
|
||||
m.Damage(Utility.Random(m.Hits / 2));
|
||||
|
||||
m.SendMessage(53, "You are freezing to death!");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Utility.RandomDouble() < 0.1)
|
||||
{
|
||||
SurvivalUtility.PlayColdEffect(m.Map, m.Location);
|
||||
|
||||
m.Damage(Utility.RandomMinMax(5, 15));
|
||||
|
||||
m.SendMessage(53, "You are freezing to death!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SurvivalUtility.TryResPlayer(m, myTeam);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+93
@@ -0,0 +1,93 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Server.Custom.UOSurvivalEvent.Islands
|
||||
{
|
||||
internal class SwampIsland : DefaultIsland
|
||||
{
|
||||
public SwampIsland() : base(nameof(SwampIsland))
|
||||
{
|
||||
}
|
||||
|
||||
public override (int ID, int Hue) GetRandomLandTile()
|
||||
{
|
||||
return Utility.RandomList((0x3258, 0), (0x3259, 0), (0x325A, 0), (0x325B, 0), (0x325C, 0), (0x325D, 0)); // swamp
|
||||
}
|
||||
|
||||
public override int GetRandomDecorTile()
|
||||
{
|
||||
if (Utility.RandomDouble() < 0.9)
|
||||
{
|
||||
if (Utility.RandomDouble() < 0.1)
|
||||
{
|
||||
return Utility.RandomList(0xA85F, 0xA860); // swamp
|
||||
}
|
||||
else
|
||||
{
|
||||
return Utility.RandomList // Logs
|
||||
(
|
||||
0x324B, 0x324C, 0x324D,
|
||||
0x325E, 0x325F, 0x3260,
|
||||
0x1B09, 0x1B0A, 0x1B0B,
|
||||
0x1B0C, 0x1B0D, 0x1B0E,
|
||||
0x1B0F, 0x1B10
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return Utility.RandomList(0x322C, 0x0D05, 0x11A6);
|
||||
}
|
||||
}
|
||||
|
||||
private readonly List<int> m_SwampPiles = new List<int>() { 0xA85F, 0xA860 };
|
||||
|
||||
public override void CheckIslandMove(SurvivalTeam myTeam, SurvivalTeam theirTeam, Mobile m)
|
||||
{
|
||||
if (m.Alive && theirTeam.IslandHasPlayer(m))
|
||||
{
|
||||
theirTeam.TeamIsland.CheckTotem(myTeam, theirTeam, m);
|
||||
|
||||
var tiles = theirTeam.IslandStatics?.FindAll(s => s.Location.X == m.Location.X && s.Location.Y == m.Location.Y)?.ToList();
|
||||
|
||||
if (tiles != null && tiles.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < tiles.Count; i++)
|
||||
{
|
||||
if (m_SwampPiles.Contains(tiles[i].ItemID))
|
||||
{
|
||||
if (Utility.RandomDouble() > m.PoisonResistance * 0.01)
|
||||
{
|
||||
SurvivalUtility.PlayPoisonEffect(m, m.Map, m.Location);
|
||||
|
||||
if (m.Poisoned)
|
||||
{
|
||||
m.Damage(Utility.Random(m.Hits / 2));
|
||||
}
|
||||
else
|
||||
{
|
||||
m.ApplyPoison(m, Utility.RandomList(Poison.Lesser, Poison.Deadly, Poison.Lethal));
|
||||
}
|
||||
|
||||
m.SendMessage(62, "You are being poisoned to death!");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!m.Poisoned && Utility.RandomDouble() < 0.1)
|
||||
{
|
||||
m.ApplyPoison(m, Poison.Lesser);
|
||||
|
||||
m.SendMessage(62, "You are being poisoned to death!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SurvivalUtility.TryResPlayer(m, myTeam);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user