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,5 +1,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Server.Engines.Plants;
using Server.Items;
@ -7,7 +8,7 @@ namespace Server.Mobiles
{
public class BakeKitsune : BaseCreature
{
private static Hashtable m_Table = new Hashtable();
private static Dictionary<Mobile, ExpireTimer> m_Table = new Dictionary<Mobile, ExpireTimer>();
[Constructible]
public BakeKitsune() : base(AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4)
@ -88,9 +89,10 @@ namespace Server.Mobiles
{
base.OnGaveMeleeAttack(defender);
if (0.1 > Utility.RandomDouble())
{
/* Blood Bath
if (!(0.1 > Utility.RandomDouble()))
return;
/* Blood Bath
* Start cliloc 1070826
* Sound: 0x52B
* 2-3 blood spots
@ -98,22 +100,21 @@ namespace Server.Mobiles
* End cliloc: 1070824
*/
ExpireTimer timer = (ExpireTimer)m_Table[defender];
ExpireTimer timer = m_Table[defender];
if (timer != null)
{
timer.DoExpire();
defender.SendLocalizedMessage(1070825); // The creature continues to rage!
}
else
{
defender.SendLocalizedMessage(1070826); // The creature goes into a rage, inflicting heavy damage!
}
timer = new ExpireTimer(defender, this);
timer.Start();
m_Table[defender] = timer;
if (timer != null)
{
timer.DoExpire();
defender.SendLocalizedMessage(1070825); // The creature continues to rage!
}
else
{
defender.SendLocalizedMessage(1070826); // The creature goes into a rage, inflicting heavy damage!
}
timer = new ExpireTimer(defender, this);
timer.Start();
m_Table[defender] = timer;
}
public override int GetAngerSound()
@ -286,4 +287,4 @@ namespace Server.Mobiles
#endregion
}
}
}

View file

@ -8,7 +8,7 @@ namespace Server.Mobiles
public EliteNinja() : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4)
{
SpeechHue = Utility.RandomDyedHue();
Hue = Utility.RandomSkinHue();
Hue = Race.Human.RandomSkinHue();
Female = Utility.RandomBool();
Body = Female ? 0x191 : 0x190;

View file

@ -1,5 +1,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Server.Engines.Plants;
using Server.Items;
using Server.Network;
@ -8,7 +9,7 @@ namespace Server.Mobiles
{
public class FanDancer : BaseCreature
{
private static Hashtable m_Table = new Hashtable();
private static Dictionary<Mobile, ExpireTimer> m_Table = new Dictionary<Mobile, ExpireTimer>();
[Constructible]
public FanDancer() : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4)
@ -148,7 +149,7 @@ namespace Server.Mobiles
public bool IsFanned(Mobile m)
{
return m_Table.Contains(m);
return m_Table.ContainsKey(m);
}
public override void Serialize(GenericWriter writer)
@ -186,4 +187,4 @@ namespace Server.Mobiles
}
}
}
}
}

View file

@ -1,5 +1,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Server.Engines.Plants;
using Server.Items;
@ -7,7 +8,7 @@ namespace Server.Mobiles
{
public class Kappa : BaseCreature
{
private static Hashtable m_Table = new Hashtable();
private static Dictionary<Mobile, InternalTimer> m_Table = new Dictionary<Mobile, InternalTimer>();
[Constructible]
public Kappa() : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4)
@ -110,19 +111,17 @@ namespace Server.Mobiles
public static bool IsBeingDrained(Mobile m)
{
return m_Table.Contains(m);
return m_Table.ContainsKey(m);
}
public static void BeginLifeDrain(Mobile m, Mobile from)
{
Timer t = (Timer)m_Table[m];
InternalTimer timer = m_Table[m];
t?.Stop();
timer?.Stop();
m_Table[m] = timer = new InternalTimer(from, m);
t = new InternalTimer(from, m);
m_Table[m] = t;
t.Start();
timer.Start();
}
public static void DrainLife(Mobile m, Mobile from)
@ -140,9 +139,8 @@ namespace Server.Mobiles
public static void EndLifeDrain(Mobile m)
{
Timer t = (Timer)m_Table[m];
t?.Stop();
Timer timer = m_Table[m];
timer?.Stop();
m_Table.Remove(m);
@ -169,7 +167,6 @@ namespace Server.Mobiles
from.SendLocalizedMessage(1070820);
if (Mana > 14)
Mana -= 15;
amt ^= amt;
}
}
@ -215,4 +212,4 @@ namespace Server.Mobiles
}
}
}
}
}

View file

@ -1,12 +1,13 @@
using System;
using System.Collections;
using System.Collections.Generic;
namespace Server.Mobiles
{
public class KazeKemono : BaseCreature
{
private static Hashtable m_FlurryOfTwigsTable = new Hashtable();
private static Hashtable m_ChlorophylBlastTable = new Hashtable();
private static Dictionary<Mobile, ExpireTimer> m_FlurryOfTwigsTable = new Dictionary<Mobile, ExpireTimer>();
private static Dictionary<Mobile, ExpireTimer> m_ChlorophylBlastTable = new Dictionary<Mobile, ExpireTimer>();
[Constructible]
public KazeKemono()
@ -73,7 +74,7 @@ namespace Server.Mobiles
* Effect: Type: "3" From: "0x57D4F5B" To: "0x0" ItemId: "0x37B9" ItemIdName: "glow" FromLocation: "(1048 779, 6)" ToLocation: "(1048 779, 6)" Speed: "10" Duration: "5" FixedDirection: "True" Explode: "False"
*/
ExpireTimer timer = (ExpireTimer)m_FlurryOfTwigsTable[defender];
ExpireTimer timer = m_FlurryOfTwigsTable[defender];
if (timer != null)
{
@ -106,7 +107,7 @@ namespace Server.Mobiles
* Effect: Type: "3" From: "0x57D4F5B" To: "0x0" ItemId: "0x37B9" ItemIdName: "glow" FromLocation: "(1048 779, 6)" ToLocation: "(1048 779, 6)" Speed: "10" Duration: "5" FixedDirection: "True" Explode: "False"
*/
ExpireTimer timer = (ExpireTimer)m_ChlorophylBlastTable[defender];
ExpireTimer timer = m_ChlorophylBlastTable[defender];
if (timer != null)
{
@ -148,9 +149,9 @@ namespace Server.Mobiles
{
private Mobile m_Mobile;
private ResistanceMod m_Mod;
private Hashtable m_Table;
private Dictionary<Mobile, ExpireTimer> m_Table;
public ExpireTimer(Mobile m, ResistanceMod mod, Hashtable table, TimeSpan delay)
public ExpireTimer(Mobile m, ResistanceMod mod, Dictionary<Mobile, ExpireTimer> table, TimeSpan delay)
: base(delay)
{
m_Mobile = m;
@ -177,4 +178,4 @@ namespace Server.Mobiles
}
}
}
}
}

View file

@ -1,5 +1,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Server.Engines.Plants;
using Server.Items;
@ -7,7 +8,7 @@ namespace Server.Mobiles
{
public class LadyOfTheSnow : BaseCreature
{
private static Hashtable m_Table = new Hashtable();
private static Dictionary<Mobile, ExpireTimer> m_Table = new Dictionary<Mobile, ExpireTimer>();
[Constructible]
public LadyOfTheSnow()
@ -90,7 +91,7 @@ namespace Server.Mobiles
* Reset cliloc: 1070831
*/
ExpireTimer timer = (ExpireTimer)m_Table[defender];
ExpireTimer timer = m_Table[defender];
if (timer != null)
{
@ -162,4 +163,4 @@ namespace Server.Mobiles
}
}
}
}
}

View file

@ -1,11 +1,12 @@
using System;
using System.Collections;
using System.Collections.Generic;
namespace Server.Mobiles
{
public class RaiJu : BaseCreature
{
private static Hashtable m_Table = new Hashtable();
private static Dictionary<Mobile, ExpireTimer> m_Table = new Dictionary<Mobile, ExpireTimer>();
[Constructible]
public RaiJu() : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4)
@ -86,7 +87,7 @@ namespace Server.Mobiles
public bool IsStunned(Mobile m)
{
return m_Table.Contains(m);
return m_Table.ContainsKey(m);
}
public override void Serialize(GenericWriter writer)
@ -127,4 +128,4 @@ namespace Server.Mobiles
}
}
}
}
}

View file

@ -8,7 +8,7 @@ namespace Server.Mobiles
public Ronin() : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4)
{
SpeechHue = Utility.RandomDyedHue();
Hue = Utility.RandomSkinHue();
Hue = Race.Human.RandomSkinHue();
Female = Utility.RandomBool();
Body = Female ? 0x191 : 0x190;

View file

@ -8,7 +8,7 @@ namespace Server.Mobiles
{
public class RuneBeetle : BaseCreature
{
private static Hashtable m_Table = new Hashtable();
private static Dictionary<Mobile, ExpireTimer> m_Table = new Dictionary<Mobile, ExpireTimer>();
[Constructible]
public RuneBeetle() : base(AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4)
@ -146,7 +146,7 @@ namespace Server.Mobiles
* End ASCII: "The corruption of your armor has worn off"
*/
ExpireTimer timer = (ExpireTimer)m_Table[defender];
ExpireTimer timer = m_Table[defender];
if (timer != null)
{
@ -259,4 +259,4 @@ namespace Server.Mobiles
}
}
}
}
}

View file

@ -1,5 +1,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Server.Engines.Plants;
using Server.Items;
@ -7,7 +8,7 @@ namespace Server.Mobiles
{
public class TsukiWolf : BaseCreature
{
private static Hashtable m_Table = new Hashtable();
private static Dictionary<Mobile, ExpireTimer> m_Table = new Dictionary<Mobile, ExpireTimer>();
[Constructible]
public TsukiWolf()
@ -112,7 +113,7 @@ namespace Server.Mobiles
* End cliloc: 1070824
*/
ExpireTimer timer = (ExpireTimer)m_Table[defender];
ExpireTimer timer = m_Table[defender];
if (timer != null)
{
@ -209,4 +210,4 @@ namespace Server.Mobiles
}
}
}
}
}

View file

@ -117,22 +117,15 @@ namespace Server.Mobiles
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 bc && (bc.Controlled || bc.Summoned || bc.Team != Team))
targets.Add(m);
else if (m.Player && m.Alive)
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);
@ -141,6 +134,8 @@ namespace Server.Mobiles
m.FixedParticles(0x36BD, 1, 10, 0x1F78, 0xA6, 0, (EffectLayer)255);
m.ApplyPoison(this, Poison.Lethal);
}
eable.Free();
}
}
@ -183,4 +178,4 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
}
}
}