Modernization Fixes & Updates to Default Values (#3)

This commit is contained in:
Kamron Batman 2018-10-28 00:33:16 -07:00 • committed by GitHub
parent 445eddff68
commit dcf64091b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
768 changed files with 10507 additions and 14196 deletions

View file

@ -96,8 +96,8 @@ namespace Server.Mobiles
{
AnimalTaming.ScaleStats(this, 0.50);
AnimalTaming.ScaleSkills(this, 0.80, 0.90); // 90% * 80% = 72% of original skills trainable to 90%
Skills[SkillName.Magery].Base =
Skills[SkillName.Magery]
Skills.Magery.Base =
Skills.Magery
.Cap; // Greater dragons have a 90% cap reduction and 90% skill reduction on magery
}
}

View file

@ -9,9 +9,7 @@ namespace Server.Mobiles
{
public class Ilhenir : BaseChampion
{
private static Hashtable m_Table;
private DateTime m_NextDrop = DateTime.UtcNow;
private static Dictionary<Mobile, Timer> m_Table = new Dictionary<Mobile, Timer>();
[Constructible]
public Ilhenir()
@ -232,41 +230,25 @@ namespace Server.Mobiles
public virtual void CacophonicAttack(Mobile to)
{
if (m_Table == null)
m_Table = new Hashtable();
if (to.Alive && to.Player && m_Table[to] == null)
if (to.Alive && to.Player && !m_Table.ContainsKey(to))
{
to.Send(SpeedControl.WalkSpeed);
to.SendLocalizedMessage(1072069); // A cacophonic sound lambastes you, suppressing your ability to move.
to.PlaySound(0x584);
m_Table[to] = Timer.DelayCall(TimeSpan.FromSeconds(30), new TimerStateCallback(EndCacophonic_Callback), to);
m_Table[to] = Timer.DelayCall(TimeSpan.FromSeconds(30), CacophonicEnd, to);
}
}
private void EndCacophonic_Callback(object state)
{
if (state is Mobile mobile)
CacophonicEnd(mobile);
}
public virtual void CacophonicEnd(Mobile from)
{
if (m_Table == null)
m_Table = new Hashtable();
m_Table[from] = null;
m_Table.Remove(from);
from.Send(SpeedControl.Disable);
}
public static bool UnderCacophonicAttack(Mobile from)
{
if (m_Table == null)
m_Table = new Hashtable();
return m_Table[from] != null;
return m_Table.ContainsKey(from);
}
public virtual void DropOoze()
@ -336,14 +318,7 @@ namespace Server.Mobiles
private Timer m_Timer;
[Constructible]
public StainedOoze()
: this(false)
{
}
[Constructible]
public StainedOoze(bool corrosive)
: base(0x122A)
public StainedOoze(bool corrosive = false) : base(0x122A)
{
Movable = false;
Hue = 0x95;
@ -447,4 +422,4 @@ namespace Server.Mobiles
m_Ticks = ItemID == 0x122A ? 0 : 30;
}
}
}
}

View file

@ -128,34 +128,35 @@ namespace Server.Mobiles
{
base.OnDeath(c);
if (Core.ML)
if (!Core.ML)
return;
c.DropItem(new MalletAndChisel());
switch (Utility.Random(3))
{
c.DropItem(new MalletAndChisel());
switch (Utility.Random(3))
{
case 0:
c.DropItem(new MinotaurHedge());
break;
case 1:
c.DropItem(new BonePile());
break;
case 2:
c.DropItem(new LightYarn());
break;
}
if (Utility.RandomBool())
c.DropItem(new TormentedChains());
if (Utility.RandomDouble() < 0.025)
c.DropItem(new CrimsonCincture());
case 0:
c.DropItem(new MinotaurHedge());
break;
case 1:
c.DropItem(new BonePile());
break;
case 2:
c.DropItem(new LightYarn());
break;
}
if (Utility.RandomBool())
c.DropItem(new TormentedChains());
if (Utility.RandomDouble() < 0.025)
c.DropItem(new CrimsonCincture());
}
public override void GenerateLoot()
{
if (Core.ML) AddLoot(LootPack.AosSuperBoss, 5); // Need to verify
if (Core.ML)
AddLoot(LootPack.AosSuperBoss, 5); // Need to verify
}
public override int GetAngerSound()
@ -186,43 +187,36 @@ namespace Server.Mobiles
public override void OnGaveMeleeAttack(Mobile defender)
{
base.OnGaveMeleeAttack(defender);
if (0.2 >= Utility.RandomDouble())
Earthquake();
}
public void Earthquake()
{
Map map = Map;
if (map == null)
return;
ArrayList targets = new ArrayList();
foreach (Mobile m in GetMobilesInRange(8))
{
if (m == this || !CanBeHarmful(m))
continue;
if (m is BaseCreature creature && (creature.Controlled || creature.Summoned || creature.Team != Team))
targets.Add(m);
else if (m.Player)
targets.Add(m);
}
IPooledEnumerable<Mobile> eable = GetMobilesInRange(8);
PlaySound(0x2F3);
for (int i = 0; i < targets.Count; ++i)
foreach (Mobile m in eable)
{
Mobile m = (Mobile)targets[i];
if (m != null && !m.Deleted && m is PlayerMobile pm)
if (pm.Mounted)
if (m == this || !CanBeHarmful(m) || m.Deleted || !m.Player &&
!(m is BaseCreature creature && (creature.Controlled || creature.Summoned || creature.Team != Team)))
continue;
if (m is PlayerMobile pm && pm.Mounted)
pm.Mount.Rider = null;
double damage = m.Hits * 0.6; //was .6
if (damage < 10.0)
damage = 10.0;
else if (damage > 75.0)
damage = 75.0;
int damage = (int)(m.Hits * 0.6);
if (damage < 10)
damage = 10;
else if (damage > 75)
damage = 75;
DoHarmful(m);
AOS.Damage(m, this, (int)damage, 100, 0, 0, 0, 0);
AOS.Damage(m, this, damage, 100, 0, 0, 0, 0);
if (m.Alive && m.Body.IsHuman && !m.Mounted)
m.Animate(20, 7, 1, true, false, 0); // take hit
}
eable.Free();
}
public override void Serialize(GenericWriter writer)
@ -256,4 +250,4 @@ namespace Server.Mobiles
#endregion
}
}
}

View file

@ -92,27 +92,9 @@ namespace Server.Mobiles
for (int i = 0; i < newPixies; ++i)
{
Pixie pixie = new Pixie();
Pixie pixie = new Pixie { Team = Team, FightMode = FightMode.Closest };
pixie.Team = Team;
pixie.FightMode = FightMode.Closest;
bool validLocation = false;
Point3D loc = Location;
for (int j = 0; !validLocation && j < 10; ++j)
{
int x = X + Utility.Random(3) - 1;
int y = Y + Utility.Random(3) - 1;
int z = map.GetAverageZ(x, y);
if (validLocation = map.CanFit(x, y, Z, 16, false, false))
loc = new Point3D(x, y, Z);
else if (validLocation = map.CanFit(x, y, z, 16, false, false))
loc = new Point3D(x, y, z);
}
pixie.MoveToWorld(loc, map);
pixie.MoveToWorld(map.GetRandomNearbyLocation(Location), map);
pixie.Combatant = target;
}
}
@ -153,4 +135,4 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
}
}
}

View file

@ -1,11 +1,12 @@
using System;
using System.Collections;
using System.Collections.Generic;
namespace Server.Mobiles
{
public class Swoop : Eagle
{
private static Hashtable m_Table = new Hashtable();
private static Dictionary<Mobile, ExpireTimer> m_Table = new Dictionary<Mobile, ExpireTimer>();
[Constructible]
public Swoop()
@ -102,7 +103,7 @@ namespace Server.Mobiles
if (0.1 > Utility.RandomDouble())
{
ExpireTimer timer = (ExpireTimer)m_Table[defender];
ExpireTimer timer = m_Table[defender];
if (timer != null)
{
@ -169,4 +170,4 @@ namespace Server.Mobiles
}
}
}
}
}