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

@ -1,4 +1,5 @@
using System;
using System.Linq;
using Server.Engines.CannedEvil;
using Server.Items;
using Server.Spells.Fifth;
@ -91,7 +92,7 @@ namespace Server.Mobiles
public void Polymorph(Mobile m)
{
if (!m.CanBeginAction(typeof(PolymorphSpell)) || !m.CanBeginAction(typeof(IncognitoSpell)) || m.IsBodyMod)
if (!m.CanBeginAction<PolymorphSpell>() || !m.CanBeginAction<IncognitoSpell>() || m.IsBodyMod)
return;
IMount mount = m.Mount;
@ -102,7 +103,7 @@ namespace Server.Mobiles
if (m.Mounted)
return;
if (m.BeginAction(typeof(PolymorphSpell)))
if (m.BeginAction<PolymorphSpell>())
{
Item disarm = m.FindItemOnLayer(Layer.OneHanded);
@ -128,58 +129,38 @@ namespace Server.Mobiles
if (map == null)
return;
int rats = 0;
IPooledEnumerable <BaseCreature> eable = GetMobilesInRange<BaseCreature>(10);
int rats = eable.Aggregate(0, (c, m) => c + (m is Ratman || m is RatmanArcher || m is RatmanMage ? 1 : 0));
eable.Free();
foreach (Mobile m in GetMobilesInRange(10))
if (m is Ratman || m is RatmanArcher || m is RatmanMage)
++rats;
if (rats >= 16)
return;
if (rats < 16)
PlaySound(0x3D);
rats = Utility.RandomMinMax(3, 6);
for (int i = 0; i < rats; ++i)
{
PlaySound(0x3D);
BaseCreature rat;
int newRats = Utility.RandomMinMax(3, 6);
for (int i = 0; i < newRats; ++i)
switch (Utility.Random(5))
{
BaseCreature rat;
switch (Utility.Random(5))
{
default:
case 0:
case 1:
rat = new Ratman();
break;
case 2:
case 3:
rat = new RatmanArcher();
break;
case 4:
rat = new RatmanMage();
break;
}
rat.Team = Team;
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);
}
rat.MoveToWorld(loc, map);
rat.Combatant = target;
default:
rat = new Ratman();
break;
case 2:
case 3:
rat = new RatmanArcher();
break;
case 4:
rat = new RatmanMage();
break;
}
rat.Team = Team;
rat.MoveToWorld(map.GetRandomNearbyLocation(Location), map);
rat.Combatant = target;
}
}
@ -187,6 +168,7 @@ namespace Server.Mobiles
{
if (target == null || target.Deleted) //sanity
return;
if (0.6 >= Utility.RandomDouble()) // 60% chance to polymorph attacker into a ratman
Polymorph(target);
@ -238,13 +220,13 @@ namespace Server.Mobiles
protected override void OnTick()
{
if (!m_Owner.CanBeginAction(typeof(PolymorphSpell)))
if (!m_Owner.CanBeginAction<PolymorphSpell>())
{
m_Owner.BodyMod = 0;
m_Owner.HueMod = -1;
m_Owner.EndAction(typeof(PolymorphSpell));
m_Owner.EndAction<PolymorphSpell>();
}
}
}
}
}
}

View file

@ -12,7 +12,7 @@ namespace Server.Mobiles
SpeechHue = Utility.RandomDyedHue();
Hue = Utility.RandomSkinHue();
Hue = Race.Human.RandomSkinHue();
if (Female = Utility.RandomBool())
{
@ -80,11 +80,11 @@ namespace Server.Mobiles
PackGold(250, 500);
Skills[SkillName.Anatomy].Base = 120.0;
Skills[SkillName.Tactics].Base = 120.0;
Skills[SkillName.Swords].Base = 120.0;
Skills[SkillName.MagicResist].Base = 120.0;
Skills[SkillName.DetectHidden].Base = 100.0;
Skills.Anatomy.Base = 120.0;
Skills.Tactics.Base = 120.0;
Skills.Swords.Base = 120.0;
Skills.MagicResist.Base = 120.0;
Skills.DetectHidden.Base = 100.0;
}
public BaseShieldGuard(Serial serial) : base(serial)

View file

@ -20,10 +20,10 @@ namespace Server.Mobiles
double dPassiveSpeed) : base(iAI, iFightMode, iRangePerception, iRangeFight, dActiveSpeed, dPassiveSpeed)
{
Body = 400 + Utility.Random(2);
Hue = Utility.RandomSkinHue();
Hue = Race.Human.RandomSkinHue();
Skills[SkillName.DetectHidden].Base = 100;
Skills[SkillName.MagicResist].Base = 120;
Skills.DetectHidden.Base = 100;
Skills.MagicResist.Base = 120;
Team = Utility.Random(3);

View file

@ -23,10 +23,10 @@ namespace Server.Mobiles
// Skills and Stats
InitStats(125, 125, 90);
Skills[SkillName.Macing].Base = 120;
Skills[SkillName.Anatomy].Base = 120;
Skills[SkillName.Healing].Base = 120;
Skills[SkillName.Tactics].Base = 120;
Skills.Macing.Base = 120;
Skills.Anatomy.Base = 120;
Skills.Healing.Base = 120;
Skills.Tactics.Base = 120;
// Equip
WarHammer war = new WarHammer();
@ -96,10 +96,10 @@ namespace Server.Mobiles
// Skills and Stats
InitStats(125, 125, 90);
Skills[SkillName.Fencing].Base = 120;
Skills[SkillName.Anatomy].Base = 120;
Skills[SkillName.Healing].Base = 120;
Skills[SkillName.Tactics].Base = 120;
Skills.Fencing.Base = 120;
Skills.Anatomy.Base = 120;
Skills.Healing.Base = 120;
Skills.Tactics.Base = 120;
// Equip
Spear ssp = new Spear();
@ -170,11 +170,11 @@ namespace Server.Mobiles
// Skills and Stats
InitStats(125, 125, 90);
Skills[SkillName.Swords].Base = 120;
Skills[SkillName.Anatomy].Base = 120;
Skills[SkillName.Healing].Base = 120;
Skills[SkillName.Tactics].Base = 120;
Skills[SkillName.Parry].Base = 120;
Skills.Swords.Base = 120;
Skills.Anatomy.Base = 120;
Skills.Healing.Base = 120;
Skills.Tactics.Base = 120;
Skills.Parry.Base = 120;
// Equip
Katana kat = new Katana();
@ -244,12 +244,12 @@ namespace Server.Mobiles
// Skills and Stats
InitStats(90, 90, 125);
Skills[SkillName.Magery].Base = 120;
Skills[SkillName.EvalInt].Base = 120;
Skills[SkillName.Inscribe].Base = 100;
Skills[SkillName.Wrestling].Base = 120;
Skills[SkillName.Meditation].Base = 120;
Skills[SkillName.Poisoning].Base = 100;
Skills.Magery.Base = 120;
Skills.EvalInt.Base = 120;
Skills.Inscribe.Base = 100;
Skills.Wrestling.Base = 120;
Skills.Meditation.Base = 120;
Skills.Poisoning.Base = 100;
// Equip
Spellbook book = new Spellbook();
@ -311,12 +311,12 @@ namespace Server.Mobiles
// Skills and Stats
InitStats(90, 90, 125);
Skills[SkillName.Magery].Base = 100;
Skills[SkillName.EvalInt].Base = 120;
Skills[SkillName.Anatomy].Base = 80;
Skills[SkillName.Wrestling].Base = 80;
Skills[SkillName.Meditation].Base = 100;
Skills[SkillName.Poisoning].Base = 100;
Skills.Magery.Base = 100;
Skills.EvalInt.Base = 120;
Skills.Anatomy.Base = 80;
Skills.Wrestling.Base = 80;
Skills.Meditation.Base = 100;
Skills.Poisoning.Base = 100;
// Equip
Spellbook book = new Spellbook();
@ -401,13 +401,13 @@ namespace Server.Mobiles
// Skills and Stats
InitStats(125, 125, 125);
Skills[SkillName.Magery].Base = 120;
Skills[SkillName.EvalInt].Base = 120;
Skills[SkillName.Anatomy].Base = 120;
Skills[SkillName.Wrestling].Base = 120;
Skills[SkillName.Meditation].Base = 120;
Skills[SkillName.Poisoning].Base = 100;
Skills[SkillName.Inscribe].Base = 100;
Skills.Magery.Base = 120;
Skills.EvalInt.Base = 120;
Skills.Anatomy.Base = 120;
Skills.Wrestling.Base = 120;
Skills.Meditation.Base = 120;
Skills.Poisoning.Base = 100;
Skills.Inscribe.Base = 100;
// Equip
Spellbook book = new Spellbook();
@ -497,12 +497,12 @@ namespace Server.Mobiles
// Skills and Stats
InitStats(125, 125, 125);
Skills[SkillName.Magery].Base = 120;
Skills[SkillName.EvalInt].Base = 120;
Skills[SkillName.Anatomy].Base = 120;
Skills[SkillName.Wrestling].Base = 120;
Skills[SkillName.Meditation].Base = 120;
Skills[SkillName.Healing].Base = 100;
Skills.Magery.Base = 120;
Skills.EvalInt.Base = 120;
Skills.Anatomy.Base = 120;
Skills.Wrestling.Base = 120;
Skills.Meditation.Base = 120;
Skills.Healing.Base = 100;
// Equip
Spellbook book = new Spellbook();
@ -585,12 +585,12 @@ namespace Server.Mobiles
// Skills and Stats
InitStats(105, 105, 105);
Skills[SkillName.Magery].Base = 120;
Skills[SkillName.EvalInt].Base = 120;
Skills[SkillName.Swords].Base = 120;
Skills[SkillName.Tactics].Base = 120;
Skills[SkillName.Meditation].Base = 120;
Skills[SkillName.Poisoning].Base = 100;
Skills.Magery.Base = 120;
Skills.EvalInt.Base = 120;
Skills.Swords.Base = 120;
Skills.Tactics.Base = 120;
Skills.Meditation.Base = 120;
Skills.Poisoning.Base = 100;
// Equip
Spellbook book = new Spellbook();
@ -702,12 +702,12 @@ namespace Server.Mobiles
// Skills and Stats
InitStats(105, 105, 105);
Skills[SkillName.Healing].Base = 120;
Skills[SkillName.Anatomy].Base = 120;
Skills[SkillName.Stealing].Base = 120;
Skills[SkillName.ArmsLore].Base = 100;
Skills[SkillName.Meditation].Base = 120;
Skills[SkillName.Wrestling].Base = 120;
Skills.Healing.Base = 120;
Skills.Anatomy.Base = 120;
Skills.Stealing.Base = 120;
Skills.ArmsLore.Base = 100;
Skills.Meditation.Base = 120;
Skills.Wrestling.Base = 120;
// Equip
Spellbook book = new Spellbook();

View file

@ -93,7 +93,7 @@ namespace Server.Mobiles
public Type[] SharedList => new[] { typeof(TheRobeOfBritanniaAri) };
public Type[] DecorativeList => new[] { typeof(EvilIdolSkull), typeof(SkullPole) };
public static ArrayList Instances{ get; } = new ArrayList();
public static List<Harrower> Instances{ get; } = new List<Harrower>();
public static bool CanSpawn => Instances.Count == 0;
@ -184,9 +184,7 @@ namespace Server.Mobiles
if (!ok)
continue;
HarrowerTentacles spawn = new HarrowerTentacles(this);
spawn.Team = Team;
HarrowerTentacles spawn = new HarrowerTentacles(this) { Team = Team };
spawn.MoveToWorld(new Point3D(x, y, z), map);
@ -653,4 +651,4 @@ namespace Server.Mobiles
}
}
}
}
}

View file

@ -1,5 +1,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
namespace Server.Mobiles
{
@ -140,7 +141,6 @@ namespace Server.Mobiles
public override void OnAfterDelete()
{
m_Timer?.Stop();
m_Timer = null;
base.OnAfterDelete();
@ -148,7 +148,6 @@ namespace Server.Mobiles
private class DrainTimer : Timer
{
private static ArrayList m_ToDrain = new ArrayList();
private HarrowerTentacles m_Owner;
public DrainTimer(HarrowerTentacles owner) : base(TimeSpan.FromSeconds(5.0), TimeSpan.FromSeconds(5.0))
@ -165,24 +164,16 @@ namespace Server.Mobiles
return;
}
foreach (Mobile m in m_Owner.GetMobilesInRange(9))
IPooledEnumerable<Mobile> eable = m_Owner.GetMobilesInRange<Mobile>(9);
foreach (Mobile m in eable)
{
if (m == m_Owner || m == m_Owner.Harrower || !m_Owner.CanBeHarmful(m))
if (m == m_Owner || !(m_Owner.CanBeHarmful(m) || m.Player && m.Alive))
continue;
if (m is BaseCreature bc)
{
if (bc.Controlled || bc.Summoned)
m_ToDrain.Add(m);
}
else if (m.Player)
{
m_ToDrain.Add(m);
}
}
if (!(m is BaseCreature bc) || !(bc.Controlled || bc.Summoned || bc.Team != m_Owner.Team))
continue;
foreach (Mobile m in m_ToDrain)
{
m_Owner.DoHarmful(m);
m.FixedParticles(0x374A, 10, 15, 5013, 0x455, 0, EffectLayer.Waist);
@ -198,8 +189,8 @@ namespace Server.Mobiles
m.Damage(drain, m_Owner);
}
m_ToDrain.Clear();
eable.Free();
}
}
}
}
}

View file

@ -6,7 +6,7 @@ namespace Server.Mobiles
{
public class LordOaks : BaseChampion
{
private Mobile m_Queen;
private BaseCreature m_Queen;
private bool m_SpawnedQueen;
[Constructible]
@ -102,27 +102,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;
}
}
@ -161,18 +143,13 @@ namespace Server.Mobiles
{
Say(1042153); // Come forth my queen!
m_Queen = new Silvani();
((BaseCreature)m_Queen).Team = Team;
m_Queen = new Silvani { Team = Team };
m_Queen.MoveToWorld(Location, Map);
m_SpawnedQueen = true;
}
else if (m_Queen != null && m_Queen.Deleted)
{
else if (m_Queen?.Deleted != false)
m_Queen = null;
}
}
public override void AlterDamageScalarFrom(Mobile caster, ref double scalar)
@ -231,7 +208,7 @@ namespace Server.Mobiles
{
case 0:
{
m_Queen = reader.ReadMobile();
m_Queen = reader.ReadMobile<BaseCreature>();
m_SpawnedQueen = reader.ReadBool();
break;
@ -239,4 +216,4 @@ namespace Server.Mobiles
}
}
}
}
}

View file

@ -214,7 +214,7 @@ namespace Server.Mobiles
m_Item = item;
}
public Mobile Rider
Mobile IMount.Rider
{
get => m_Item.Rider;
set { }

View file

@ -95,25 +95,17 @@ namespace Server.Mobiles
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);
}
PlaySound(0x2F3);
for (int i = 0; i < targets.Count; ++i)
IPooledEnumerable<Mobile> eable = GetMobilesInRange<Mobile>(8);
foreach (Mobile m in eable)
{
Mobile m = (Mobile)targets[i];
if (m == this || !(CanBeHarmful(m) || m.Player && m.Alive))
continue;
if (!(m is BaseCreature bc) || !(bc.Controlled || bc.Summoned || bc.Team != Team))
continue;
double damage = m.Hits * 0.6;
@ -129,6 +121,8 @@ namespace Server.Mobiles
if (m.Alive && m.Body.IsHuman && !m.Mounted)
m.Animate(20, 7, 1, true, false, 0); // take hit
}
eable.Free();
}
public override int GetAngerSound()
@ -170,4 +164,4 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
}
}
}

View file

@ -87,22 +87,16 @@ namespace Server.Mobiles
if (Map == null)
return;
ArrayList list = new ArrayList();
IPooledEnumerable<Mobile> eable = GetMobilesInRange<Mobile>(2);
foreach (Mobile m in GetMobilesInRange(2))
foreach (Mobile m in eable)
{
if (m == this || !CanBeHarmful(m))
if (m == this || !(CanBeHarmful(m) || m.Player && m.Alive))
continue;
if (m is BaseCreature creature && (creature.Controlled || creature.Summoned ||
creature.Team != Team))
list.Add(m);
else if (m.Player)
list.Add(m);
}
if (!(m is BaseCreature bc) || !(bc.Controlled || bc.Summoned || bc.Team != Team))
continue;
foreach (Mobile m in list)
{
DoHarmful(m);
m.FixedParticles(0x374A, 10, 15, 5013, 0x496, 0, EffectLayer.Waist);
@ -115,6 +109,8 @@ namespace Server.Mobiles
Hits += toDrain;
m.Damage(toDrain, this);
}
eable.Free();
}
public override void OnGaveMeleeAttack(Mobile defender)
@ -145,4 +141,4 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
}
}
}

View file

@ -128,42 +128,37 @@ namespace Server.Mobiles
if (!(0.2 > Utility.RandomDouble()))
return;
BaseCreature bc = attacker as BaseCreature;
Mobile target = null;
if (attacker is BaseCreature bcAttacker)
{
if (bcAttacker.BardProvoked)
return;
target = bcAttacker.GetMaster();
}
if (bc?.BardProvoked == true)
return;
/* Counterattack with Hit Poison Area
* 20-25 damage, unresistable
* Lethal poison, 100% of the time
* Particle effect: Type: "2" From: "0x4061A107" To: "0x0" ItemId: "0x36BD" ItemIdName: "explosion" FromLocation: "(296 615, 17)" ToLocation: "(296 615, 17)" Speed: "1" Duration: "10" FixedDirection: "True" Explode: "False" Hue: "0xA6" RenderMode: "0x0" Effect: "0x1F78" ExplodeEffect: "0x1" ExplodeSound: "0x0" Serial: "0x4061A107" Layer: "255" Unknown: "0x0"
* Doesn't work on provoked monsters
*/
* 20-25 damage, unresistable
* Lethal poison, 100% of the time
* Particle effect: Type: "2" From: "0x4061A107" To: "0x0" ItemId: "0x36BD" ItemIdName: "explosion" FromLocation: "(296 615, 17)" ToLocation: "(296 615, 17)" Speed: "1" Duration: "10" FixedDirection: "True" Explode: "False" Hue: "0xA6" RenderMode: "0x0" Effect: "0x1F78" ExplodeEffect: "0x1" ExplodeSound: "0x0" Serial: "0x4061A107" Layer: "255" Unknown: "0x0"
* Doesn't work on provoked monsters
*/
Mobile target = bc?.GetMaster();
if (target == null || !target.InRange(this, 25))
if (target?.InRange(this, 25) != true)
target = attacker;
Animate(10, 4, 1, true, false, 0);
ArrayList targets = new ArrayList();
IPooledEnumerable<Mobile> eable = target.GetMobilesInRange<Mobile>(8);
foreach (Mobile m in target.GetMobilesInRange(8))
foreach (Mobile m in eable)
{
if (m == this || !CanBeHarmful(m))
if (m == this || !(CanBeHarmful(m) || m.Player && m.Alive))
continue;
if (m is BaseCreature creature && (creature.Controlled || creature.Summoned ||
creature.Team != Team))
targets.Add(m);
else if (m.Player)
targets.Add(m);
}
for (int i = 0; i < targets.Count; ++i)
{
Mobile m = (Mobile)targets[i];
if (!(m is BaseCreature bc) || !(bc.Controlled || bc.Summoned || bc.Team != Team))
continue;
DoHarmful(m);
@ -188,4 +183,4 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
}
}
}

View file

@ -67,27 +67,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;
}
}
@ -129,4 +111,4 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
}
}
}