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,3 @@
using System.Collections;
using System.Collections.Generic;
using System.Text;
using Server.Commands.Generic;
@ -185,12 +184,10 @@ namespace Server.Commands
}
}
public static void DeleteList_Callback(Mobile from, bool okay, object state)
public static void DeleteList_Callback(Mobile from, bool okay, List<IEntity> list)
{
if (okay)
{
List<IEntity> list = (List<IEntity>)state;
CommandLogging.WriteLine(from, "{0} {1} deleting {2} object{3}", from.AccessLevel,
CommandLogging.Format(from), list.Count, list.Count == 1 ? "" : "s");
@ -213,11 +210,12 @@ namespace Server.Commands
[Description("Deletes all items and mobiles in your facet. Players and their inventory will not be deleted.")]
public static void ClearFacet_OnCommand(CommandEventArgs e)
{
Map map = e.Mobile.Map;
Mobile from = e.Mobile;
Map map = from.Map;
if (map == null || map == Map.Internal)
{
e.Mobile.SendMessage("You may not run that command here.");
from.SendMessage("You may not run that command here.");
return;
}
@ -233,17 +231,17 @@ namespace Server.Commands
if (list.Count > 0)
{
CommandLogging.WriteLine(e.Mobile, "{0} {1} starting facet clear of {2} ({3} object{4})",
e.Mobile.AccessLevel, CommandLogging.Format(e.Mobile), map, list.Count, list.Count == 1 ? "" : "s");
CommandLogging.WriteLine(from, "{0} {1} starting facet clear of {2} ({3} object{4})",
from.AccessLevel, CommandLogging.Format(from), map, list.Count, list.Count == 1 ? "" : "s");
e.Mobile.SendGump(
from.SendGump(
new WarningGump(1060635, 30720,
$"You are about to delete {list.Count} object{(list.Count == 1 ? "" : "s")} from this facet. Do you really wish to continue?",
0xFFC000, 360, 260, DeleteList_Callback, list));
0xFFC000, 360, 260, okay => DeleteList_Callback(from, okay, list)));
}
else
{
e.Mobile.SendMessage("There were no objects found to delete.");
from.SendMessage("There were no objects found to delete.");
}
}
@ -285,7 +283,7 @@ namespace Server.Commands
}
else if (obj is Mobile master && master.Player)
{
ArrayList pets = new ArrayList();
List<BaseCreature> pets = new List<BaseCreature>();
foreach (Mobile m in World.Mobiles.Values)
if (m is BaseCreature bc)
@ -443,7 +441,7 @@ namespace Server.Commands
{
try
{
int ser = e.GetInt32(0);
uint ser = e.GetUInt32(0);
IEntity ent = World.FindEntity(ser);
@ -567,6 +565,7 @@ namespace Server.Commands
}
catch
{
// ignored
}
from.SendMessage("Region name not found");
@ -760,7 +759,7 @@ namespace Server.Commands
{
if (!BaseCommand.IsAccessible(from, targeted))
{
from.SendMessage("That is not accessible.");
from.SendLocalizedMessage(500447); // That is not accessible.
return;
}