fixes [decorate and adds timestamp to world save (#87)

This commit is contained in:
Andrew Fryer 2020-02-19 20:37:12 -05:00 committed by GitHub
parent d7f0227268
commit 717e192cf7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
65 changed files with 261 additions and 118 deletions

View file

@ -23,6 +23,7 @@ using Server.Spells.Necromancy;
using Server.Spells.Sixth;
using Server.Spells.Spellweaving;
using Server.Targeting;
using Server.Utilities;
namespace Server.Mobiles
{
@ -2170,7 +2171,7 @@ namespace Server.Mobiles
return null;
Type type = m_SpellAttack[Utility.Random(m_SpellAttack.Count)];
return Activator.CreateInstance(type, this, null) as Spell;
return ActivatorUtil.CreateInstance(type, this, null) as Spell;
}
public Spell GetDefenseSpellRandom()
@ -2179,7 +2180,7 @@ namespace Server.Mobiles
return null;
Type type = m_SpellDefense[Utility.Random(m_SpellDefense.Count)];
return Activator.CreateInstance(type, this, null) as Spell;
return ActivatorUtil.CreateInstance(type, this, null) as Spell;
}
public Spell GetSpellSpecific(Type type)
@ -2188,11 +2189,11 @@ namespace Server.Mobiles
for (i = 0; i < m_SpellAttack.Count; i++)
if (m_SpellAttack[i] == type)
return Activator.CreateInstance(type, this, null) as Spell;
return ActivatorUtil.CreateInstance(type, this, null) as Spell;
for (i = 0; i < m_SpellDefense.Count; i++)
if (m_SpellDefense[i] == type)
return Activator.CreateInstance(type, this, null) as Spell;
return ActivatorUtil.CreateInstance(type, this, null) as Spell;
return null;
}

View file

@ -33,6 +33,7 @@ using Server.Spells.Seventh;
using Server.Spells.Sixth;
using Server.Spells.Spellweaving;
using Server.Targeting;
using Server.Utilities;
using BaseQuestGump = Server.Engines.MLQuests.Gumps.BaseQuestGump;
using QuestOfferGump = Server.Engines.MLQuests.Gumps.QuestOfferGump;
using RankDefinition = Server.Guilds.RankDefinition;
@ -3080,7 +3081,7 @@ namespace Server.Mobiles
try
{
ammo = Activator.CreateInstance(kvp.Key) as Item;
ammo = ActivatorUtil.CreateInstance(kvp.Key) as Item;
}
catch
{

View file

@ -1,5 +1,6 @@
using System;
using Server.Items;
using Server.Utilities;
namespace Server.Mobiles
{
@ -179,7 +180,7 @@ namespace Server.Mobiles
public static void GiveArtifactTo(Mobile m)
{
Item item = (Item)Activator.CreateInstance(Artifacts[Utility.Random(Artifacts.Length)]);
Item item = (Item)ActivatorUtil.CreateInstance(Artifacts[Utility.Random(Artifacts.Length)]);
if (m.AddToBackpack(item))
m.SendMessage("As a reward for slaying the mighty paragon, an artifact has been placed in your backpack.");
@ -215,4 +216,4 @@ namespace Server.Mobiles
}
}
}
}
}

View file

@ -1,5 +1,6 @@
using System;
using Server.Items;
using Server.Utilities;
namespace Server.Mobiles
{
@ -27,6 +28,6 @@ namespace Server.Mobiles
public override bool CanCacheDisplay => false;
public override IEntity GetEntity() => (IEntity)Activator.CreateInstance(Type, m_Content);
public override IEntity GetEntity() => (IEntity)ActivatorUtil.CreateInstance(Type, m_Content);
}
}
}

View file

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using Server.Items;
using Server.Utilities;
namespace Server.Mobiles
{
@ -94,10 +95,10 @@ namespace Server.Mobiles
public virtual IEntity GetEntity()
{
if (Args == null || Args.Length == 0)
return (IEntity)Activator.CreateInstance(Type);
return (IEntity)ActivatorUtil.CreateInstance(Type);
return (IEntity)Activator.CreateInstance(Type, Args);
//return (Item)Activator.CreateInstance( m_Type );
return (IEntity)ActivatorUtil.CreateInstance(Type, Args);
//return (Item)ActivatorUtil.CreateInstance( m_Type );
}
//Attempt to restock with item, (return true if restock successful)

View file

@ -3,6 +3,7 @@ using System.Collections.Generic;
using Server.Gumps;
using Server.Items;
using Server.Network;
using Server.Utilities;
namespace Server.Mobiles
{
@ -193,7 +194,7 @@ namespace Server.Mobiles
else
args[i] = origArgs[i];
Gump g = Activator.CreateInstance(buyInfo.GumpType, args) as Gump;
Gump g = ActivatorUtil.CreateInstance(buyInfo.GumpType, args) as Gump;
m_From.SendGump(g);
}