From c85b0a740c271f800fda8b91f2742d6ebf582d30 Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Fri, 14 Sep 2018 14:32:04 -0700 Subject: [PATCH] Removes redundant delegate type declarations --- Scripts/Accounting/AccessRestrictions.cs | 2 +- Scripts/Accounting/Account.cs | 6 +- Scripts/Accounting/AccountAttackLimiter.cs | 6 +- Scripts/Accounting/AccountHandler.cs | 8 +- Scripts/Accounting/Accounts.cs | 4 +- Scripts/Commands/Add.cs | 26 +-- Scripts/Commands/Batch.cs | 2 +- Scripts/Commands/ConvertPlayers.cs | 2 +- Scripts/Commands/Decorate.cs | 2 +- Scripts/Commands/DecorateMag.cs | 2 +- Scripts/Commands/Docs.cs | 2 +- Scripts/Commands/DragEffects.cs | 2 +- Scripts/Commands/Dupe.cs | 4 +- Scripts/Commands/ExportWSC.cs | 2 +- Scripts/Commands/GenCategorization.cs | 2 +- Scripts/Commands/GenTeleporter.cs | 2 +- Scripts/Commands/Generic/Commands/Commands.cs | 4 +- .../Commands/Generic/Commands/DesignInsert.cs | 2 +- .../Implementors/AreaCommandImplementor.cs | 2 +- .../Implementors/BaseCommandImplementor.cs | 2 +- .../Implementors/SingleCommandImplementor.cs | 2 +- Scripts/Commands/Handlers.cs | 70 +++---- Scripts/Commands/HelpInfo.cs | 2 +- Scripts/Commands/Logging.cs | 2 +- Scripts/Commands/Profiling.cs | 14 +- Scripts/Commands/Properties.cs | 2 +- Scripts/Commands/ShardTime.cs | 2 +- Scripts/Commands/SignParser.cs | 2 +- Scripts/Commands/Skills.cs | 6 +- Scripts/Commands/SkillsMenu.cs | 2 +- Scripts/Commands/Statics.cs | 28 +-- Scripts/Commands/VisibilityList.cs | 8 +- Scripts/Commands/Wipe.cs | 10 +- Scripts/Engines/BulkOrders/Rewards.cs | 36 ++-- Scripts/Engines/CannedEvil/ChampionSpawn.cs | 4 +- Scripts/Engines/Chat/Chat.cs | 4 +- Scripts/Engines/Chat/ChatActionHandlers.cs | 56 +++--- Scripts/Engines/Chat/Chatold.cs | 2 +- Scripts/Engines/ConPVP/AcceptDuelGump.cs | 2 +- Scripts/Engines/ConPVP/Arena.cs | 4 +- Scripts/Engines/ConPVP/DuelContext.cs | 30 +-- Scripts/Engines/ConPVP/Games/BombingRun.cs | 12 +- Scripts/Engines/ConPVP/Games/CTF.cs | 6 +- Scripts/Engines/ConPVP/Games/DoubleDom.cs | 6 +- Scripts/Engines/ConPVP/Games/KingOfTheHill.cs | 4 +- Scripts/Engines/ConPVP/Tournament.cs | 12 +- Scripts/Engines/Craft/Core/CraftItem.cs | 6 +- Scripts/Engines/Craft/Core/Recipes.cs | 50 +++-- Scripts/Engines/Doom/GauntletSpawner.cs | 4 +- .../Doom/LeverPuzzle/LeverPuzzleController.cs | 4 +- .../Doom/LeverPuzzle/LeverPuzzleItems.cs | 2 +- .../Doom/LeverPuzzle/LeverPuzzleRegions.cs | 2 +- Scripts/Engines/Ethics/Core/Ethic.cs | 4 +- Scripts/Engines/Factions/Core/Election.cs | 2 +- Scripts/Engines/Factions/Core/Faction.cs | 26 +-- Scripts/Engines/Factions/Core/FactionState.cs | 2 +- Scripts/Engines/Factions/Core/Generator.cs | 2 +- Scripts/Engines/Factions/Core/Keywords.cs | 2 +- Scripts/Engines/Factions/Core/Town.cs | 6 +- .../Engines/Factions/Gumps/TownStoneGump.cs | 4 +- Scripts/Engines/Factions/Items/Sigil.cs | 2 +- .../Factions/Items/Traps/BaseFactionTrap.cs | 4 +- .../Mobiles/Guards/BaseFactionGuard.cs | 2 +- Scripts/Engines/Help/HelpGump.cs | 2 +- Scripts/Engines/Help/PageQueue.cs | 2 +- Scripts/Engines/Help/SpeechLog.cs | 2 +- Scripts/Engines/Khaldun/KhaldunGen.cs | 2 +- Scripts/Engines/Khaldun/RaisableItem.cs | 2 +- Scripts/Engines/Khaldun/RaiseSwitch.cs | 2 +- .../Engines/MLQuests/Gumps/RaceChangeGump.cs | 4 +- Scripts/Engines/MLQuests/MLQuestSystem.cs | 10 +- .../MLQuests/Objectives/EscortObjective.cs | 2 +- .../Engines/MyRunUO/DatabaseCommandQueue.cs | 2 +- Scripts/Engines/MyRunUO/MyRunUO.cs | 10 +- Scripts/Engines/MyRunUO/MyRunUOStatus.cs | 4 +- Scripts/Engines/Party/Party.cs | 10 +- Scripts/Engines/Pathing/MovementPath.cs | 4 +- Scripts/Engines/Plants/PlantSystem.cs | 6 +- .../Quests/Core/Items/HornOfRetreat.cs | 2 +- Scripts/Engines/Quests/Core/QuestSystem.cs | 8 +- .../Quests/Dark Tides/Items/MaabusCoffin.cs | 4 +- .../Dark Tides/Mobiles/SummonedPaladin.cs | 4 +- .../Items/HaochisTreasureChest.cs | 4 +- .../Quests/The Summoning/Mobiles/Chyloth.cs | 6 +- .../Witch Apprentice/Mobiles/Blackheart.cs | 2 +- Scripts/Engines/RemoteAdmin/Network.cs | 6 +- Scripts/Engines/RemoteAdmin/PacketHandlers.cs | 8 +- .../Reports/Objects/Charts/BarGraph.cs | 2 +- .../Reports/Objects/Charts/ChartItem.cs | 2 +- .../Reports/Objects/Charts/PieChart.cs | 2 +- .../Reports/Objects/Reports/ItemValue.cs | 2 +- .../Engines/Reports/Objects/Reports/Report.cs | 2 +- .../Reports/Objects/Reports/ReportColumn.cs | 2 +- .../Reports/Objects/Reports/ReportItem.cs | 2 +- .../Reports/Objects/Snapshots/Snapshot.cs | 2 +- .../Objects/Snapshots/SnapshotHistory.cs | 2 +- .../Reports/Objects/Staffing/PageInfo.cs | 2 +- .../Reports/Objects/Staffing/QueueStatus.cs | 2 +- .../Reports/Objects/Staffing/ResponseInfo.cs | 2 +- .../Reports/Objects/Staffing/StaffHistory.cs | 2 +- Scripts/Engines/Reports/Reports.cs | 4 +- .../Character Statue Maker/CharacterStatue.cs | 2 +- .../CharacterStatuePlinth.cs | 2 +- .../Engines/VeteranRewards/RewardSystem.cs | 2 +- Scripts/Engines/Virtues/Compassion.cs | 2 +- Scripts/Engines/Virtues/Honor.cs | 2 +- Scripts/Engines/Virtues/Justice.cs | 4 +- Scripts/Engines/Virtues/Sacrifice.cs | 4 +- Scripts/Engines/Virtues/Valor.cs | 2 +- Scripts/Engines/Virtues/VirtueGump.cs | 6 +- Scripts/Gumps/AddDoorGump.cs | 2 +- Scripts/Gumps/AddGump.cs | 2 +- Scripts/Gumps/AdminGump.cs | 26 +-- Scripts/Gumps/CommentsGump.cs | 4 +- .../Guilds/New Guild System/DiplomacyGump.cs | 2 +- .../Guilds/New Guild System/GuildInfoGump.cs | 4 +- .../New Guild System/GuildMemberInfoGump.cs | 2 +- .../Guilds/New Guild System/OtherGuildInfo.cs | 2 +- Scripts/Gumps/HouseGumpAOS.cs | 26 +-- Scripts/Gumps/ReportMurderer.cs | 2 +- Scripts/Gumps/ToTAdminGump.cs | 2 +- Scripts/Gumps/ViewHousesGump.cs | 4 +- Scripts/Gumps/WhoGump.cs | 4 +- .../Halloween/2006/Engines/TrickOrTreat.cs | 14 +- .../Halloween/2009/Engines/PumpkinPatch.cs | 2 +- .../Halloween/2012/Engines/PlayerZombies.cs | 6 +- .../Valentine/2012/Items/CupidsArrow.cs | 2 +- Scripts/Items/Addons/SHTeleporter.cs | 2 +- Scripts/Items/Aquarium/Aquarium.cs | 4 +- Scripts/Items/Aquarium/BaseFish.cs | 2 +- Scripts/Items/Books/BaseBook.cs | 6 +- Scripts/Items/Construction/Doors/BaseDoor.cs | 10 +- .../Items/Containers/FillableContainers.cs | 6 +- Scripts/Items/Containers/MarkContainer.cs | 2 +- Scripts/Items/Containers/Strongbox.cs | 2 +- .../StealableArtifactsSpawner.cs | 8 +- Scripts/Items/Deeds/DragonBardingDeed.cs | 2 +- Scripts/Items/Farming/FarmableCrop.cs | 2 +- Scripts/Items/Food/Beverage.cs | 6 +- Scripts/Items/Food/Cooking.cs | 2 +- .../Games/Mahjong/MahjongPacketHandlers.cs | 26 +-- Scripts/Items/Guilds/Guildstone.cs | 4 +- Scripts/Items/Maps/MapItem.cs | 2 +- Scripts/Items/Maps/TreasureMap.cs | 2 +- Scripts/Items/Misc/AcidSlime.cs | 2 +- Scripts/Items/Misc/ArcaneGem.cs | 2 +- Scripts/Items/Misc/BulletinBoards.cs | 2 +- Scripts/Items/Misc/Corpses/Corpse.cs | 2 +- Scripts/Items/Misc/DeceitBrazier.cs | 2 +- Scripts/Items/Misc/EffectController.cs | 6 +- Scripts/Items/Misc/Firebomb.cs | 4 +- Scripts/Items/Misc/FlippableAttribute.cs | 2 +- Scripts/Items/Misc/Guillotine.cs | 6 +- Scripts/Items/Misc/MorphItem.cs | 2 +- Scripts/Items/Misc/OilCloth.cs | 2 +- Scripts/Items/Misc/PoolOfAcid.cs | 2 +- Scripts/Items/Misc/PublicMoongate.cs | 2 +- Scripts/Items/Misc/Teleporter.cs | 2 +- Scripts/Items/Misc/WarningItem.cs | 2 +- Scripts/Items/Misc/Waypoint.cs | 2 +- Scripts/Items/Skill Items/Camping/Bedroll.cs | 2 +- Scripts/Items/Skill Items/Camping/Campfire.cs | 2 +- .../Carpenter Items/TaxidermyKit.cs | 2 +- .../Fishing/Misc/SpecialFishingNet.cs | 2 +- .../Skill Items/Magical/Misc/Moongate.cs | 2 +- .../Skill Items/Magical/Misc/PotionKeg.cs | 2 +- .../BaseConfusionBlastPotion.cs | 4 +- .../Items/Skill Items/Magical/Spellbook.cs | 10 +- Scripts/Items/Skill Items/Misc/Bandage.cs | 2 +- .../Musical Instruments/BaseInstrument.cs | 2 +- .../Skill Items/Ninjitsu/NinjaWeapons.cs | 8 +- .../Skill Items/Tailor Items/Misc/Dyes.cs | 4 +- .../Dawn's Music Box/DawnsMusicBox.cs | 2 +- .../8th Anniversary Items/FountainOfLife.cs | 6 +- .../CreepyPortrait.cs | 4 +- .../DisturbingPortrait.cs | 4 +- .../SacrificialAltar.cs | 6 +- .../UnsettlingPortrait.cs | 4 +- .../Special/Heritage Items/FruitTrees.cs | 4 +- Scripts/Items/Special/Holiday/Wreath.cs | 4 +- .../Special/House Raffle/HouseRaffleStone.cs | 4 +- .../Items/Special/ML/GrizzledMareStatuette.cs | 2 +- .../Special/Mutation Core/PlagueBeastBlood.cs | 2 +- .../Mutation Core/PlagueBeastMutationCore.cs | 2 +- .../Mutation Core/PlagueBeastOrgans.cs | 8 +- .../Special/Mutation Core/PlagueBeastVein.cs | 2 +- .../Special/Solen Items/BallOfSummoning.cs | 8 +- .../Special/Solen Items/BraceletOfBinding.cs | 8 +- .../Special/Valentines/2007/ValentinesCard.cs | 2 +- .../Special/Veteran Rewards/MiningCart.cs | 4 +- .../Special/Veteran Rewards/TreeStump.cs | 4 +- Scripts/Items/Talismans/BaseTalisman.cs | 4 +- Scripts/Items/Talismans/TalismanSummons.cs | 4 +- Scripts/Items/Traps/FlameSpurtTrap.cs | 2 +- Scripts/Items/Traps/MushroomTrap.cs | 2 +- Scripts/Items/Traps/SpikeTrap.cs | 4 +- Scripts/Items/Traps/StoneFaceTrap.cs | 4 +- Scripts/Items/Wands/BaseWand.cs | 2 +- .../Items/Weapons/Abilities/WeaponAbility.cs | 2 +- Scripts/Items/Weapons/Fists.cs | 4 +- Scripts/Items/Weapons/Ranged/BaseRanged.cs | 2 +- Scripts/Items/Weapons/Ranged/JukaBow.cs | 2 +- Scripts/Misc/Animations.cs | 2 +- Scripts/Misc/Assistants.cs | 8 +- Scripts/Misc/AttackMessage.cs | 2 +- Scripts/Misc/AutoRestart.cs | 6 +- Scripts/Misc/AutoSave.cs | 4 +- Scripts/Misc/Broadcasts.cs | 4 +- Scripts/Misc/BuffIcons.cs | 17 +- Scripts/Misc/CharacterCreation.cs | 2 +- Scripts/Misc/Cleanup.cs | 2 +- Scripts/Misc/ClientVerification.cs | 2 +- Scripts/Misc/CrashGuard.cs | 2 +- Scripts/Misc/CurrentExpansion.cs | 2 +- Scripts/Misc/DoorGenerator.cs | 2 +- Scripts/Misc/Email.cs | 2 +- Scripts/Misc/Fastwalk.cs | 2 +- Scripts/Misc/Gifts/Winter2004/Mistletoe.cs | 4 +- Scripts/Misc/Guild.cs | 8 +- Scripts/Misc/HardwareInfo.cs | 8 +- Scripts/Misc/Keywords.cs | 2 +- Scripts/Misc/LanguageStatistics.cs | 2 +- Scripts/Misc/LightCycle.cs | 4 +- Scripts/Misc/LoginStats.cs | 2 +- Scripts/Misc/MapUO.cs | 4 +- Scripts/Misc/NameVerification.cs | 2 +- Scripts/Misc/Notoriety.cs | 6 +- Scripts/Misc/Paperdoll.cs | 2 +- Scripts/Misc/ProfanityProtection.cs | 2 +- Scripts/Misc/Profile.cs | 4 +- Scripts/Misc/ProtocolExtensions.cs | 2 +- Scripts/Misc/RegenRates.cs | 6 +- Scripts/Misc/RenameRequests.cs | 2 +- Scripts/Misc/ServerList.cs | 2 +- Scripts/Misc/ShardPoller.cs | 4 +- Scripts/Misc/SkillCheck.cs | 8 +- Scripts/Misc/SocketOptions.cs | 2 +- Scripts/Misc/ValidationQueue.cs | 2 +- Scripts/Misc/VendorGenerator.cs | 2 +- Scripts/Misc/Weather.cs | 2 +- Scripts/Misc/WeightOverloading.cs | 2 +- Scripts/Misc/uoamVendors.cs | 2 +- Scripts/Mobiles/AI/BaseAI.cs | 8 +- Scripts/Mobiles/AI/HealerAI.cs | 6 +- Scripts/Mobiles/BaseCreature.cs | 8 +- Scripts/Mobiles/Familiars/HordeMinion.cs | 2 +- Scripts/Mobiles/Familiars/ShadowWisp.cs | 2 +- Scripts/Mobiles/Monsters/AOS/ShadowKnight.cs | 2 +- .../Monsters/Humanoid/Magic/SavageShaman.cs | 2 +- .../Humanoid/Melee/KhaldunRevenant.cs | 2 +- .../Mobiles/Monsters/LBR/Meers/MeerEternal.cs | 2 +- Scripts/Mobiles/Monsters/ML/Animal/Ferret.cs | 4 +- .../Mobiles/Monsters/ML/Special/Meraktus.cs | 2 +- .../Monsters/Mammal/Melee/VorpalBunny.cs | 6 +- .../Monsters/Misc/Melee/PlagueBeastLord.cs | 4 +- Scripts/Mobiles/Monsters/SE/BakeKitsune.cs | 6 +- Scripts/Mobiles/PlayerMobile.cs | 56 +++--- Scripts/Mobiles/Townfolk/BaseEscortable.cs | 2 +- Scripts/Mobiles/Townfolk/TownCrier.cs | 6 +- Scripts/Mobiles/Vendors/BaseVendor.cs | 2 +- .../Mobiles/Vendors/NPC/RealEstateBroker.cs | 2 +- Scripts/Mobiles/Vendors/PlayerBarkeeper.cs | 2 +- Scripts/Mobiles/Vendors/PlayerVendor.cs | 4 +- Scripts/Mobiles/Vendors/VendorInventory.cs | 2 +- Scripts/Multis/BaseHouse.cs | 16 +- Scripts/Multis/Boats/BaseBoat.cs | 2 +- Scripts/Multis/Boats/Strandedness.cs | 2 +- Scripts/Multis/Camps/BaseCamp.cs | 4 +- Scripts/Multis/HouseFoundation.cs | 32 ++-- Scripts/Multis/HousePlacementTool.cs | 2 +- Scripts/Multis/HouseSign.cs | 2 +- Scripts/Multis/MovingCrate.cs | 2 +- Scripts/Multis/PreviewHouse.cs | 2 +- Scripts/Regions/GuardedRegion.cs | 6 +- Scripts/Regions/HouseRegion.cs | 2 +- Scripts/Regions/Spawning/SpawnEntry.cs | 20 +- Scripts/Skills/Anatomy.cs | 2 +- Scripts/Skills/AnimalLore.cs | 2 +- Scripts/Skills/AnimalTaming.cs | 2 +- Scripts/Skills/ArmsLore.cs | 2 +- Scripts/Skills/Begging.cs | 2 +- Scripts/Skills/DetectHidden.cs | 2 +- Scripts/Skills/Discordance.cs | 6 +- Scripts/Skills/EvalInt.cs | 2 +- Scripts/Skills/ForensicEval.cs | 2 +- Scripts/Skills/Hiding.cs | 2 +- Scripts/Skills/Inscribe.cs | 2 +- Scripts/Skills/ItemIdentification.cs | 2 +- Scripts/Skills/Meditation.cs | 2 +- Scripts/Skills/Peacemaking.cs | 4 +- Scripts/Skills/Poisoning.cs | 2 +- Scripts/Skills/Provocation.cs | 4 +- Scripts/Skills/RemoveTrap.cs | 2 +- Scripts/Skills/Snooping.cs | 2 +- Scripts/Skills/SpiritSpeak.cs | 2 +- Scripts/Skills/Stealing.cs | 2 +- Scripts/Skills/Stealth.cs | 2 +- Scripts/Skills/TasteID.cs | 2 +- Scripts/Skills/Tracking.cs | 10 +- Scripts/SpecialSystems/Engines/GiftGiving.cs | 2 +- .../SpecialSystems/Engines/PreventInaccess.cs | 2 +- Scripts/SpecialSystems/Engines/TestCenter.cs | 2 +- Scripts/Spells/Base/SpellHelper.cs | 38 ++-- Scripts/Spells/Mysticism/SpellPlagueSpell.cs | 4 +- Scripts/Spells/Necromancy/AnimateDeadSpell.cs | 2 +- Scripts/Spells/Ninjitsu/AnimalForm.cs | 6 +- Scripts/Spells/Spellweaving/EtherealVoyage.cs | 6 +- Scripts/Spells/Spellweaving/GiftOfLife.cs | 6 +- .../Spellweaving/Items/TransientItem.cs | 4 +- Scripts/Spells/Spellweaving/ReaperForm.cs | 2 +- Server/Item.cs | 2 +- Server/Network/Listener.cs | 2 +- Server/Network/NetState.cs | 6 +- Server/Network/PacketHandlers.cs | 176 +++++++++--------- Server/Random.cs | 16 +- Server/Serialization.cs | 2 +- Server/Utility.cs | 2 +- 317 files changed, 898 insertions(+), 903 deletions(-) diff --git a/Scripts/Accounting/AccessRestrictions.cs b/Scripts/Accounting/AccessRestrictions.cs index b608ce55d..98cbd927e 100644 --- a/Scripts/Accounting/AccessRestrictions.cs +++ b/Scripts/Accounting/AccessRestrictions.cs @@ -9,7 +9,7 @@ namespace Server { public static void Initialize() { - EventSink.SocketConnect += new SocketConnectEventHandler( EventSink_SocketConnect ); + EventSink.SocketConnect += EventSink_SocketConnect; } private static void EventSink_SocketConnect( SocketConnectEventArgs e ) diff --git a/Scripts/Accounting/Account.cs b/Scripts/Accounting/Account.cs index 44a79191b..b156a40d6 100644 --- a/Scripts/Accounting/Account.cs +++ b/Scripts/Accounting/Account.cs @@ -493,9 +493,9 @@ namespace Server.Accounting public static void Initialize() { - EventSink.Connected += new ConnectedEventHandler( EventSink_Connected ); - EventSink.Disconnected += new DisconnectedEventHandler( EventSink_Disconnected ); - EventSink.Login += new LoginEventHandler( EventSink_Login ); + EventSink.Connected += EventSink_Connected; + EventSink.Disconnected += EventSink_Disconnected; + EventSink.Login += EventSink_Login; } private static void EventSink_Connected( ConnectedEventArgs e ) diff --git a/Scripts/Accounting/AccountAttackLimiter.cs b/Scripts/Accounting/AccountAttackLimiter.cs index 43924eff0..a40b6be3b 100644 --- a/Scripts/Accounting/AccountAttackLimiter.cs +++ b/Scripts/Accounting/AccountAttackLimiter.cs @@ -15,9 +15,9 @@ namespace Server.Accounting if ( !Enabled ) return; - PacketHandlers.RegisterThrottler( 0x80, new ThrottlePacketCallback( Throttle_Callback ) ); - PacketHandlers.RegisterThrottler( 0x91, new ThrottlePacketCallback( Throttle_Callback ) ); - PacketHandlers.RegisterThrottler( 0xCF, new ThrottlePacketCallback( Throttle_Callback ) ); + PacketHandlers.RegisterThrottler( 0x80, Throttle_Callback ); + PacketHandlers.RegisterThrottler( 0x91, Throttle_Callback ); + PacketHandlers.RegisterThrottler( 0xCF, Throttle_Callback ); } public static bool Throttle_Callback( NetState ns ) diff --git a/Scripts/Accounting/AccountHandler.cs b/Scripts/Accounting/AccountHandler.cs index 1f708f0cd..4782fed3d 100644 --- a/Scripts/Accounting/AccountHandler.cs +++ b/Scripts/Accounting/AccountHandler.cs @@ -67,12 +67,12 @@ namespace Server.Misc public static void Initialize() { - EventSink.DeleteRequest += new DeleteRequestEventHandler( EventSink_DeleteRequest ); - EventSink.AccountLogin += new AccountLoginEventHandler( EventSink_AccountLogin ); - EventSink.GameLogin += new GameLoginEventHandler( EventSink_GameLogin ); + EventSink.DeleteRequest += EventSink_DeleteRequest; + EventSink.AccountLogin += EventSink_AccountLogin; + EventSink.GameLogin += EventSink_GameLogin; if ( PasswordCommandEnabled ) - CommandSystem.Register( "Password", AccessLevel.Player, new CommandEventHandler( Password_OnCommand ) ); + CommandSystem.Register( "Password", AccessLevel.Player, Password_OnCommand ); } [Usage( "Password " )] diff --git a/Scripts/Accounting/Accounts.cs b/Scripts/Accounting/Accounts.cs index 3cebfe9f9..2c1f2eb09 100644 --- a/Scripts/Accounting/Accounts.cs +++ b/Scripts/Accounting/Accounts.cs @@ -11,8 +11,8 @@ namespace Server.Accounting public static void Configure() { - EventSink.WorldLoad += new WorldLoadEventHandler( Load ); - EventSink.WorldSave += new WorldSaveEventHandler( Save ); + EventSink.WorldLoad += Load; + EventSink.WorldSave += Save; } static Accounts() diff --git a/Scripts/Commands/Add.cs b/Scripts/Commands/Add.cs index 974e0020f..a62cc65aa 100644 --- a/Scripts/Commands/Add.cs +++ b/Scripts/Commands/Add.cs @@ -12,17 +12,17 @@ namespace Server.Commands { public static void Initialize() { - CommandSystem.Register( "Tile", AccessLevel.GameMaster, new CommandEventHandler( Tile_OnCommand ) ); - CommandSystem.Register( "TileRXYZ", AccessLevel.GameMaster, new CommandEventHandler( TileRXYZ_OnCommand ) ); - CommandSystem.Register( "TileXYZ", AccessLevel.GameMaster, new CommandEventHandler( TileXYZ_OnCommand ) ); - CommandSystem.Register( "TileZ", AccessLevel.GameMaster, new CommandEventHandler( TileZ_OnCommand ) ); - CommandSystem.Register( "TileAvg", AccessLevel.GameMaster, new CommandEventHandler( TileAvg_OnCommand ) ); + CommandSystem.Register( "Tile", AccessLevel.GameMaster, Tile_OnCommand ); + CommandSystem.Register( "TileRXYZ", AccessLevel.GameMaster, TileRXYZ_OnCommand ); + CommandSystem.Register( "TileXYZ", AccessLevel.GameMaster, TileXYZ_OnCommand ); + CommandSystem.Register( "TileZ", AccessLevel.GameMaster, TileZ_OnCommand ); + CommandSystem.Register( "TileAvg", AccessLevel.GameMaster, TileAvg_OnCommand ); - CommandSystem.Register( "Outline", AccessLevel.GameMaster, new CommandEventHandler( Outline_OnCommand ) ); - CommandSystem.Register( "OutlineRXYZ", AccessLevel.GameMaster, new CommandEventHandler( OutlineRXYZ_OnCommand ) ); - CommandSystem.Register( "OutlineXYZ", AccessLevel.GameMaster, new CommandEventHandler( OutlineXYZ_OnCommand ) ); - CommandSystem.Register( "OutlineZ", AccessLevel.GameMaster, new CommandEventHandler( OutlineZ_OnCommand ) ); - CommandSystem.Register( "OutlineAvg", AccessLevel.GameMaster, new CommandEventHandler( OutlineAvg_OnCommand ) ); + CommandSystem.Register( "Outline", AccessLevel.GameMaster, Outline_OnCommand ); + CommandSystem.Register( "OutlineRXYZ", AccessLevel.GameMaster, OutlineRXYZ_OnCommand ); + CommandSystem.Register( "OutlineXYZ", AccessLevel.GameMaster, OutlineXYZ_OnCommand ); + CommandSystem.Register( "OutlineZ", AccessLevel.GameMaster, OutlineZ_OnCommand ); + CommandSystem.Register( "OutlineAvg", AccessLevel.GameMaster, OutlineAvg_OnCommand ); } public static void Invoke( Mobile from, Point3D start, Point3D end, string[] args ) @@ -493,7 +493,7 @@ namespace Server.Commands private static void Internal_OnCommand( CommandEventArgs e, bool outline ) { if ( e.Length >= 1 ) - BoundingBoxPicker.Begin( e.Mobile, new BoundingBoxCallback( TileBox_Callback ), new TileState( TileZType.Start, 0, e.Arguments, outline ) ); + BoundingBoxPicker.Begin( e.Mobile, TileBox_Callback, new TileState( TileZType.Start, 0, e.Arguments, outline ) ); else e.Mobile.SendMessage( "Format: {0} [params] [set {{ ...}}]", outline ? "Outline" : "Tile" ); } @@ -547,7 +547,7 @@ namespace Server.Commands for ( int i = 0; i < subArgs.Length; ++i ) subArgs[i] = e.Arguments[i + 1]; - BoundingBoxPicker.Begin( e.Mobile, new BoundingBoxCallback( TileBox_Callback ), new TileState( TileZType.Fixed, e.GetInt32( 0 ), subArgs, outline ) ); + BoundingBoxPicker.Begin( e.Mobile, TileBox_Callback, new TileState( TileZType.Fixed, e.GetInt32( 0 ), subArgs, outline ) ); } else { @@ -558,7 +558,7 @@ namespace Server.Commands private static void InternalAvg_OnCommand( CommandEventArgs e, bool outline ) { if ( e.Length >= 1 ) - BoundingBoxPicker.Begin( e.Mobile, new BoundingBoxCallback( TileBox_Callback ), new TileState( TileZType.MapAverage, 0, e.Arguments, outline ) ); + BoundingBoxPicker.Begin( e.Mobile, TileBox_Callback, new TileState( TileZType.MapAverage, 0, e.Arguments, outline ) ); else e.Mobile.SendMessage( "Format: {0}Avg [params] [set {{ ...}}]", outline ? "Outline" : "Tile" ); } diff --git a/Scripts/Commands/Batch.cs b/Scripts/Commands/Batch.cs index d4b5ae83a..8dfac674d 100644 --- a/Scripts/Commands/Batch.cs +++ b/Scripts/Commands/Batch.cs @@ -177,7 +177,7 @@ namespace Server.Commands public static void Initialize() { - CommandSystem.Register( "Batch", AccessLevel.Counselor, new CommandEventHandler( Batch_OnCommand ) ); + CommandSystem.Register( "Batch", AccessLevel.Counselor, Batch_OnCommand ); } [Usage( "Batch" )] diff --git a/Scripts/Commands/ConvertPlayers.cs b/Scripts/Commands/ConvertPlayers.cs index fc0dcd3e8..88b382291 100644 --- a/Scripts/Commands/ConvertPlayers.cs +++ b/Scripts/Commands/ConvertPlayers.cs @@ -10,7 +10,7 @@ namespace Server.Commands { public static void Initialize() { - CommandSystem.Register( "ConvertPlayers", AccessLevel.Administrator, new CommandEventHandler( Convert_OnCommand ) ); + CommandSystem.Register( "ConvertPlayers", AccessLevel.Administrator, Convert_OnCommand ); } public static void Convert_OnCommand( CommandEventArgs e ) diff --git a/Scripts/Commands/Decorate.cs b/Scripts/Commands/Decorate.cs index 470705759..ae4d8133b 100644 --- a/Scripts/Commands/Decorate.cs +++ b/Scripts/Commands/Decorate.cs @@ -13,7 +13,7 @@ namespace Server.Commands { public static void Initialize() { - CommandSystem.Register( "Decorate", AccessLevel.Administrator, new CommandEventHandler( Decorate_OnCommand ) ); + CommandSystem.Register( "Decorate", AccessLevel.Administrator, Decorate_OnCommand ); } [Usage( "Decorate" )] diff --git a/Scripts/Commands/DecorateMag.cs b/Scripts/Commands/DecorateMag.cs index 4ae744531..f5d49eff4 100644 --- a/Scripts/Commands/DecorateMag.cs +++ b/Scripts/Commands/DecorateMag.cs @@ -13,7 +13,7 @@ namespace Server.Commands { public static void Initialize() { - CommandSystem.Register( "DecorateMag", AccessLevel.Administrator, new CommandEventHandler( DecorateMag_OnCommand ) ); + CommandSystem.Register( "DecorateMag", AccessLevel.Administrator, DecorateMag_OnCommand ); } [Usage( "DecorateMag" )] diff --git a/Scripts/Commands/Docs.cs b/Scripts/Commands/Docs.cs index cb07c809b..348bfc53d 100644 --- a/Scripts/Commands/Docs.cs +++ b/Scripts/Commands/Docs.cs @@ -14,7 +14,7 @@ namespace Server.Commands { public static void Initialize() { - CommandSystem.Register( "DocGen", AccessLevel.Administrator, new CommandEventHandler( DocGen_OnCommand ) ); + CommandSystem.Register( "DocGen", AccessLevel.Administrator, DocGen_OnCommand ); } [Usage( "DocGen" )] diff --git a/Scripts/Commands/DragEffects.cs b/Scripts/Commands/DragEffects.cs index 1aeddf18e..7b2ed9ab2 100644 --- a/Scripts/Commands/DragEffects.cs +++ b/Scripts/Commands/DragEffects.cs @@ -4,7 +4,7 @@ namespace Server.Commands { public static void Initialize() { - CommandSystem.Register( "DragEffects", AccessLevel.Developer, new CommandEventHandler( DragEffects_OnCommand ) ); + CommandSystem.Register( "DragEffects", AccessLevel.Developer, DragEffects_OnCommand ); } [Usage( "DragEffects [enable=false]" )] diff --git a/Scripts/Commands/Dupe.cs b/Scripts/Commands/Dupe.cs index c8b083d8d..269e1b41e 100644 --- a/Scripts/Commands/Dupe.cs +++ b/Scripts/Commands/Dupe.cs @@ -9,8 +9,8 @@ namespace Server.Commands { public static void Initialize() { - CommandSystem.Register( "Dupe", AccessLevel.GameMaster, new CommandEventHandler( Dupe_OnCommand ) ); - CommandSystem.Register( "DupeInBag", AccessLevel.GameMaster, new CommandEventHandler( DupeInBag_OnCommand ) ); + CommandSystem.Register( "Dupe", AccessLevel.GameMaster, Dupe_OnCommand ); + CommandSystem.Register( "DupeInBag", AccessLevel.GameMaster, DupeInBag_OnCommand ); } [Usage( "Dupe [amount]" )] diff --git a/Scripts/Commands/ExportWSC.cs b/Scripts/Commands/ExportWSC.cs index 25f642709..1c91a2aa9 100644 --- a/Scripts/Commands/ExportWSC.cs +++ b/Scripts/Commands/ExportWSC.cs @@ -10,7 +10,7 @@ namespace Server.Commands public static void Initialize() { - CommandSystem.Register( "ExportWSC", AccessLevel.Administrator, new CommandEventHandler( Export_OnCommand ) ); + CommandSystem.Register( "ExportWSC", AccessLevel.Administrator, Export_OnCommand ); } public static void Export_OnCommand( CommandEventArgs e ) diff --git a/Scripts/Commands/GenCategorization.cs b/Scripts/Commands/GenCategorization.cs index 736708c8a..b49847004 100644 --- a/Scripts/Commands/GenCategorization.cs +++ b/Scripts/Commands/GenCategorization.cs @@ -35,7 +35,7 @@ namespace Server.Commands public static void Initialize() { - CommandSystem.Register( "RebuildCategorization", AccessLevel.Administrator, new CommandEventHandler( RebuildCategorization_OnCommand ) ); + CommandSystem.Register( "RebuildCategorization", AccessLevel.Administrator, RebuildCategorization_OnCommand ); } [Usage( "RebuildCategorization" )] diff --git a/Scripts/Commands/GenTeleporter.cs b/Scripts/Commands/GenTeleporter.cs index b00b6e990..ef122dde2 100644 --- a/Scripts/Commands/GenTeleporter.cs +++ b/Scripts/Commands/GenTeleporter.cs @@ -11,7 +11,7 @@ namespace Server.Commands public static void Initialize() { - CommandSystem.Register( "TelGen", AccessLevel.Administrator, new CommandEventHandler( GenTeleporter_OnCommand ) ); + CommandSystem.Register( "TelGen", AccessLevel.Administrator, GenTeleporter_OnCommand ); } [Usage( "TelGen" )] diff --git a/Scripts/Commands/Generic/Commands/Commands.cs b/Scripts/Commands/Generic/Commands/Commands.cs index ca747e6d6..52c2cbb0c 100644 --- a/Scripts/Commands/Generic/Commands/Commands.cs +++ b/Scripts/Commands/Generic/Commands/Commands.cs @@ -256,7 +256,7 @@ namespace Server.Commands.Generic AddResponse( "Open web browser request sent." ); mob.SendGump( new WarningGump( 1060637, 30720, - $"A game master is requesting to open your web browser to the following URL:
{url}", 0xFFC000, 320, 240, new WarningGumpCallback( OpenBrowser_Callback ), new object[]{ from, url, echo } ) ); + $"A game master is requesting to open your web browser to the following URL:
{url}", 0xFFC000, 320, 240, OpenBrowser_Callback, new object[]{ from, url, echo } ) ); } } else @@ -798,7 +798,7 @@ namespace Server.Commands.Generic if ( list.Count > 1 ) { e.Mobile.SendGump( new WarningGump( 1060637, 30720, - $"You are about to delete {list.Count} objects. This cannot be undone without a full server revert.

Continue?", 0xFFC000, 420, 280, new WarningGumpCallback( OnConfirmCallback ), new object[]{ e, list } ) ); + $"You are about to delete {list.Count} objects. This cannot be undone without a full server revert.

Continue?", 0xFFC000, 420, 280, OnConfirmCallback, new object[]{ e, list } ) ); AddResponse( "Awaiting confirmation..." ); } else diff --git a/Scripts/Commands/Generic/Commands/DesignInsert.cs b/Scripts/Commands/Generic/Commands/DesignInsert.cs index c5e4f1d03..e0df0e7f2 100644 --- a/Scripts/Commands/Generic/Commands/DesignInsert.cs +++ b/Scripts/Commands/Generic/Commands/DesignInsert.cs @@ -96,7 +96,7 @@ namespace Server.Commands.Generic public override void ExecuteList( CommandEventArgs e, ArrayList list ) { e.Mobile.SendGump( new WarningGump( 1060637, 30720, - $"You are about to insert {list.Count} objects. This cannot be undone without a full server revert.

Continue?", 0xFFC000, 420, 280, new WarningGumpCallback( OnConfirmCallback ), new object[] { e, list, ( e.Length < 1 || !e.GetBoolean( 0 ) ) } ) ); + $"You are about to insert {list.Count} objects. This cannot be undone without a full server revert.

Continue?", 0xFFC000, 420, 280, OnConfirmCallback, new object[] { e, list, ( e.Length < 1 || !e.GetBoolean( 0 ) ) } ) ); AddResponse( "Awaiting confirmation..." ); } diff --git a/Scripts/Commands/Generic/Implementors/AreaCommandImplementor.cs b/Scripts/Commands/Generic/Implementors/AreaCommandImplementor.cs index 7d842fd9f..8de243b93 100644 --- a/Scripts/Commands/Generic/Implementors/AreaCommandImplementor.cs +++ b/Scripts/Commands/Generic/Implementors/AreaCommandImplementor.cs @@ -23,7 +23,7 @@ namespace Server.Commands.Generic public override void Process( Mobile from, BaseCommand command, string[] args ) { - BoundingBoxPicker.Begin( from, new BoundingBoxCallback( OnTarget ), new object[]{ command, args } ); + BoundingBoxPicker.Begin( from, OnTarget, new object[]{ command, args } ); } public void OnTarget( Mobile from, Map map, Point3D start, Point3D end, object state ) diff --git a/Scripts/Commands/Generic/Implementors/BaseCommandImplementor.cs b/Scripts/Commands/Generic/Implementors/BaseCommandImplementor.cs index 30eafe8f6..0360b30bd 100644 --- a/Scripts/Commands/Generic/Implementors/BaseCommandImplementor.cs +++ b/Scripts/Commands/Generic/Implementors/BaseCommandImplementor.cs @@ -307,7 +307,7 @@ namespace Server.Commands.Generic return; for ( int i = 0; i < m_Accessors.Length; ++i ) - CommandSystem.Register( m_Accessors[i], m_AccessLevel, new CommandEventHandler( Execute ) ); + CommandSystem.Register( m_Accessors[i], m_AccessLevel, Execute ); } public static void Register( BaseCommandImplementor impl ) diff --git a/Scripts/Commands/Generic/Implementors/SingleCommandImplementor.cs b/Scripts/Commands/Generic/Implementors/SingleCommandImplementor.cs index db39c4561..c94b01b06 100644 --- a/Scripts/Commands/Generic/Implementors/SingleCommandImplementor.cs +++ b/Scripts/Commands/Generic/Implementors/SingleCommandImplementor.cs @@ -18,7 +18,7 @@ namespace Server.Commands.Generic base.Register( command ); for ( int i = 0; i < command.Commands.Length; ++i ) - CommandSystem.Register( command.Commands[i], command.AccessLevel, new CommandEventHandler( Redirect ) ); + CommandSystem.Register( command.Commands[i], command.AccessLevel, Redirect ); } public void Redirect( CommandEventArgs e ) diff --git a/Scripts/Commands/Handlers.cs b/Scripts/Commands/Handlers.cs index 25702c574..491a4d3da 100644 --- a/Scripts/Commands/Handlers.cs +++ b/Scripts/Commands/Handlers.cs @@ -21,55 +21,55 @@ namespace Server.Commands { CommandSystem.Prefix = "["; - Register( "Go", AccessLevel.Counselor, new CommandEventHandler( Go_OnCommand ) ); + Register( "Go", AccessLevel.Counselor, Go_OnCommand ); - Register( "DropHolding", AccessLevel.Counselor, new CommandEventHandler( DropHolding_OnCommand ) ); + Register( "DropHolding", AccessLevel.Counselor, DropHolding_OnCommand ); - Register( "GetFollowers", AccessLevel.GameMaster, new CommandEventHandler( GetFollowers_OnCommand ) ); + Register( "GetFollowers", AccessLevel.GameMaster, GetFollowers_OnCommand ); - Register( "ClearFacet", AccessLevel.Administrator, new CommandEventHandler( ClearFacet_OnCommand ) ); + Register( "ClearFacet", AccessLevel.Administrator, ClearFacet_OnCommand ); - Register( "Where", AccessLevel.Counselor, new CommandEventHandler( Where_OnCommand ) ); + Register( "Where", AccessLevel.Counselor, Where_OnCommand ); - Register( "AutoPageNotify", AccessLevel.Counselor, new CommandEventHandler( APN_OnCommand ) ); - Register( "APN", AccessLevel.Counselor, new CommandEventHandler( APN_OnCommand ) ); + Register( "AutoPageNotify", AccessLevel.Counselor, APN_OnCommand ); + Register( "APN", AccessLevel.Counselor, APN_OnCommand ); - Register( "Animate", AccessLevel.GameMaster, new CommandEventHandler( Animate_OnCommand ) ); + Register( "Animate", AccessLevel.GameMaster, Animate_OnCommand ); - Register( "Cast", AccessLevel.Counselor, new CommandEventHandler( Cast_OnCommand ) ); + Register( "Cast", AccessLevel.Counselor, Cast_OnCommand ); - Register( "Stuck", AccessLevel.Counselor, new CommandEventHandler( Stuck_OnCommand ) ); + Register( "Stuck", AccessLevel.Counselor, Stuck_OnCommand ); - Register( "Help", AccessLevel.Player, new CommandEventHandler( Help_OnCommand ) ); + Register( "Help", AccessLevel.Player, Help_OnCommand ); - Register( "Save", AccessLevel.Administrator, new CommandEventHandler( Save_OnCommand ) ); - Register( "BackgroundSave", AccessLevel.Administrator, new CommandEventHandler( BackgroundSave_OnCommand ) ); - Register( "BGSave", AccessLevel.Administrator, new CommandEventHandler( BackgroundSave_OnCommand ) ); - Register( "SaveBG", AccessLevel.Administrator, new CommandEventHandler( BackgroundSave_OnCommand ) ); + Register( "Save", AccessLevel.Administrator, Save_OnCommand ); + Register( "BackgroundSave", AccessLevel.Administrator, BackgroundSave_OnCommand ); + Register( "BGSave", AccessLevel.Administrator, BackgroundSave_OnCommand ); + Register( "SaveBG", AccessLevel.Administrator, BackgroundSave_OnCommand ); - Register( "Move", AccessLevel.GameMaster, new CommandEventHandler( Move_OnCommand ) ); - Register( "Client", AccessLevel.Counselor, new CommandEventHandler( Client_OnCommand ) ); + Register( "Move", AccessLevel.GameMaster, Move_OnCommand ); + Register( "Client", AccessLevel.Counselor, Client_OnCommand ); - Register( "SMsg", AccessLevel.Counselor, new CommandEventHandler( StaffMessage_OnCommand ) ); - Register( "SM", AccessLevel.Counselor, new CommandEventHandler( StaffMessage_OnCommand ) ); - Register( "S", AccessLevel.Counselor, new CommandEventHandler( StaffMessage_OnCommand ) ); + Register( "SMsg", AccessLevel.Counselor, StaffMessage_OnCommand ); + Register( "SM", AccessLevel.Counselor, StaffMessage_OnCommand ); + Register( "S", AccessLevel.Counselor, StaffMessage_OnCommand ); - Register( "BCast", AccessLevel.GameMaster, new CommandEventHandler( BroadcastMessage_OnCommand ) ); - Register( "BC", AccessLevel.GameMaster, new CommandEventHandler( BroadcastMessage_OnCommand ) ); - Register( "B", AccessLevel.GameMaster, new CommandEventHandler( BroadcastMessage_OnCommand ) ); + Register( "BCast", AccessLevel.GameMaster, BroadcastMessage_OnCommand ); + Register( "BC", AccessLevel.GameMaster, BroadcastMessage_OnCommand ); + Register( "B", AccessLevel.GameMaster, BroadcastMessage_OnCommand ); - Register( "Bank", AccessLevel.GameMaster, new CommandEventHandler( Bank_OnCommand ) ); + Register( "Bank", AccessLevel.GameMaster, Bank_OnCommand ); - Register( "Echo", AccessLevel.Counselor, new CommandEventHandler( Echo_OnCommand ) ); + Register( "Echo", AccessLevel.Counselor, Echo_OnCommand ); - Register( "Sound", AccessLevel.GameMaster, new CommandEventHandler( Sound_OnCommand ) ); + Register( "Sound", AccessLevel.GameMaster, Sound_OnCommand ); - Register( "ViewEquip", AccessLevel.GameMaster, new CommandEventHandler( ViewEquip_OnCommand ) ); + Register( "ViewEquip", AccessLevel.GameMaster, ViewEquip_OnCommand ); - Register( "Light", AccessLevel.Counselor, new CommandEventHandler( Light_OnCommand ) ); - Register( "Stats", AccessLevel.Counselor, new CommandEventHandler( Stats_OnCommand ) ); + Register( "Light", AccessLevel.Counselor, Light_OnCommand ); + Register( "Stats", AccessLevel.Counselor, Stats_OnCommand ); - Register( "SpeedBoost", AccessLevel.Counselor, new CommandEventHandler( SpeedBoost_OnCommand ) ); + Register( "SpeedBoost", AccessLevel.Counselor, SpeedBoost_OnCommand ); } public static void Register( string command, AccessLevel access, CommandEventHandler handler ) @@ -137,7 +137,7 @@ namespace Server.Commands [Description( "Drops the item, if any, that a targeted player is holding. The item is placed into their backpack, or if that's full, at their feet." )] public static void DropHolding_OnCommand( CommandEventArgs e ) { - e.Mobile.BeginTarget( -1, false, TargetFlags.None, new TargetCallback( DropHolding_OnTarget ) ); + e.Mobile.BeginTarget( -1, false, TargetFlags.None, DropHolding_OnTarget ); e.Mobile.SendMessage( "Target the player to drop what they are holding." ); } @@ -177,7 +177,7 @@ namespace Server.Commands } else { - from.BeginTarget( -1, false, TargetFlags.None, new TargetCallback( DropHolding_OnTarget ) ); + from.BeginTarget( -1, false, TargetFlags.None, DropHolding_OnTarget ); from.SendMessage( "That is not a player. Try again." ); } } @@ -234,7 +234,7 @@ namespace Server.Commands e.Mobile.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, new WarningGumpCallback( DeleteList_Callback ), list ) ); + 0xFFC000, 360, 260, DeleteList_Callback, list ) ); } else { @@ -246,7 +246,7 @@ namespace Server.Commands [Description( "Teleports all pets of a targeted player to your location." )] public static void GetFollowers_OnCommand( CommandEventArgs e ) { - e.Mobile.BeginTarget( -1, false, TargetFlags.None, new TargetCallback( GetFollowers_OnTarget ) ); + e.Mobile.BeginTarget( -1, false, TargetFlags.None, GetFollowers_OnTarget ); e.Mobile.SendMessage( "Target a player to get their pets." ); } @@ -313,7 +313,7 @@ namespace Server.Commands } else { - from.BeginTarget( -1, false, TargetFlags.None, new TargetCallback( GetFollowers_OnTarget ) ); + from.BeginTarget( -1, false, TargetFlags.None, GetFollowers_OnTarget ); from.SendMessage( "That is not a player. Try again." ); } } diff --git a/Scripts/Commands/HelpInfo.cs b/Scripts/Commands/HelpInfo.cs index d8ec60239..07939b497 100644 --- a/Scripts/Commands/HelpInfo.cs +++ b/Scripts/Commands/HelpInfo.cs @@ -22,7 +22,7 @@ namespace Server.Commands [CallPriority( 100 )] public static void Initialize() { - CommandSystem.Register( "HelpInfo", AccessLevel.Player, new CommandEventHandler( HelpInfo_OnCommand ) ); + CommandSystem.Register( "HelpInfo", AccessLevel.Player, HelpInfo_OnCommand ); FillTable(); } diff --git a/Scripts/Commands/Logging.cs b/Scripts/Commands/Logging.cs index dc916697c..6a95ae36e 100644 --- a/Scripts/Commands/Logging.cs +++ b/Scripts/Commands/Logging.cs @@ -17,7 +17,7 @@ namespace Server.Commands public static void Initialize() { - EventSink.Command += new CommandEventHandler( EventSink_Command ); + EventSink.Command += EventSink_Command; if ( !Directory.Exists( "Logs" ) ) Directory.CreateDirectory( "Logs" ); diff --git a/Scripts/Commands/Profiling.cs b/Scripts/Commands/Profiling.cs index 8e4b4602b..4e1843b1c 100644 --- a/Scripts/Commands/Profiling.cs +++ b/Scripts/Commands/Profiling.cs @@ -9,13 +9,13 @@ namespace Server.Commands { public static void Initialize() { - CommandSystem.Register( "DumpTimers", AccessLevel.Administrator, new CommandEventHandler( DumpTimers_OnCommand ) ); - CommandSystem.Register( "CountObjects", AccessLevel.Administrator, new CommandEventHandler( CountObjects_OnCommand ) ); - CommandSystem.Register( "ProfileWorld", AccessLevel.Administrator, new CommandEventHandler( ProfileWorld_OnCommand ) ); - CommandSystem.Register( "TraceInternal", AccessLevel.Administrator, new CommandEventHandler( TraceInternal_OnCommand ) ); - CommandSystem.Register( "TraceExpanded", AccessLevel.Administrator, new CommandEventHandler( TraceExpanded_OnCommand ) ); - CommandSystem.Register( "WriteProfiles", AccessLevel.Administrator, new CommandEventHandler( WriteProfiles_OnCommand ) ); - CommandSystem.Register( "SetProfiles", AccessLevel.Administrator, new CommandEventHandler( SetProfiles_OnCommand ) ); + CommandSystem.Register( "DumpTimers", AccessLevel.Administrator, DumpTimers_OnCommand ); + CommandSystem.Register( "CountObjects", AccessLevel.Administrator, CountObjects_OnCommand ); + CommandSystem.Register( "ProfileWorld", AccessLevel.Administrator, ProfileWorld_OnCommand ); + CommandSystem.Register( "TraceInternal", AccessLevel.Administrator, TraceInternal_OnCommand ); + CommandSystem.Register( "TraceExpanded", AccessLevel.Administrator, TraceExpanded_OnCommand ); + CommandSystem.Register( "WriteProfiles", AccessLevel.Administrator, WriteProfiles_OnCommand ); + CommandSystem.Register( "SetProfiles", AccessLevel.Administrator, SetProfiles_OnCommand ); } [Usage( "WriteProfiles" )] diff --git a/Scripts/Commands/Properties.cs b/Scripts/Commands/Properties.cs index 3b403e064..647e2b7f2 100644 --- a/Scripts/Commands/Properties.cs +++ b/Scripts/Commands/Properties.cs @@ -19,7 +19,7 @@ namespace Server.Commands { public static void Initialize() { - CommandSystem.Register( "Props", AccessLevel.Counselor, new CommandEventHandler( Props_OnCommand ) ); + CommandSystem.Register( "Props", AccessLevel.Counselor, Props_OnCommand ); } private class PropsTarget : Target diff --git a/Scripts/Commands/ShardTime.cs b/Scripts/Commands/ShardTime.cs index 07c10dbac..97d3f3294 100644 --- a/Scripts/Commands/ShardTime.cs +++ b/Scripts/Commands/ShardTime.cs @@ -6,7 +6,7 @@ namespace Server.Commands { public static void Initialize() { - CommandSystem.Register( "Time", AccessLevel.Player, new CommandEventHandler( Time_OnCommand ) ); + CommandSystem.Register( "Time", AccessLevel.Player, Time_OnCommand ); } [Usage( "Time" )] diff --git a/Scripts/Commands/SignParser.cs b/Scripts/Commands/SignParser.cs index 265507296..8e08eed2b 100644 --- a/Scripts/Commands/SignParser.cs +++ b/Scripts/Commands/SignParser.cs @@ -24,7 +24,7 @@ namespace Server.Commands public static void Initialize() { - CommandSystem.Register( "SignGen", AccessLevel.Administrator, new CommandEventHandler( SignGen_OnCommand ) ); + CommandSystem.Register( "SignGen", AccessLevel.Administrator, SignGen_OnCommand ); } [Usage( "SignGen" )] diff --git a/Scripts/Commands/Skills.cs b/Scripts/Commands/Skills.cs index 3b8c93fcb..b9dbe64bf 100644 --- a/Scripts/Commands/Skills.cs +++ b/Scripts/Commands/Skills.cs @@ -7,9 +7,9 @@ namespace Server.Commands { public static void Initialize() { - CommandSystem.Register( "SetSkill", AccessLevel.GameMaster, new CommandEventHandler( SetSkill_OnCommand ) ); - CommandSystem.Register( "GetSkill", AccessLevel.GameMaster, new CommandEventHandler( GetSkill_OnCommand ) ); - CommandSystem.Register( "SetAllSkills", AccessLevel.GameMaster, new CommandEventHandler( SetAllSkills_OnCommand ) ); + CommandSystem.Register( "SetSkill", AccessLevel.GameMaster, SetSkill_OnCommand ); + CommandSystem.Register( "GetSkill", AccessLevel.GameMaster, GetSkill_OnCommand ); + CommandSystem.Register( "SetAllSkills", AccessLevel.GameMaster, SetAllSkills_OnCommand ); } [Usage( "SetSkill " )] diff --git a/Scripts/Commands/SkillsMenu.cs b/Scripts/Commands/SkillsMenu.cs index c82213d4f..3b1f8084e 100644 --- a/Scripts/Commands/SkillsMenu.cs +++ b/Scripts/Commands/SkillsMenu.cs @@ -12,7 +12,7 @@ namespace Server.Commands public static void Register() { - CommandSystem.Register( "Skills", AccessLevel.Counselor, new CommandEventHandler( Skills_OnCommand ) ); + CommandSystem.Register( "Skills", AccessLevel.Counselor, Skills_OnCommand ); } private class SkillsTarget : Target diff --git a/Scripts/Commands/Statics.cs b/Scripts/Commands/Statics.cs index a34e24901..e6bf2fa7c 100644 --- a/Scripts/Commands/Statics.cs +++ b/Scripts/Commands/Statics.cs @@ -12,13 +12,13 @@ namespace Server { public static void Initialize() { - CommandSystem.Register( "Freeze", AccessLevel.Administrator, new CommandEventHandler( Freeze_OnCommand ) ); - CommandSystem.Register( "FreezeMap", AccessLevel.Administrator, new CommandEventHandler( FreezeMap_OnCommand ) ); - CommandSystem.Register( "FreezeWorld", AccessLevel.Administrator, new CommandEventHandler( FreezeWorld_OnCommand ) ); + CommandSystem.Register( "Freeze", AccessLevel.Administrator, Freeze_OnCommand ); + CommandSystem.Register( "FreezeMap", AccessLevel.Administrator, FreezeMap_OnCommand ); + CommandSystem.Register( "FreezeWorld", AccessLevel.Administrator, FreezeWorld_OnCommand ); - CommandSystem.Register( "Unfreeze", AccessLevel.Administrator, new CommandEventHandler( Unfreeze_OnCommand ) ); - CommandSystem.Register( "UnfreezeMap", AccessLevel.Administrator, new CommandEventHandler( UnfreezeMap_OnCommand ) ); - CommandSystem.Register( "UnfreezeWorld", AccessLevel.Administrator, new CommandEventHandler( UnfreezeWorld_OnCommand ) ); + CommandSystem.Register( "Unfreeze", AccessLevel.Administrator, Unfreeze_OnCommand ); + CommandSystem.Register( "UnfreezeMap", AccessLevel.Administrator, UnfreezeMap_OnCommand ); + CommandSystem.Register( "UnfreezeWorld", AccessLevel.Administrator, UnfreezeWorld_OnCommand ); } private static Point3D NullP3D = new Point3D( int.MinValue, int.MinValue, int.MinValue ); @@ -27,7 +27,7 @@ namespace Server [Description( "Makes a targeted area of dynamic items static." )] public static void Freeze_OnCommand( CommandEventArgs e ) { - BoundingBoxPicker.Begin( e.Mobile, new BoundingBoxCallback( FreezeBox_Callback ), null ); + BoundingBoxPicker.Begin( e.Mobile, FreezeBox_Callback, null ); } [Usage( "FreezeMap" )] @@ -37,14 +37,14 @@ namespace Server Map map = e.Mobile.Map; if ( map != null && map != Map.Internal ) - SendWarning( e.Mobile, "You are about to freeze all items in {0}.", BaseFreezeWarning, map, NullP3D, NullP3D, new WarningGumpCallback( FreezeWarning_Callback ) ); + SendWarning( e.Mobile, "You are about to freeze all items in {0}.", BaseFreezeWarning, map, NullP3D, NullP3D, FreezeWarning_Callback ); } [Usage( "FreezeWorld" )] [Description( "Makes every dynamic item on all maps static." )] public static void FreezeWorld_OnCommand( CommandEventArgs e ) { - SendWarning( e.Mobile, "You are about to freeze every item on every map.", BaseFreezeWarning, null, NullP3D, NullP3D, new WarningGumpCallback( FreezeWarning_Callback ) ); + SendWarning( e.Mobile, "You are about to freeze every item on every map.", BaseFreezeWarning, null, NullP3D, NullP3D, FreezeWarning_Callback ); } public static void SendWarning( Mobile m, string header, string baseWarning, Map map, Point3D start, Point3D end, WarningGumpCallback callback ) @@ -64,7 +64,7 @@ namespace Server private static void FreezeBox_Callback( Mobile from, Map map, Point3D start, Point3D end, object state ) { - SendWarning( from, "You are about to freeze a section of items.", BaseFreezeWarning, map, start, end, new WarningGumpCallback( FreezeWarning_Callback ) ); + SendWarning( from, "You are about to freeze a section of items.", BaseFreezeWarning, map, start, end, FreezeWarning_Callback ); } private static void FreezeWarning_Callback( Mobile from, bool okay, object state ) @@ -290,7 +290,7 @@ namespace Server [Description( "Makes a targeted area of static items dynamic." )] public static void Unfreeze_OnCommand( CommandEventArgs e ) { - BoundingBoxPicker.Begin( e.Mobile, new BoundingBoxCallback( UnfreezeBox_Callback ), null ); + BoundingBoxPicker.Begin( e.Mobile, UnfreezeBox_Callback, null ); } [Usage( "UnfreezeMap" )] @@ -300,19 +300,19 @@ namespace Server Map map = e.Mobile.Map; if ( map != null && map != Map.Internal ) - SendWarning( e.Mobile, "You are about to unfreeze all items in {0}.", BaseUnfreezeWarning, map, NullP3D, NullP3D, new WarningGumpCallback( UnfreezeWarning_Callback ) ); + SendWarning( e.Mobile, "You are about to unfreeze all items in {0}.", BaseUnfreezeWarning, map, NullP3D, NullP3D, UnfreezeWarning_Callback ); } [Usage( "UnfreezeWorld" )] [Description( "Makes every static item on all maps dynamic." )] public static void UnfreezeWorld_OnCommand( CommandEventArgs e ) { - SendWarning( e.Mobile, "You are about to unfreeze every item on every map.", BaseUnfreezeWarning, null, NullP3D, NullP3D, new WarningGumpCallback( UnfreezeWarning_Callback ) ); + SendWarning( e.Mobile, "You are about to unfreeze every item on every map.", BaseUnfreezeWarning, null, NullP3D, NullP3D, UnfreezeWarning_Callback ); } private static void UnfreezeBox_Callback( Mobile from, Map map, Point3D start, Point3D end, object state ) { - SendWarning( from, "You are about to unfreeze a section of items.", BaseUnfreezeWarning, map, start, end, new WarningGumpCallback( UnfreezeWarning_Callback ) ); + SendWarning( from, "You are about to unfreeze a section of items.", BaseUnfreezeWarning, map, start, end, UnfreezeWarning_Callback ); } private static void UnfreezeWarning_Callback( Mobile from, bool okay, object state ) diff --git a/Scripts/Commands/VisibilityList.cs b/Scripts/Commands/VisibilityList.cs index 5323b30b2..93f3172b3 100644 --- a/Scripts/Commands/VisibilityList.cs +++ b/Scripts/Commands/VisibilityList.cs @@ -9,11 +9,11 @@ namespace Server.Commands { public static void Initialize() { - EventSink.Login += new LoginEventHandler( OnLogin ); + EventSink.Login += OnLogin; - CommandSystem.Register( "Vis", AccessLevel.Counselor, new CommandEventHandler( Vis_OnCommand ) ); - CommandSystem.Register( "VisList", AccessLevel.Counselor, new CommandEventHandler( VisList_OnCommand ) ); - CommandSystem.Register( "VisClear", AccessLevel.Counselor, new CommandEventHandler( VisClear_OnCommand ) ); + CommandSystem.Register( "Vis", AccessLevel.Counselor, Vis_OnCommand ); + CommandSystem.Register( "VisList", AccessLevel.Counselor, VisList_OnCommand ); + CommandSystem.Register( "VisClear", AccessLevel.Counselor, VisClear_OnCommand ); } public static void OnLogin( LoginEventArgs e ) diff --git a/Scripts/Commands/Wipe.cs b/Scripts/Commands/Wipe.cs index 64b041816..e8c9dd8bb 100644 --- a/Scripts/Commands/Wipe.cs +++ b/Scripts/Commands/Wipe.cs @@ -18,10 +18,10 @@ namespace Server.Commands public static void Initialize() { - CommandSystem.Register( "Wipe", AccessLevel.GameMaster, new CommandEventHandler( WipeAll_OnCommand ) ); - CommandSystem.Register( "WipeItems", AccessLevel.GameMaster, new CommandEventHandler( WipeItems_OnCommand ) ); - CommandSystem.Register( "WipeNPCs", AccessLevel.GameMaster, new CommandEventHandler( WipeNPCs_OnCommand ) ); - CommandSystem.Register( "WipeMultis", AccessLevel.GameMaster, new CommandEventHandler( WipeMultis_OnCommand ) ); + CommandSystem.Register( "Wipe", AccessLevel.GameMaster, WipeAll_OnCommand ); + CommandSystem.Register( "WipeItems", AccessLevel.GameMaster, WipeItems_OnCommand ); + CommandSystem.Register( "WipeNPCs", AccessLevel.GameMaster, WipeNPCs_OnCommand ); + CommandSystem.Register( "WipeMultis", AccessLevel.GameMaster, WipeMultis_OnCommand ); } [Usage( "Wipe" )] @@ -54,7 +54,7 @@ namespace Server.Commands public static void BeginWipe( Mobile from, WipeType type ) { - BoundingBoxPicker.Begin( from, new BoundingBoxCallback( WipeBox_Callback ), type ); + BoundingBoxPicker.Begin( from, WipeBox_Callback, type ); } private static void WipeBox_Callback( Mobile from, Map map, Point3D start, Point3D end, object state ) diff --git a/Scripts/Engines/BulkOrders/Rewards.cs b/Scripts/Engines/BulkOrders/Rewards.cs index 67e782dbe..6b0df0fa0 100644 --- a/Scripts/Engines/BulkOrders/Rewards.cs +++ b/Scripts/Engines/BulkOrders/Rewards.cs @@ -178,16 +178,16 @@ namespace Server.Engines.BulkOrders public sealed class SmithRewardCalculator : RewardCalculator { #region Constructors - private static readonly ConstructCallback SturdyShovel = new ConstructCallback( CreateSturdyShovel ); - private static readonly ConstructCallback SturdyPickaxe = new ConstructCallback( CreateSturdyPickaxe ); - private static readonly ConstructCallback MiningGloves = new ConstructCallback( CreateMiningGloves ); - private static readonly ConstructCallback GargoylesPickaxe = new ConstructCallback( CreateGargoylesPickaxe ); - private static readonly ConstructCallback ProspectorsTool = new ConstructCallback( CreateProspectorsTool ); - private static readonly ConstructCallback PowderOfTemperament = new ConstructCallback( CreatePowderOfTemperament ); - private static readonly ConstructCallback RunicHammer = new ConstructCallback( CreateRunicHammer ); - private static readonly ConstructCallback PowerScroll = new ConstructCallback( CreatePowerScroll ); - private static readonly ConstructCallback ColoredAnvil = new ConstructCallback( CreateColoredAnvil ); - private static readonly ConstructCallback AncientHammer = new ConstructCallback( CreateAncientHammer ); + private static readonly ConstructCallback SturdyShovel = CreateSturdyShovel; + private static readonly ConstructCallback SturdyPickaxe = CreateSturdyPickaxe; + private static readonly ConstructCallback MiningGloves = CreateMiningGloves; + private static readonly ConstructCallback GargoylesPickaxe = CreateGargoylesPickaxe; + private static readonly ConstructCallback ProspectorsTool = CreateProspectorsTool; + private static readonly ConstructCallback PowderOfTemperament = CreatePowderOfTemperament; + private static readonly ConstructCallback RunicHammer = CreateRunicHammer; + private static readonly ConstructCallback PowerScroll = CreatePowerScroll; + private static readonly ConstructCallback ColoredAnvil = CreateColoredAnvil; + private static readonly ConstructCallback AncientHammer = CreateAncientHammer; private static Item CreateSturdyShovel( int type ) { @@ -460,14 +460,14 @@ namespace Server.Engines.BulkOrders public sealed class TailorRewardCalculator : RewardCalculator { #region Constructors - private static readonly ConstructCallback Cloth = new ConstructCallback( CreateCloth ); - private static readonly ConstructCallback Sandals = new ConstructCallback( CreateSandals ); - private static readonly ConstructCallback StretchedHide = new ConstructCallback( CreateStretchedHide ); - private static readonly ConstructCallback RunicKit = new ConstructCallback( CreateRunicKit ); - private static readonly ConstructCallback Tapestry = new ConstructCallback( CreateTapestry ); - private static readonly ConstructCallback PowerScroll = new ConstructCallback( CreatePowerScroll ); - private static readonly ConstructCallback BearRug = new ConstructCallback( CreateBearRug ); - private static readonly ConstructCallback ClothingBlessDeed = new ConstructCallback( CreateCBD ); + private static readonly ConstructCallback Cloth = CreateCloth; + private static readonly ConstructCallback Sandals = CreateSandals; + private static readonly ConstructCallback StretchedHide = CreateStretchedHide; + private static readonly ConstructCallback RunicKit = CreateRunicKit; + private static readonly ConstructCallback Tapestry = CreateTapestry; + private static readonly ConstructCallback PowerScroll = CreatePowerScroll; + private static readonly ConstructCallback BearRug = CreateBearRug; + private static readonly ConstructCallback ClothingBlessDeed = CreateCBD; private static int[][] m_ClothHues = { new[]{ 0x483, 0x48C, 0x488, 0x48A }, diff --git a/Scripts/Engines/CannedEvil/ChampionSpawn.cs b/Scripts/Engines/CannedEvil/ChampionSpawn.cs index 3a4b868a8..472cd2bfd 100644 --- a/Scripts/Engines/CannedEvil/ChampionSpawn.cs +++ b/Scripts/Engines/CannedEvil/ChampionSpawn.cs @@ -80,7 +80,7 @@ namespace Server.Engines.CannedEvil m_DamageEntries = new Dictionary(); - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( SetInitialSpawnArea ) ); + Timer.DelayCall( TimeSpan.Zero, SetInitialSpawnArea ); } public void SetInitialSpawnArea() @@ -1179,7 +1179,7 @@ namespace Server.Engines.CannedEvil } } - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( UpdateRegion ) ); + Timer.DelayCall( TimeSpan.Zero, UpdateRegion ); } } diff --git a/Scripts/Engines/Chat/Chat.cs b/Scripts/Engines/Chat/Chat.cs index 2d0362ca7..58aa5b3f5 100644 --- a/Scripts/Engines/Chat/Chat.cs +++ b/Scripts/Engines/Chat/Chat.cs @@ -17,8 +17,8 @@ namespace Server.Engines.Chat public static void Initialize() { - PacketHandlers.Register( 0xB5, 0x40, true, new OnPacketReceive( OpenChatWindowRequest ) ); - PacketHandlers.Register( 0xB3, 0, true, new OnPacketReceive( ChatAction ) ); + PacketHandlers.Register( 0xB5, 0x40, true, OpenChatWindowRequest ); + PacketHandlers.Register( 0xB3, 0, true, ChatAction ); } public static void SendCommandTo( Mobile to, ChatCommand type ) diff --git a/Scripts/Engines/Chat/ChatActionHandlers.cs b/Scripts/Engines/Chat/ChatActionHandlers.cs index 49890c7eb..81851b3bf 100644 --- a/Scripts/Engines/Chat/ChatActionHandlers.cs +++ b/Scripts/Engines/Chat/ChatActionHandlers.cs @@ -8,36 +8,36 @@ namespace Server.Engines.Chat { m_Handlers = new ChatActionHandler[0x100]; - Register( 0x41, true, true, new OnChatAction( ChangeChannelPassword ) ); + Register( 0x41, true, true, ChangeChannelPassword ); - Register( 0x58, false, false, new OnChatAction( LeaveChat ) ); + Register( 0x58, false, false, LeaveChat ); - Register( 0x61, false, true, new OnChatAction( ChannelMessage ) ); - Register( 0x62, false, false, new OnChatAction( JoinChannel ) ); - Register( 0x63, false, false, new OnChatAction( JoinNewChannel ) ); - Register( 0x64, true, true, new OnChatAction( RenameChannel ) ); - Register( 0x65, false, false, new OnChatAction( PrivateMessage ) ); - Register( 0x66, false, false, new OnChatAction( AddIgnore ) ); - Register( 0x67, false, false, new OnChatAction( RemoveIgnore ) ); - Register( 0x68, false, false, new OnChatAction( ToggleIgnore ) ); - Register( 0x69, true, true, new OnChatAction( AddVoice ) ); - Register( 0x6A, true, true, new OnChatAction( RemoveVoice ) ); - Register( 0x6B, true, true, new OnChatAction( ToggleVoice ) ); - Register( 0x6C, true, true, new OnChatAction( AddModerator ) ); - Register( 0x6D, true, true, new OnChatAction( RemoveModerator ) ); - Register( 0x6E, true, true, new OnChatAction( ToggleModerator ) ); - Register( 0x6F, false, false, new OnChatAction( AllowPrivateMessages ) ); - Register( 0x70, false, false, new OnChatAction( DisallowPrivateMessages ) ); - Register( 0x71, false, false, new OnChatAction( TogglePrivateMessages ) ); - Register( 0x72, false, false, new OnChatAction( ShowCharacterName ) ); - Register( 0x73, false, false, new OnChatAction( HideCharacterName ) ); - Register( 0x74, false, false, new OnChatAction( ToggleCharacterName ) ); - Register( 0x75, false, false, new OnChatAction( QueryWhoIs ) ); - Register( 0x76, true, true, new OnChatAction( Kick ) ); - Register( 0x77, true, true, new OnChatAction( EnableDefaultVoice ) ); - Register( 0x78, true, true, new OnChatAction( DisableDefaultVoice ) ); - Register( 0x79, true, true, new OnChatAction( ToggleDefaultVoice ) ); - Register( 0x7A, false, true, new OnChatAction( EmoteMessage ) ); + Register( 0x61, false, true, ChannelMessage ); + Register( 0x62, false, false, JoinChannel ); + Register( 0x63, false, false, JoinNewChannel ); + Register( 0x64, true, true, RenameChannel ); + Register( 0x65, false, false, PrivateMessage ); + Register( 0x66, false, false, AddIgnore ); + Register( 0x67, false, false, RemoveIgnore ); + Register( 0x68, false, false, ToggleIgnore ); + Register( 0x69, true, true, AddVoice ); + Register( 0x6A, true, true, RemoveVoice ); + Register( 0x6B, true, true, ToggleVoice ); + Register( 0x6C, true, true, AddModerator ); + Register( 0x6D, true, true, RemoveModerator ); + Register( 0x6E, true, true, ToggleModerator ); + Register( 0x6F, false, false, AllowPrivateMessages ); + Register( 0x70, false, false, DisallowPrivateMessages ); + Register( 0x71, false, false, TogglePrivateMessages ); + Register( 0x72, false, false, ShowCharacterName ); + Register( 0x73, false, false, HideCharacterName ); + Register( 0x74, false, false, ToggleCharacterName ); + Register( 0x75, false, false, QueryWhoIs ); + Register( 0x76, true, true, Kick ); + Register( 0x77, true, true, EnableDefaultVoice ); + Register( 0x78, true, true, DisableDefaultVoice ); + Register( 0x79, true, true, ToggleDefaultVoice ); + Register( 0x7A, false, true, EmoteMessage ); } public static void Register( int actionID, bool requireModerator, bool requireConference, OnChatAction callback ) diff --git a/Scripts/Engines/Chat/Chatold.cs b/Scripts/Engines/Chat/Chatold.cs index 2b10ce9a9..34f3dac9d 100644 --- a/Scripts/Engines/Chat/Chatold.cs +++ b/Scripts/Engines/Chat/Chatold.cs @@ -4,7 +4,7 @@ namespace Server.Chat { public static void Initialize() { - EventSink.ChatRequest += new ChatRequestEventHandler( EventSink_ChatRequest ); + EventSink.ChatRequest += EventSink_ChatRequest; } private static void EventSink_ChatRequest( ChatRequestEventArgs e ) diff --git a/Scripts/Engines/ConPVP/AcceptDuelGump.cs b/Scripts/Engines/ConPVP/AcceptDuelGump.cs index 312a990b6..faba86f42 100644 --- a/Scripts/Engines/ConPVP/AcceptDuelGump.cs +++ b/Scripts/Engines/ConPVP/AcceptDuelGump.cs @@ -97,7 +97,7 @@ namespace Server.Engines.ConPVP AddButton( 314, 173, 247, 248, 1, GumpButtonType.Reply, 0 ); - Timer.DelayCall( TimeSpan.FromSeconds( 15.0 ), new TimerCallback( AutoReject ) ); + Timer.DelayCall( TimeSpan.FromSeconds( 15.0 ), AutoReject ); } public void AutoReject() diff --git a/Scripts/Engines/ConPVP/Arena.cs b/Scripts/Engines/ConPVP/Arena.cs index b4111fe33..016e6eabf 100644 --- a/Scripts/Engines/ConPVP/Arena.cs +++ b/Scripts/Engines/ConPVP/Arena.cs @@ -575,10 +575,10 @@ namespace Server.Engines.ConPVP m_Region = new SafeZone( m_Zone, m_Outside, m_Facet, m_IsGuarded ); if ( IsOccupied ) - Timer.DelayCall( TimeSpan.FromSeconds( 2.0 ), new TimerCallback( Evict ) ); + Timer.DelayCall( TimeSpan.FromSeconds( 2.0 ), Evict ); if ( m_Tournament != null ) - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( AttachToTournament_Sandbox ) ); + Timer.DelayCall( TimeSpan.Zero, AttachToTournament_Sandbox ); } private void AttachToTournament_Sandbox() diff --git a/Scripts/Engines/ConPVP/DuelContext.cs b/Scripts/Engines/ConPVP/DuelContext.cs index f53d71643..ea12a1174 100644 --- a/Scripts/Engines/ConPVP/DuelContext.cs +++ b/Scripts/Engines/ConPVP/DuelContext.cs @@ -673,7 +673,7 @@ namespace Server.Engines.ConPVP m_EventGame?.OnStop(); - Timer.DelayCall( TimeSpan.FromSeconds( 9.0 ), new TimerCallback( UnregisterRematch ) ); + Timer.DelayCall( TimeSpan.FromSeconds( 9.0 ), UnregisterRematch ); } public void Award( Mobile us, Mobile them, bool won ) @@ -918,11 +918,11 @@ namespace Server.Engines.ConPVP { m_SDWarnTimer?.Stop(); - m_SDWarnTimer = Timer.DelayCall( TimeSpan.FromMinutes( timeUntilActive.TotalMinutes * 0.9 ), new TimerCallback( WarnSuddenDeath ) ); + m_SDWarnTimer = Timer.DelayCall( TimeSpan.FromMinutes( timeUntilActive.TotalMinutes * 0.9 ), WarnSuddenDeath ); m_SDActivateTimer?.Stop(); - m_SDActivateTimer = Timer.DelayCall( timeUntilActive, new TimerCallback( ActivateSuddenDeath ) ); + m_SDActivateTimer = Timer.DelayCall( timeUntilActive, ActivateSuddenDeath ); } public void WarnSuddenDeath() @@ -992,7 +992,7 @@ namespace Server.Engines.ConPVP ? AutoTieDelay : TimeSpan.FromMinutes( 90.0 ); - m_AutoTieTimer = Timer.DelayCall( ts, new TimerCallback( InvokeAutoTie ) ); + m_AutoTieTimer = Timer.DelayCall( ts, InvokeAutoTie ); } public void EndAutoTie() @@ -1054,7 +1054,7 @@ namespace Server.Engines.ConPVP m_Tournament?.HandleTie( m_Arena, m_Match, remaining ); - Timer.DelayCall( TimeSpan.FromSeconds( 10.0 ), new TimerCallback( Unregister ) ); + Timer.DelayCall( TimeSpan.FromSeconds( 10.0 ), Unregister ); } public bool IsOneVsOne @@ -1076,15 +1076,15 @@ namespace Server.Engines.ConPVP public static void Initialize() { - EventSink.Speech += new SpeechEventHandler( EventSink_Speech ); - EventSink.Login += new LoginEventHandler( EventSink_Login ); + EventSink.Speech += EventSink_Speech; + EventSink.Login += EventSink_Login; - CommandSystem.Register( "vli", AccessLevel.GameMaster, new CommandEventHandler( vli_oc ) ); + CommandSystem.Register( "vli", AccessLevel.GameMaster, vli_oc ); } private static void vli_oc( CommandEventArgs e ) { - e.Mobile.BeginTarget( -1, false, Targeting.TargetFlags.None, new TargetCallback( vli_ot ) ); + e.Mobile.BeginTarget( -1, false, Targeting.TargetFlags.None, vli_ot ); } private static void vli_ot( Mobile from, object obj ) @@ -2186,7 +2186,7 @@ namespace Server.Engines.ConPVP TitleColor = 0x7800; TitleNumber = 1062051; // Gate Warning - Timer.DelayCall( TimeSpan.FromSeconds( 10.0 ), new TimerCallback( Delete ) ); + Timer.DelayCall( TimeSpan.FromSeconds( 10.0 ), Delete ); } public override void CheckGate(Mobile m, int range) @@ -2376,7 +2376,7 @@ namespace Server.Engines.ConPVP } } - StartCountdown( 10, new CountdownCallback( SendReadyGump ) ); + StartCountdown( 10, SendReadyGump ); return; } @@ -2417,7 +2417,7 @@ namespace Server.Engines.ConPVP } } - StartCountdown( 10, new CountdownCallback( SendReadyGump ) ); + StartCountdown( 10, SendReadyGump ); return; } @@ -2473,7 +2473,7 @@ namespace Server.Engines.ConPVP m_EventGame?.OnStart(); - StartCountdown( 10, new CountdownCallback( SendBeginGump ) ); + StartCountdown( 10, SendBeginGump ); mg.Appear( m_GatePoint, m_GateFacet ); } @@ -2491,7 +2491,7 @@ namespace Server.Engines.ConPVP } } - StartCountdown( 10, new CountdownCallback( SendReadyGump ) ); + StartCountdown( 10, SendReadyGump ); } return; @@ -2529,7 +2529,7 @@ namespace Server.Engines.ConPVP } if ( count == -1 && isAllReady ) - StartCountdown( 3, new CountdownCallback( SendReadyGump ) ); + StartCountdown( 3, SendReadyGump ); } public static void CloseAndSendGump( Mobile mob, Gump g, params Type[] types ) diff --git a/Scripts/Engines/ConPVP/Games/BombingRun.cs b/Scripts/Engines/ConPVP/Games/BombingRun.cs index dec498436..df4488055 100644 --- a/Scripts/Engines/ConPVP/Games/BombingRun.cs +++ b/Scripts/Engines/ConPVP/Games/BombingRun.cs @@ -105,7 +105,7 @@ namespace Server.Engines.ConPVP } } - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( Delete ) ).Start(); // delete this after the world loads + Timer.DelayCall( TimeSpan.Zero, Delete ).Start(); // delete this after the world loads } public override void Serialize(GenericWriter writer) @@ -249,7 +249,7 @@ namespace Server.Engines.ConPVP // has to be delayed in case some other target canceled us... if ( m_Resend ) - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( ResendBombTarget ) ).Start(); + Timer.DelayCall( TimeSpan.Zero, ResendBombTarget ).Start(); } private void ResendBombTarget() @@ -302,7 +302,7 @@ namespace Server.Engines.ConPVP m_Path.Clear(); m_PathIdx = 0; - Timer.DelayCall( TimeSpan.FromSeconds( 0.05 ), new TimerCallback( ContinueFlight ) ).Start(); + Timer.DelayCall( TimeSpan.FromSeconds( 0.05 ), ContinueFlight ).Start(); } private bool CheckCatch( Mobile m, Point3D myLoc ) @@ -661,7 +661,7 @@ namespace Server.Engines.ConPVP if ( m_PathIdx > 0 && m_PathIdx - 1 < m_Path.Count ) DoAnim( GetWorldLocation(), m_Path[m_PathIdx - 1], Map ); - Timer.DelayCall( TimeSpan.FromSeconds( 0.1 ), new TimerCallback( ContinueFlight ) ).Start(); + Timer.DelayCall( TimeSpan.FromSeconds( 0.1 ), ContinueFlight ).Start(); } else { @@ -1544,7 +1544,7 @@ namespace Server.Engines.ConPVP if ( m_Bomb != null && m_Controller != null ) { if ( m_UnhideCallback == null ) - m_UnhideCallback = new TimerCallback( UnhideBomb ); + m_UnhideCallback = UnhideBomb; m_Bomb.Visible = false; m_Bomb.MoveToWorld( m_Controller.BombHome, m_Controller.Map ); Timer.DelayCall( TimeSpan.FromSeconds( Utility.RandomMinMax( 5, 15 ) ), m_UnhideCallback ); @@ -1740,7 +1740,7 @@ namespace Server.Engines.ConPVP m_Bomb = new BRBomb( this ); ReturnBomb(); - m_FinishTimer = Timer.DelayCall( m_Controller.Duration, new TimerCallback( Finish_Callback ) ); + m_FinishTimer = Timer.DelayCall( m_Controller.Duration, Finish_Callback ); } private void Finish_Callback() diff --git a/Scripts/Engines/ConPVP/Games/CTF.cs b/Scripts/Engines/ConPVP/Games/CTF.cs index 35565356b..f1165c31c 100644 --- a/Scripts/Engines/ConPVP/Games/CTF.cs +++ b/Scripts/Engines/ConPVP/Games/CTF.cs @@ -260,7 +260,7 @@ namespace Server.Engines.ConPVP if ( IsChildOf( from.Backpack ) ) { - from.BeginTarget( 1, false, TargetFlags.None, new TargetCallback( Flag_OnTarget ) ); + from.BeginTarget( 1, false, TargetFlags.None, Flag_OnTarget ); } else if ( !from.InRange( this, 1 ) || !from.InLOS( this ) ) { @@ -343,7 +343,7 @@ namespace Server.Engines.ConPVP { StopCountdown(); - m_ReturnTimer = Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), TimeSpan.FromSeconds( 1.0 ), new TimerCallback( Countdown_OnTick ) ); + m_ReturnTimer = Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), TimeSpan.FromSeconds( 1.0 ), Countdown_OnTick ); m_ReturnCount = returnCount; } @@ -1110,7 +1110,7 @@ namespace Server.Engines.ConPVP m_FinishTimer?.Stop(); - m_FinishTimer = Timer.DelayCall( m_Controller.Duration, new TimerCallback( Finish_Callback ) ); + m_FinishTimer = Timer.DelayCall( m_Controller.Duration, Finish_Callback ); } private void Finish_Callback() diff --git a/Scripts/Engines/ConPVP/Games/DoubleDom.cs b/Scripts/Engines/ConPVP/Games/DoubleDom.cs index d11174b3d..341350bfc 100644 --- a/Scripts/Engines/ConPVP/Games/DoubleDom.cs +++ b/Scripts/Engines/ConPVP/Games/DoubleDom.cs @@ -727,7 +727,7 @@ namespace Server.Engines.ConPVP ApplyHues( m_Context.Participants[i] as Participant, m_Controller.TeamInfo[i % m_Controller.TeamInfo.Length].Color ); m_FinishTimer?.Stop(); - m_FinishTimer = Timer.DelayCall( m_Controller.Duration, new TimerCallback( Finish_Callback ) ); + m_FinishTimer = Timer.DelayCall( m_Controller.Duration, Finish_Callback ); } private void Finish_Callback() @@ -961,7 +961,7 @@ namespace Server.Engines.ConPVP if ( !wasDom && isDom ) { m_CapStage = 0; - m_CaptureTimer = Timer.DelayCall( TimeSpan.Zero, TimeSpan.FromSeconds( 1.0 ), new TimerCallback( CaptureTick ) ); + m_CaptureTimer = Timer.DelayCall( TimeSpan.Zero, TimeSpan.FromSeconds( 1.0 ), CaptureTick ); m_CaptureTimer.Start(); } } @@ -1014,7 +1014,7 @@ namespace Server.Engines.ConPVP m_Controller.PointB.SetUncapturableHue(); } - m_UncaptureTimer = Timer.DelayCall( TimeSpan.FromSeconds( 30.0 ), new TimerCallback( UncaptureTick ) ); + m_UncaptureTimer = Timer.DelayCall( TimeSpan.FromSeconds( 30.0 ), UncaptureTick ); m_UncaptureTimer.Start(); } } diff --git a/Scripts/Engines/ConPVP/Games/KingOfTheHill.cs b/Scripts/Engines/ConPVP/Games/KingOfTheHill.cs index bad0a917a..6dd7750ef 100644 --- a/Scripts/Engines/ConPVP/Games/KingOfTheHill.cs +++ b/Scripts/Engines/ConPVP/Games/KingOfTheHill.cs @@ -1029,7 +1029,7 @@ namespace Server.Engines.ConPVP mob.Frozen = false; if (corpse != null && !corpse.Deleted) - Timer.DelayCall(TimeSpan.FromSeconds(30), new TimerCallback(corpse.Delete)); + Timer.DelayCall(TimeSpan.FromSeconds(30), corpse.Delete); } public override bool OnDeath(Mobile mob, Container corpse) @@ -1106,7 +1106,7 @@ namespace Server.Engines.ConPVP board.m_Game = this; } - m_FinishTimer = Timer.DelayCall(m_Controller.Duration, new TimerCallback(Finish_Callback)); + m_FinishTimer = Timer.DelayCall(m_Controller.Duration, Finish_Callback); } private void Finish_Callback() diff --git a/Scripts/Engines/ConPVP/Tournament.cs b/Scripts/Engines/ConPVP/Tournament.cs index f06c3bf43..5b1516787 100644 --- a/Scripts/Engines/ConPVP/Tournament.cs +++ b/Scripts/Engines/ConPVP/Tournament.cs @@ -48,7 +48,7 @@ namespace Server.Engines.ConPVP [Constructible] public TournamentRegistrar() { - Timer.DelayCall( TimeSpan.FromSeconds( 30.0 ), TimeSpan.FromSeconds( 30.0 ), new TimerCallback( Announce_Callback ) ); + Timer.DelayCall( TimeSpan.FromSeconds( 30.0 ), TimeSpan.FromSeconds( 30.0 ), Announce_Callback ); } private void Announce_Callback() @@ -128,7 +128,7 @@ namespace Server.Engines.ConPVP } } - Timer.DelayCall( TimeSpan.FromSeconds( 30.0 ), TimeSpan.FromSeconds( 30.0 ), new TimerCallback( Announce_Callback ) ); + Timer.DelayCall( TimeSpan.FromSeconds( 30.0 ), TimeSpan.FromSeconds( 30.0 ), Announce_Callback ); } } @@ -733,7 +733,7 @@ namespace Server.Engines.ConPVP } else if ( m_Players.Count < m_Tournament.PlayersPerParticipant ) { - m_From.BeginTarget( 12, false, TargetFlags.None, new TargetCallback( AddPlayer_OnTarget ) ); + m_From.BeginTarget( 12, false, TargetFlags.None, AddPlayer_OnTarget ); m_From.SendGump( new ConfirmSignupGump( m_From, m_Registrar, m_Tournament, m_Players ) ); } } @@ -1072,7 +1072,7 @@ namespace Server.Engines.ConPVP y -= 3; AddButton( 314, y, 247, 248, 1, GumpButtonType.Reply, 0 ); - Timer.DelayCall( TimeSpan.FromSeconds( 15.0 ), new TimerCallback( AutoReject ) ); + Timer.DelayCall( TimeSpan.FromSeconds( 15.0 ), AutoReject ); } public void AutoReject() @@ -1575,7 +1575,7 @@ namespace Server.Engines.ConPVP } } - Timer.DelayCall( SliceInterval, SliceInterval, new TimerCallback( Slice ) ); + Timer.DelayCall( SliceInterval, SliceInterval, Slice ); } public Tournament() @@ -1590,7 +1590,7 @@ namespace Server.Engines.ConPVP m_Arenas = new ArrayList(); m_SignupPeriod = TimeSpan.FromMinutes( 10.0 ); - Timer.DelayCall( SliceInterval, SliceInterval, new TimerCallback( Slice ) ); + Timer.DelayCall( SliceInterval, SliceInterval, Slice ); } public void HandleTie( Arena arena, TournyMatch match, ArrayList remaining ) diff --git a/Scripts/Engines/Craft/Core/CraftItem.cs b/Scripts/Engines/Craft/Core/CraftItem.cs index a05e8e32a..6d7170ea7 100644 --- a/Scripts/Engines/Craft/Core/CraftItem.cs +++ b/Scripts/Engines/Craft/Core/CraftItem.cs @@ -723,7 +723,7 @@ namespace Server.Engines.Craft if ( IsQuantityType( types ) ) index = ConsumeQuantity( ourPack, types, amounts ); else - index = ourPack.ConsumeTotalGrouped( types, amounts, true, new OnItemConsumed( OnResourceConsumed ), new CheckItemGroup( CheckHueGrouping ) ); + index = ourPack.ConsumeTotalGrouped( types, amounts, true, OnResourceConsumed, CheckHueGrouping ); resHue = m_ResHue; } @@ -744,7 +744,7 @@ namespace Server.Engines.Craft if ( IsQuantityType( types ) ) index = ConsumeQuantity( ourPack, types, amounts ); else - index = ourPack.ConsumeTotalGrouped( types, amounts, true, new OnItemConsumed( OnResourceConsumed ), new CheckItemGroup( CheckHueGrouping ) ); + index = ourPack.ConsumeTotalGrouped( types, amounts, true, OnResourceConsumed, CheckHueGrouping ); resHue = m_ResHue; } @@ -768,7 +768,7 @@ namespace Server.Engines.Craft { for ( int i = 0; i < types.Length; i++ ) { - if ( ourPack.GetBestGroupAmount( types[i], true, new CheckItemGroup( CheckHueGrouping ) ) < amounts[i] ) + if ( ourPack.GetBestGroupAmount( types[i], true, CheckHueGrouping ) < amounts[i] ) { index = i; break; diff --git a/Scripts/Engines/Craft/Core/Recipes.cs b/Scripts/Engines/Craft/Core/Recipes.cs index af7afd4d8..da0498155 100644 --- a/Scripts/Engines/Craft/Core/Recipes.cs +++ b/Scripts/Engines/Craft/Core/Recipes.cs @@ -9,8 +9,8 @@ namespace Server.Engines.Craft { public static void Initialize() { - CommandSystem.Register( "LearnAllRecipes", AccessLevel.GameMaster, new CommandEventHandler( LearnAllRecipes_OnCommand ) ); - CommandSystem.Register( "ForgetAllRecipes", AccessLevel.GameMaster, new CommandEventHandler( ForgetAllRecipes_OnCommand ) ); + CommandSystem.Register( "LearnAllRecipes", AccessLevel.GameMaster, LearnAllRecipes_OnCommand ); + CommandSystem.Register( "ForgetAllRecipes", AccessLevel.GameMaster, ForgetAllRecipes_OnCommand ); } [Usage( "LearnAllRecipes" )] @@ -20,22 +20,20 @@ namespace Server.Engines.Craft Mobile m = e.Mobile; m.SendMessage( "Target a player to teach them all of the recipies." ); - m.BeginTarget( -1, false, Targeting.TargetFlags.None, new TargetCallback( - delegate( Mobile from, object targeted ) + m.BeginTarget( -1, false, Targeting.TargetFlags.None, delegate( Mobile from, object targeted ) + { + if ( targeted is PlayerMobile mobile ) { - if ( targeted is PlayerMobile mobile ) - { - foreach( KeyValuePair kvp in m_Recipes ) - mobile.AcquireRecipe( kvp.Key ); + foreach( KeyValuePair kvp in m_Recipes ) + mobile.AcquireRecipe( kvp.Key ); - m.SendMessage( "You teach them all of the recipies." ); - } - else - { - m.SendMessage( "That is not a player!" ); - } + m.SendMessage( "You teach them all of the recipies." ); } - ) ); + else + { + m.SendMessage( "That is not a player!" ); + } + } ); } [Usage( "ForgetAllRecipes" )] @@ -45,21 +43,19 @@ namespace Server.Engines.Craft Mobile m = e.Mobile; m.SendMessage( "Target a player to have them forget all of the recipies they've learned." ); - m.BeginTarget( -1, false, Targeting.TargetFlags.None, new TargetCallback( - delegate( Mobile from, object targeted ) + m.BeginTarget( -1, false, Targeting.TargetFlags.None, delegate( Mobile from, object targeted ) + { + if ( targeted is PlayerMobile mobile ) { - if ( targeted is PlayerMobile mobile ) - { - mobile.ResetRecipes(); + mobile.ResetRecipes(); - m.SendMessage( "They forget all their recipies." ); - } - else - { - m.SendMessage( "That is not a player!" ); - } + m.SendMessage( "They forget all their recipies." ); } - ) ); + else + { + m.SendMessage( "That is not a player!" ); + } + } ); } diff --git a/Scripts/Engines/Doom/GauntletSpawner.cs b/Scripts/Engines/Doom/GauntletSpawner.cs index 118204aba..9690171b7 100644 --- a/Scripts/Engines/Doom/GauntletSpawner.cs +++ b/Scripts/Engines/Doom/GauntletSpawner.cs @@ -143,7 +143,7 @@ namespace Server.Engines.Doom CreateRegion(); FullSpawn(); - m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), TimeSpan.FromSeconds( 1.0 ), new TimerCallback( Slice ) ); + m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), TimeSpan.FromSeconds( 1.0 ), Slice ); } else { @@ -459,7 +459,7 @@ namespace Server.Engines.Doom public static void Initialize() { - CommandSystem.Register( "GenGauntlet", AccessLevel.Administrator, new CommandEventHandler( GenGauntlet_OnCommand ) ); + CommandSystem.Register( "GenGauntlet", AccessLevel.Administrator, GenGauntlet_OnCommand ); } public static void CreateTeleporter( int xFrom, int yFrom, int xTo, int yTo ) diff --git a/Scripts/Engines/Doom/LeverPuzzle/LeverPuzzleController.cs b/Scripts/Engines/Doom/LeverPuzzle/LeverPuzzleController.cs index ca3bc692a..04dd663ff 100644 --- a/Scripts/Engines/Doom/LeverPuzzle/LeverPuzzleController.cs +++ b/Scripts/Engines/Doom/LeverPuzzle/LeverPuzzleController.cs @@ -33,7 +33,7 @@ namespace Server.Engines.Doom public static void Initialize() { - CommandSystem.Register( "GenLeverPuzzle", AccessLevel.Administrator, new CommandEventHandler( GenLampPuzzle_OnCommand ) ); + CommandSystem.Register( "GenLeverPuzzle", AccessLevel.Administrator, GenLampPuzzle_OnCommand ); } [Usage( "GenLeverPuzzle" )] @@ -267,7 +267,7 @@ namespace Server.Engines.Doom if ( (TheirKey=(ushort)(code|(TheirKey<<=4))) < 0x0FFF ) { - l_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 30.0 ), new TimerCallback( ResetPuzzle )); + l_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 30.0 ), ResetPuzzle); return; } diff --git a/Scripts/Engines/Doom/LeverPuzzle/LeverPuzzleItems.cs b/Scripts/Engines/Doom/LeverPuzzle/LeverPuzzleItems.cs index e8b3d158e..25434590e 100644 --- a/Scripts/Engines/Doom/LeverPuzzle/LeverPuzzleItems.cs +++ b/Scripts/Engines/Doom/LeverPuzzle/LeverPuzzleItems.cs @@ -29,7 +29,7 @@ namespace Server.Engines.Doom m_Wanderer = new WandererOfTheVoid(); m_Wanderer.MoveToWorld( LeverPuzzleController.lr_Enter, Map.Malas ); m_Wanderer.PublicOverheadMessage( MessageType.Regular, 0x3B2, 1060002, "" ); // I am the guardian of... - Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), new TimerCallback( CallBackMessage ) ); + Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), CallBackMessage ); } } diff --git a/Scripts/Engines/Doom/LeverPuzzle/LeverPuzzleRegions.cs b/Scripts/Engines/Doom/LeverPuzzle/LeverPuzzleRegions.cs index b99f93a79..118a720d1 100644 --- a/Scripts/Engines/Doom/LeverPuzzle/LeverPuzzleRegions.cs +++ b/Scripts/Engines/Doom/LeverPuzzle/LeverPuzzleRegions.cs @@ -16,7 +16,7 @@ namespace Server.Engines.Doom public static void Initialize() { - EventSink.Login += new LoginEventHandler( OnLogin ); + EventSink.Login += OnLogin; } public static void OnLogin( LoginEventArgs e ) diff --git a/Scripts/Engines/Ethics/Core/Ethic.cs b/Scripts/Engines/Ethics/Core/Ethic.cs index 42a36889b..167f9947a 100644 --- a/Scripts/Engines/Ethics/Core/Ethic.cs +++ b/Scripts/Engines/Ethics/Core/Ethic.cs @@ -83,7 +83,7 @@ namespace Server.Ethics public static void Initialize() { if ( Enabled ) - EventSink.Speech += new SpeechEventHandler( EventSink_Speech ); + EventSink.Speech += EventSink_Speech; } public static void EventSink_Speech( SpeechEventArgs e ) @@ -215,7 +215,7 @@ namespace Server.Ethics Player pl = new Player( this, reader ); if ( pl.Mobile != null ) - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( pl.CheckAttach ) ); + Timer.DelayCall( TimeSpan.Zero, pl.CheckAttach ); } break; diff --git a/Scripts/Engines/Factions/Core/Election.cs b/Scripts/Engines/Factions/Core/Election.cs index ee784d782..968d48c8d 100644 --- a/Scripts/Engines/Factions/Core/Election.cs +++ b/Scripts/Engines/Factions/Core/Election.cs @@ -73,7 +73,7 @@ namespace Server.Factions public void StartTimer() { - m_Timer = Timer.DelayCall( TimeSpan.FromMinutes( 1.0 ), TimeSpan.FromMinutes( 1.0 ), new TimerCallback( Slice ) ); + m_Timer = Timer.DelayCall( TimeSpan.FromMinutes( 1.0 ), TimeSpan.FromMinutes( 1.0 ), Slice ); } public Election( Faction faction ) diff --git a/Scripts/Engines/Factions/Core/Faction.cs b/Scripts/Engines/Factions/Core/Faction.cs index 35e092fa3..f0bf26ce9 100644 --- a/Scripts/Engines/Factions/Core/Faction.cs +++ b/Scripts/Engines/Factions/Core/Faction.cs @@ -189,7 +189,7 @@ namespace Server.Factions public void BeginHonorLeadership( Mobile from ) { from.SendLocalizedMessage( 502090 ); // Click on the player whom you wish to honor. - from.BeginTarget( 12, false, TargetFlags.None, new TargetCallback( HonorLeadership_OnTarget ) ); + from.BeginTarget( 12, false, TargetFlags.None, HonorLeadership_OnTarget ); } public void HonorLeadership_OnTarget( Mobile from, object obj ) @@ -546,18 +546,18 @@ namespace Server.Factions public static void Initialize() { - EventSink.Login += new LoginEventHandler( EventSink_Login ); - EventSink.Logout += new LogoutEventHandler( EventSink_Logout ); + EventSink.Login += EventSink_Login; + EventSink.Logout += EventSink_Logout; - Timer.DelayCall( TimeSpan.FromMinutes( 1.0 ), TimeSpan.FromMinutes( 10.0 ), new TimerCallback( HandleAtrophy ) ); + Timer.DelayCall( TimeSpan.FromMinutes( 1.0 ), TimeSpan.FromMinutes( 10.0 ), HandleAtrophy ); - Timer.DelayCall( TimeSpan.FromSeconds( 30.0 ), TimeSpan.FromSeconds( 30.0 ), new TimerCallback( ProcessTick ) ); + Timer.DelayCall( TimeSpan.FromSeconds( 30.0 ), TimeSpan.FromSeconds( 30.0 ), ProcessTick ); - CommandSystem.Register( "FactionElection", AccessLevel.GameMaster, new CommandEventHandler( FactionElection_OnCommand ) ); - CommandSystem.Register( "FactionCommander", AccessLevel.Administrator, new CommandEventHandler( FactionCommander_OnCommand ) ); - CommandSystem.Register( "FactionItemReset", AccessLevel.Administrator, new CommandEventHandler( FactionItemReset_OnCommand ) ); - CommandSystem.Register( "FactionReset", AccessLevel.Administrator, new CommandEventHandler( FactionReset_OnCommand ) ); - CommandSystem.Register( "FactionTownReset", AccessLevel.Administrator, new CommandEventHandler( FactionTownReset_OnCommand ) ); + CommandSystem.Register( "FactionElection", AccessLevel.GameMaster, FactionElection_OnCommand ); + CommandSystem.Register( "FactionCommander", AccessLevel.Administrator, FactionCommander_OnCommand ); + CommandSystem.Register( "FactionItemReset", AccessLevel.Administrator, FactionItemReset_OnCommand ); + CommandSystem.Register( "FactionReset", AccessLevel.Administrator, FactionReset_OnCommand ); + CommandSystem.Register( "FactionTownReset", AccessLevel.Administrator, FactionTownReset_OnCommand ); } public static void FactionTownReset_OnCommand( CommandEventArgs e ) @@ -726,7 +726,7 @@ namespace Server.Factions public static void FactionCommander_OnCommand( CommandEventArgs e ) { e.Mobile.SendMessage( "Target a player to make them the faction commander." ); - e.Mobile.BeginTarget( -1, false, TargetFlags.None, new TargetCallback( FactionCommander_OnTarget ) ); + e.Mobile.BeginTarget( -1, false, TargetFlags.None, FactionCommander_OnTarget ); } public static void FactionCommander_OnTarget( Mobile from, object obj ) @@ -755,7 +755,7 @@ namespace Server.Factions public static void FactionElection_OnCommand( CommandEventArgs e ) { e.Mobile.SendMessage( "Target a faction stone to open its election properties." ); - e.Mobile.BeginTarget( -1, false, TargetFlags.None, new TargetCallback( FactionElection_OnTarget ) ); + e.Mobile.BeginTarget( -1, false, TargetFlags.None, FactionElection_OnTarget ); } public static void FactionElection_OnTarget( Mobile from, object obj ) @@ -779,7 +779,7 @@ namespace Server.Factions public static void FactionKick_OnCommand( CommandEventArgs e ) { e.Mobile.SendMessage( "Target a player to remove them from their faction." ); - e.Mobile.BeginTarget( -1, false, TargetFlags.None, new TargetCallback( FactionKick_OnTarget ) ); + e.Mobile.BeginTarget( -1, false, TargetFlags.None, FactionKick_OnTarget ); } public static void FactionKick_OnTarget( Mobile from, object obj ) diff --git a/Scripts/Engines/Factions/Core/FactionState.cs b/Scripts/Engines/Factions/Core/FactionState.cs index 8c66bf57a..c38141a26 100644 --- a/Scripts/Engines/Factions/Core/FactionState.cs +++ b/Scripts/Engines/Factions/Core/FactionState.cs @@ -243,7 +243,7 @@ namespace Server.Factions { FactionItem factionItem = new FactionItem( reader, m_Faction ); - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( factionItem.CheckAttach ) ); // sandbox attachment + Timer.DelayCall( TimeSpan.Zero, factionItem.CheckAttach ); // sandbox attachment } } diff --git a/Scripts/Engines/Factions/Core/Generator.cs b/Scripts/Engines/Factions/Core/Generator.cs index 5f9e66c1c..e788b5a22 100644 --- a/Scripts/Engines/Factions/Core/Generator.cs +++ b/Scripts/Engines/Factions/Core/Generator.cs @@ -8,7 +8,7 @@ namespace Server.Factions { public static void Initialize() { - CommandSystem.Register( "GenerateFactions", AccessLevel.Administrator, new CommandEventHandler( GenerateFactions_OnCommand ) ); + CommandSystem.Register( "GenerateFactions", AccessLevel.Administrator, GenerateFactions_OnCommand ); } public static void GenerateFactions_OnCommand( CommandEventArgs e ) diff --git a/Scripts/Engines/Factions/Core/Keywords.cs b/Scripts/Engines/Factions/Core/Keywords.cs index 66d10fb59..4c401d196 100644 --- a/Scripts/Engines/Factions/Core/Keywords.cs +++ b/Scripts/Engines/Factions/Core/Keywords.cs @@ -8,7 +8,7 @@ namespace Server.Factions { public static void Initialize() { - EventSink.Speech += new SpeechEventHandler( EventSink_Speech ); + EventSink.Speech += EventSink_Speech; } private static void ShowScore_Sandbox( object state ) diff --git a/Scripts/Engines/Factions/Core/Town.cs b/Scripts/Engines/Factions/Core/Town.cs index 6456b4c60..69997479a 100644 --- a/Scripts/Engines/Factions/Core/Town.cs +++ b/Scripts/Engines/Factions/Core/Town.cs @@ -152,7 +152,7 @@ namespace Server.Factions type = "guard"; from.SendMessage( "Target the {0} you wish to dismiss.", type ); - from.BeginTarget( 12, false, TargetFlags.None, new TargetCallback( EndOrderFiring ) ); + from.BeginTarget( 12, false, TargetFlags.None, EndOrderFiring ); } public void EndOrderFiring( Mobile from, object obj ) @@ -184,7 +184,7 @@ namespace Server.Factions { m_IncomeTimer?.Stop(); - m_IncomeTimer = Timer.DelayCall( TimeSpan.FromMinutes( 1.0 ), TimeSpan.FromMinutes( 1.0 ), new TimerCallback( CheckIncome ) ); + m_IncomeTimer = Timer.DelayCall( TimeSpan.FromMinutes( 1.0 ), TimeSpan.FromMinutes( 1.0 ), CheckIncome ); } public void StopIncomeTimer() @@ -381,7 +381,7 @@ namespace Server.Factions towns[i].Finance = towns[i].Finance; } - CommandSystem.Register( "GrantTownSilver", AccessLevel.Administrator, new CommandEventHandler( GrantTownSilver_OnCommand ) ); + CommandSystem.Register( "GrantTownSilver", AccessLevel.Administrator, GrantTownSilver_OnCommand ); } public Town() diff --git a/Scripts/Engines/Factions/Gumps/TownStoneGump.cs b/Scripts/Engines/Factions/Gumps/TownStoneGump.cs index 3462ce24b..964673a89 100644 --- a/Scripts/Engines/Factions/Gumps/TownStoneGump.cs +++ b/Scripts/Engines/Factions/Gumps/TownStoneGump.cs @@ -59,7 +59,7 @@ namespace Server.Factions else { m_From.SendLocalizedMessage( 1010347 ); // Who shall be your new sheriff - m_From.BeginTarget( 12, false, TargetFlags.None, new TargetCallback( HireSheriff_OnTarget ) ); + m_From.BeginTarget( 12, false, TargetFlags.None, HireSheriff_OnTarget ); } break; @@ -73,7 +73,7 @@ namespace Server.Factions else { m_From.SendLocalizedMessage( 1010348 ); // Who shall be your new Minister of Finances? - m_From.BeginTarget( 12, false, TargetFlags.None, new TargetCallback( HireFinanceMinister_OnTarget ) ); + m_From.BeginTarget( 12, false, TargetFlags.None, HireFinanceMinister_OnTarget ); } break; diff --git a/Scripts/Engines/Factions/Items/Sigil.cs b/Scripts/Engines/Factions/Items/Sigil.cs index a2dcfe595..7ee2f54f6 100644 --- a/Scripts/Engines/Factions/Items/Sigil.cs +++ b/Scripts/Engines/Factions/Items/Sigil.cs @@ -205,7 +205,7 @@ namespace Server.Factions { if ( IsChildOf( from.Backpack ) ) { - from.BeginTarget( 1, false, Targeting.TargetFlags.None, new TargetCallback( Sigil_OnTarget ) ); + from.BeginTarget( 1, false, Targeting.TargetFlags.None, Sigil_OnTarget ); from.SendLocalizedMessage( 1042251 ); // Click on a sigil monolith or player } } diff --git a/Scripts/Engines/Factions/Items/Traps/BaseFactionTrap.cs b/Scripts/Engines/Factions/Items/Traps/BaseFactionTrap.cs index 2a54e440f..47f931969 100644 --- a/Scripts/Engines/Factions/Items/Traps/BaseFactionTrap.cs +++ b/Scripts/Engines/Factions/Items/Traps/BaseFactionTrap.cs @@ -199,7 +199,7 @@ namespace Server.Factions if ( (m_TimeOfPlacement + decayPeriod) < DateTime.UtcNow ) { - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( Delete ) ); + Timer.DelayCall( TimeSpan.Zero, Delete ); return true; } @@ -210,7 +210,7 @@ namespace Server.Factions { m_Concealing?.Stop(); - m_Concealing = Timer.DelayCall( ConcealPeriod, new TimerCallback( Conceal ) ); + m_Concealing = Timer.DelayCall( ConcealPeriod, Conceal ); } public virtual void Conceal() diff --git a/Scripts/Engines/Factions/Mobiles/Guards/BaseFactionGuard.cs b/Scripts/Engines/Factions/Mobiles/Guards/BaseFactionGuard.cs index ae651913a..6c16998e5 100644 --- a/Scripts/Engines/Factions/Mobiles/Guards/BaseFactionGuard.cs +++ b/Scripts/Engines/Factions/Mobiles/Guards/BaseFactionGuard.cs @@ -423,7 +423,7 @@ namespace Server.Factions m_Town = Town.ReadReference( reader ); m_Orders = new Orders( this, reader ); - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( Register ) ); + Timer.DelayCall( TimeSpan.Zero, Register ); } } diff --git a/Scripts/Engines/Help/HelpGump.cs b/Scripts/Engines/Help/HelpGump.cs index d31ce02fc..c7b01f3ee 100644 --- a/Scripts/Engines/Help/HelpGump.cs +++ b/Scripts/Engines/Help/HelpGump.cs @@ -49,7 +49,7 @@ namespace Server.Engines.Help { public static void Initialize() { - EventSink.HelpRequest += new HelpRequestEventHandler( EventSink_HelpRequest ); + EventSink.HelpRequest += EventSink_HelpRequest; } private static void EventSink_HelpRequest( HelpRequestEventArgs e ) diff --git a/Scripts/Engines/Help/PageQueue.cs b/Scripts/Engines/Help/PageQueue.cs index 93b26d0c9..06d202d72 100644 --- a/Scripts/Engines/Help/PageQueue.cs +++ b/Scripts/Engines/Help/PageQueue.cs @@ -157,7 +157,7 @@ namespace Server.Engines.Help public static void Initialize() { - CommandSystem.Register( "Pages", AccessLevel.Counselor, new CommandEventHandler( Pages_OnCommand ) ); + CommandSystem.Register( "Pages", AccessLevel.Counselor, Pages_OnCommand ); } public static bool CheckAllowedToPage( Mobile from ) diff --git a/Scripts/Engines/Help/SpeechLog.cs b/Scripts/Engines/Help/SpeechLog.cs index 6ae1577b8..d060fe0bb 100644 --- a/Scripts/Engines/Help/SpeechLog.cs +++ b/Scripts/Engines/Help/SpeechLog.cs @@ -21,7 +21,7 @@ namespace Server.Engines.Help public static void Initialize() { - CommandSystem.Register( "SpeechLog", AccessLevel.Counselor, new CommandEventHandler( SpeechLog_OnCommand ) ); + CommandSystem.Register( "SpeechLog", AccessLevel.Counselor, SpeechLog_OnCommand ); } [Usage( "SpeechLog" )] diff --git a/Scripts/Engines/Khaldun/KhaldunGen.cs b/Scripts/Engines/Khaldun/KhaldunGen.cs index 3a89bd2f0..94f8e5a84 100644 --- a/Scripts/Engines/Khaldun/KhaldunGen.cs +++ b/Scripts/Engines/Khaldun/KhaldunGen.cs @@ -9,7 +9,7 @@ namespace Server.Commands public static void Initialize() { - CommandSystem.Register( "GenKhaldun", AccessLevel.Administrator, new CommandEventHandler( GenKhaldun_OnCommand ) ); + CommandSystem.Register( "GenKhaldun", AccessLevel.Administrator, GenKhaldun_OnCommand ); } public static bool FindMorphItem( int x, int y, int z, int inactiveItemID, int activeItemID ) diff --git a/Scripts/Engines/Khaldun/RaisableItem.cs b/Scripts/Engines/Khaldun/RaisableItem.cs index 768f11bf0..71e8a3f59 100644 --- a/Scripts/Engines/Khaldun/RaisableItem.cs +++ b/Scripts/Engines/Khaldun/RaisableItem.cs @@ -115,7 +115,7 @@ namespace Server.Items m_Step = 0; TimeSpan delay = m_CloseTime - DateTime.UtcNow; - DelayCall( delay > TimeSpan.Zero ? delay : TimeSpan.Zero, new TimerCallback( Start ) ); + DelayCall( delay > TimeSpan.Zero ? delay : TimeSpan.Zero, Start ); return; } diff --git a/Scripts/Engines/Khaldun/RaiseSwitch.cs b/Scripts/Engines/Khaldun/RaiseSwitch.cs index 162cb85d5..27ca22645 100644 --- a/Scripts/Engines/Khaldun/RaiseSwitch.cs +++ b/Scripts/Engines/Khaldun/RaiseSwitch.cs @@ -216,7 +216,7 @@ namespace Server.Items int version = reader.ReadEncodedInt(); - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( Refresh ) ); + Timer.DelayCall( TimeSpan.Zero, Refresh ); } } } diff --git a/Scripts/Engines/MLQuests/Gumps/RaceChangeGump.cs b/Scripts/Engines/MLQuests/Gumps/RaceChangeGump.cs index 6c01fdbc7..6fa52e396 100644 --- a/Scripts/Engines/MLQuests/Gumps/RaceChangeGump.cs +++ b/Scripts/Engines/MLQuests/Gumps/RaceChangeGump.cs @@ -71,7 +71,7 @@ namespace Server.Engines.MLQuests.Gumps private class RaceChangeState { private static readonly TimeSpan m_TimeoutDelay = TimeSpan.FromMinutes( 1 ); - private static readonly TimerStateCallback m_TimeoutCallback = new TimerStateCallback( Timeout ); + private static readonly TimerStateCallback m_TimeoutCallback = Timeout; public IRaceChanger m_Owner; public Race m_TargetRace; @@ -91,7 +91,7 @@ namespace Server.Engines.MLQuests.Gumps { m_Pending = new Dictionary(); - PacketHandlers.RegisterExtended( 0x2A, true, new OnPacketReceive( RaceChangeReply ) ); + PacketHandlers.RegisterExtended( 0x2A, true, RaceChangeReply ); } public static bool IsPending( NetState state ) diff --git a/Scripts/Engines/MLQuests/MLQuestSystem.cs b/Scripts/Engines/MLQuests/MLQuestSystem.cs index 366ff954e..085db9f8b 100644 --- a/Scripts/Engines/MLQuests/MLQuestSystem.cs +++ b/Scripts/Engines/MLQuests/MLQuestSystem.cs @@ -138,15 +138,15 @@ namespace Server.Engines.MLQuests MLQuestPersistence.EnsureExistence(); - CommandSystem.Register( "MLQuestsInfo", AccessLevel.Administrator, new CommandEventHandler( MLQuestsInfo_OnCommand ) ); - CommandSystem.Register( "SaveQuest", AccessLevel.Administrator, new CommandEventHandler( SaveQuest_OnCommand ) ); - CommandSystem.Register( "SaveAllQuests", AccessLevel.Administrator, new CommandEventHandler( SaveAllQuests_OnCommand ) ); - CommandSystem.Register( "InvalidQuestItems", AccessLevel.Administrator, new CommandEventHandler( InvalidQuestItems_OnCommand ) ); + CommandSystem.Register( "MLQuestsInfo", AccessLevel.Administrator, MLQuestsInfo_OnCommand ); + CommandSystem.Register( "SaveQuest", AccessLevel.Administrator, SaveQuest_OnCommand ); + CommandSystem.Register( "SaveAllQuests", AccessLevel.Administrator, SaveAllQuests_OnCommand ); + CommandSystem.Register( "InvalidQuestItems", AccessLevel.Administrator, InvalidQuestItems_OnCommand ); TargetCommands.Register( new ViewQuestsCommand() ); TargetCommands.Register( new ViewContextCommand() ); - EventSink.QuestGumpRequest += new QuestGumpRequestHandler( EventSink_QuestGumpRequest ); + EventSink.QuestGumpRequest += EventSink_QuestGumpRequest; } [Usage( "MLQuestsInfo" )] diff --git a/Scripts/Engines/MLQuests/Objectives/EscortObjective.cs b/Scripts/Engines/MLQuests/Objectives/EscortObjective.cs index 92277ef72..26607e0ab 100644 --- a/Scripts/Engines/MLQuests/Objectives/EscortObjective.cs +++ b/Scripts/Engines/MLQuests/Objectives/EscortObjective.cs @@ -106,7 +106,7 @@ namespace Server.Engines.MLQuests.Objectives { m_Objective = objective; m_HasCompleted = false; - m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 5 ), TimeSpan.FromSeconds( 5 ), new TimerCallback( CheckDestination ) ); + m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 5 ), TimeSpan.FromSeconds( 5 ), CheckDestination ); m_LastSeenEscorter = DateTime.UtcNow; m_Escort = instance.Quester as BaseCreature; diff --git a/Scripts/Engines/MyRunUO/DatabaseCommandQueue.cs b/Scripts/Engines/MyRunUO/DatabaseCommandQueue.cs index 748909fe6..995618122 100644 --- a/Scripts/Engines/MyRunUO/DatabaseCommandQueue.cs +++ b/Scripts/Engines/MyRunUO/DatabaseCommandQueue.cs @@ -49,7 +49,7 @@ namespace Server.Engines.MyRunUO m_Sync = new ManualResetEvent( true ); - m_Thread = new Thread( new ThreadStart( Thread_Start ) ); + m_Thread = new Thread( Thread_Start ); m_Thread.Name = threadName;//"MyRunUO Database Command Queue"; m_Thread.Priority = Config.DatabaseThreadPriority; m_Thread.Start(); diff --git a/Scripts/Engines/MyRunUO/MyRunUO.cs b/Scripts/Engines/MyRunUO/MyRunUO.cs index 7d173097b..5db46b754 100644 --- a/Scripts/Engines/MyRunUO/MyRunUO.cs +++ b/Scripts/Engines/MyRunUO/MyRunUO.cs @@ -20,13 +20,13 @@ namespace Server.Engines.MyRunUO { if ( Config.Enabled ) { - DelayCall( TimeSpan.FromSeconds( 10.0 ), Config.CharacterUpdateInterval, new TimerCallback( Begin ) ); + DelayCall( TimeSpan.FromSeconds( 10.0 ), Config.CharacterUpdateInterval, Begin ); - CommandSystem.Register( "InitMyRunUO", AccessLevel.Administrator, new CommandEventHandler( InitMyRunUO_OnCommand ) ); - CommandSystem.Register( "UpdateMyRunUO", AccessLevel.Administrator, new CommandEventHandler( UpdateMyRunUO_OnCommand ) ); + CommandSystem.Register( "InitMyRunUO", AccessLevel.Administrator, InitMyRunUO_OnCommand ); + CommandSystem.Register( "UpdateMyRunUO", AccessLevel.Administrator, UpdateMyRunUO_OnCommand ); - CommandSystem.Register( "PublicChar", AccessLevel.Player, new CommandEventHandler( PublicChar_OnCommand ) ); - CommandSystem.Register( "PrivateChar", AccessLevel.Player, new CommandEventHandler( PrivateChar_OnCommand ) ); + CommandSystem.Register( "PublicChar", AccessLevel.Player, PublicChar_OnCommand ); + CommandSystem.Register( "PrivateChar", AccessLevel.Player, PrivateChar_OnCommand ); } } diff --git a/Scripts/Engines/MyRunUO/MyRunUOStatus.cs b/Scripts/Engines/MyRunUO/MyRunUOStatus.cs index 3386d7077..e23ba18ee 100644 --- a/Scripts/Engines/MyRunUO/MyRunUOStatus.cs +++ b/Scripts/Engines/MyRunUO/MyRunUOStatus.cs @@ -11,9 +11,9 @@ namespace Server.Engines.MyRunUO { if ( Config.Enabled ) { - Timer.DelayCall( TimeSpan.FromSeconds( 20.0 ), Config.StatusUpdateInterval, new TimerCallback( Begin ) ); + Timer.DelayCall( TimeSpan.FromSeconds( 20.0 ), Config.StatusUpdateInterval, Begin ); - CommandSystem.Register( "UpdateWebStatus", AccessLevel.Administrator, new CommandEventHandler( UpdateWebStatus_OnCommand ) ); + CommandSystem.Register( "UpdateWebStatus", AccessLevel.Administrator, UpdateWebStatus_OnCommand ); } } diff --git a/Scripts/Engines/Party/Party.cs b/Scripts/Engines/Party/Party.cs index 117f61a1a..0b4aa643f 100644 --- a/Scripts/Engines/Party/Party.cs +++ b/Scripts/Engines/Party/Party.cs @@ -18,16 +18,16 @@ namespace Server.Engines.PartySystem public static void Initialize() { - EventSink.Logout += new LogoutEventHandler( EventSink_Logout ); - EventSink.Login += new LoginEventHandler( EventSink_Login ); - EventSink.PlayerDeath += new PlayerDeathEventHandler( EventSink_PlayerDeath ); + EventSink.Logout += EventSink_Logout; + EventSink.Login += EventSink_Login; + EventSink.PlayerDeath += EventSink_PlayerDeath; - CommandSystem.Register( "ListenToParty", AccessLevel.GameMaster, new CommandEventHandler( ListenToParty_OnCommand ) ); + CommandSystem.Register( "ListenToParty", AccessLevel.GameMaster, ListenToParty_OnCommand ); } public static void ListenToParty_OnCommand( CommandEventArgs e ) { - e.Mobile.BeginTarget( -1, false, TargetFlags.None, new TargetCallback( ListenToParty_OnTarget ) ); + e.Mobile.BeginTarget( -1, false, TargetFlags.None, ListenToParty_OnTarget ); e.Mobile.SendMessage( "Target a partied player." ); } diff --git a/Scripts/Engines/Pathing/MovementPath.cs b/Scripts/Engines/Pathing/MovementPath.cs index 9b71662ee..9ae7fa5d2 100644 --- a/Scripts/Engines/Pathing/MovementPath.cs +++ b/Scripts/Engines/Pathing/MovementPath.cs @@ -22,12 +22,12 @@ namespace Server public static void Initialize() { - CommandSystem.Register( "Path", AccessLevel.GameMaster, new CommandEventHandler( Path_OnCommand ) ); + CommandSystem.Register( "Path", AccessLevel.GameMaster, Path_OnCommand ); } public static void Path_OnCommand( CommandEventArgs e ) { - e.Mobile.BeginTarget( -1, true, TargetFlags.None, new TargetCallback( Path_OnTarget ) ); + e.Mobile.BeginTarget( -1, true, TargetFlags.None, Path_OnTarget ); e.Mobile.SendMessage( "Target a location and a path will be drawn there." ); } diff --git a/Scripts/Engines/Plants/PlantSystem.cs b/Scripts/Engines/Plants/PlantSystem.cs index 5eca172e2..75a555a46 100644 --- a/Scripts/Engines/Plants/PlantSystem.cs +++ b/Scripts/Engines/Plants/PlantSystem.cs @@ -367,12 +367,12 @@ namespace Server.Engines.Plants public static void Configure() { - EventSink.WorldLoad += new WorldLoadEventHandler( EventSink_WorldLoad ); + EventSink.WorldLoad += EventSink_WorldLoad; if ( !Misc.AutoRestart.Enabled ) - EventSink.WorldSave += new WorldSaveEventHandler( EventSink_WorldSave ); + EventSink.WorldSave += EventSink_WorldSave; - EventSink.Login += new LoginEventHandler( EventSink_Login ); + EventSink.Login += EventSink_Login; } private static void EventSink_Login( LoginEventArgs args ) diff --git a/Scripts/Engines/Quests/Core/Items/HornOfRetreat.cs b/Scripts/Engines/Quests/Core/Items/HornOfRetreat.cs index 252c2d759..a271ad643 100644 --- a/Scripts/Engines/Quests/Core/Items/HornOfRetreat.cs +++ b/Scripts/Engines/Quests/Core/Items/HornOfRetreat.cs @@ -158,7 +158,7 @@ namespace Server.Engines.Quests Dispellable = false; - Timer.DelayCall( TimeSpan.FromSeconds( 10.0 ), new TimerCallback( Delete ) ); + Timer.DelayCall( TimeSpan.FromSeconds( 10.0 ), Delete ); } public override void BeginConfirmation( Mobile from ) diff --git a/Scripts/Engines/Quests/Core/QuestSystem.cs b/Scripts/Engines/Quests/Core/QuestSystem.cs index 43c79f6d5..5c46c4d21 100644 --- a/Scripts/Engines/Quests/Core/QuestSystem.cs +++ b/Scripts/Engines/Quests/Core/QuestSystem.cs @@ -66,7 +66,7 @@ namespace Server.Engines.Quests if ( m_Timer != null ) return; - m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 0.5 ), TimeSpan.FromSeconds( 0.5 ), new TimerCallback( Slice ) ); + m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 0.5 ), TimeSpan.FromSeconds( 0.5 ), Slice ); } public virtual void StopTimer() @@ -226,12 +226,12 @@ namespace Server.Engines.Quests public virtual void GetContextMenuEntries( List list ) { if ( m_Objectives.Count > 0 ) - list.Add( new QuestCallbackEntry( 6154, new QuestCallback( ShowQuestLog ) ) ); // View Quest Log + list.Add( new QuestCallbackEntry( 6154, ShowQuestLog ) ); // View Quest Log if ( m_Conversations.Count > 0 ) - list.Add( new QuestCallbackEntry( 6156, new QuestCallback( ShowQuestConversation ) ) ); // Quest Conversation + list.Add( new QuestCallbackEntry( 6156, ShowQuestConversation ) ); // Quest Conversation - list.Add( new QuestCallbackEntry( 6155, new QuestCallback( BeginCancelQuest ) ) ); // Cancel Quest + list.Add( new QuestCallbackEntry( 6155, BeginCancelQuest ) ); // Cancel Quest } public virtual void ShowQuestLogUpdated() diff --git a/Scripts/Engines/Quests/Dark Tides/Items/MaabusCoffin.cs b/Scripts/Engines/Quests/Dark Tides/Items/MaabusCoffin.cs index d5358cb3d..aedce96c6 100644 --- a/Scripts/Engines/Quests/Dark Tides/Items/MaabusCoffin.cs +++ b/Scripts/Engines/Quests/Dark Tides/Items/MaabusCoffin.cs @@ -45,7 +45,7 @@ namespace Server.Engines.Quests.Necro m_Maabus.Direction = m_Maabus.GetDirectionTo( caller ); - Timer.DelayCall( TimeSpan.FromSeconds( 7.5 ), new TimerCallback( BeginSleep ) ); + Timer.DelayCall( TimeSpan.FromSeconds( 7.5 ), BeginSleep ); } public void BeginSleep() @@ -55,7 +55,7 @@ namespace Server.Engines.Quests.Necro Effects.PlaySound( m_Maabus.Location, m_Maabus.Map, 0x48E ); - Timer.DelayCall( TimeSpan.FromSeconds( 2.5 ), new TimerCallback( Sleep ) ); + Timer.DelayCall( TimeSpan.FromSeconds( 2.5 ), Sleep ); } public void Sleep() diff --git a/Scripts/Engines/Quests/Dark Tides/Mobiles/SummonedPaladin.cs b/Scripts/Engines/Quests/Dark Tides/Mobiles/SummonedPaladin.cs index 6b9cf231a..bb27a067a 100644 --- a/Scripts/Engines/Quests/Dark Tides/Mobiles/SummonedPaladin.cs +++ b/Scripts/Engines/Quests/Dark Tides/Mobiles/SummonedPaladin.cs @@ -81,7 +81,7 @@ namespace Server.Engines.Quests.Necro m_ToDelete = true; - Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), new TimerCallback( Delete ) ); + Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), Delete ); } else if ( m_Necromancer.Map != Map || GetDistanceToSqrt( m_Necromancer ) > RangePerception + 1 ) { @@ -214,7 +214,7 @@ namespace Server.Engines.Quests.Necro Hue = 0x482; Light = LightType.Circle300; - Timer.DelayCall( TimeSpan.FromSeconds( 10.0 ), new TimerCallback( Delete ) ); + Timer.DelayCall( TimeSpan.FromSeconds( 10.0 ), Delete ); } public SummonedPaladinMoongate( Serial serial ) : base( serial ) diff --git a/Scripts/Engines/Quests/Haochi's Trials/Items/HaochisTreasureChest.cs b/Scripts/Engines/Quests/Haochi's Trials/Items/HaochisTreasureChest.cs index 4ee91988c..400014ef2 100644 --- a/Scripts/Engines/Quests/Haochi's Trials/Items/HaochisTreasureChest.cs +++ b/Scripts/Engines/Quests/Haochi's Trials/Items/HaochisTreasureChest.cs @@ -74,7 +74,7 @@ namespace Server.Engines.Quests.Samurai obj.StolenTreasure = true; } - Timer.DelayCall( TimeSpan.FromMinutes( 2.0 ), new TimerCallback( GenerateTreasure ) ); + Timer.DelayCall( TimeSpan.FromMinutes( 2.0 ), GenerateTreasure ); } public override void Serialize( GenericWriter writer ) @@ -90,7 +90,7 @@ namespace Server.Engines.Quests.Samurai int version = reader.ReadEncodedInt(); - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( GenerateTreasure ) ); + Timer.DelayCall( TimeSpan.Zero, GenerateTreasure ); } } } diff --git a/Scripts/Engines/Quests/The Summoning/Mobiles/Chyloth.cs b/Scripts/Engines/Quests/The Summoning/Mobiles/Chyloth.cs index 503422dff..f38bf086f 100644 --- a/Scripts/Engines/Quests/The Summoning/Mobiles/Chyloth.cs +++ b/Scripts/Engines/Quests/The Summoning/Mobiles/Chyloth.cs @@ -54,7 +54,7 @@ namespace Server.Engines.Quests.Doom if ( Deleted || m_AngryAt == null ) return; - Timer.DelayCall( TimeSpan.FromSeconds( 4.0 ), new TimerCallback( EndGiveWarning ) ); + Timer.DelayCall( TimeSpan.FromSeconds( 4.0 ), EndGiveWarning ); } public virtual void EndGiveWarning() @@ -73,12 +73,12 @@ namespace Server.Engines.Quests.Doom if ( Deleted || m_AngryAt == null ) return; - Timer.DelayCall( TimeSpan.FromSeconds( 30.0 ), new TimerCallback( EndSummonDragon ) ); + Timer.DelayCall( TimeSpan.FromSeconds( 30.0 ), EndSummonDragon ); } public virtual void BeginRemove( TimeSpan delay ) { - Timer.DelayCall( delay, new TimerCallback( EndRemove ) ); + Timer.DelayCall( delay, EndRemove ); } public virtual void EndRemove() diff --git a/Scripts/Engines/Quests/Witch Apprentice/Mobiles/Blackheart.cs b/Scripts/Engines/Quests/Witch Apprentice/Mobiles/Blackheart.cs index f55ab279d..18e0aa04f 100644 --- a/Scripts/Engines/Quests/Witch Apprentice/Mobiles/Blackheart.cs +++ b/Scripts/Engines/Quests/Witch Apprentice/Mobiles/Blackheart.cs @@ -92,7 +92,7 @@ namespace Server.Engines.Quests.Hag { PublicOverheadMessage( Network.MessageType.Regular, 0x3B2, 500849 ); // *hic* - Timer.DelayCall( TimeSpan.FromSeconds( Utility.RandomMinMax( 60, 180 ) ), new TimerCallback( Heave ) ); + Timer.DelayCall( TimeSpan.FromSeconds( Utility.RandomMinMax( 60, 180 ) ), Heave ); } public override void Serialize( GenericWriter writer ) diff --git a/Scripts/Engines/RemoteAdmin/Network.cs b/Scripts/Engines/RemoteAdmin/Network.cs index 49e2b4fab..a86bfebdc 100644 --- a/Scripts/Engines/RemoteAdmin/Network.cs +++ b/Scripts/Engines/RemoteAdmin/Network.cs @@ -18,12 +18,12 @@ namespace Server.RemoteAdmin public static void Configure() { - PacketHandlers.Register( 0xF1, 0, false, new OnPacketReceive( OnReceive ) ); + PacketHandlers.Register( 0xF1, 0, false, OnReceive ); #if !MONO - Core.MultiConsoleOut.Add( new EventTextWriter( new EventTextWriter.OnConsoleChar( OnConsoleChar ), new EventTextWriter.OnConsoleLine( OnConsoleLine ), new EventTextWriter.OnConsoleStr( OnConsoleString ) ) ); + Core.MultiConsoleOut.Add( new EventTextWriter( OnConsoleChar, OnConsoleLine, OnConsoleString ) ); #endif - Timer.DelayCall( TimeSpan.FromMinutes( 2.5 ), TimeSpan.FromMinutes( 2.5 ), new TimerCallback( CleanUp ) ); + Timer.DelayCall( TimeSpan.FromMinutes( 2.5 ), TimeSpan.FromMinutes( 2.5 ), CleanUp ); } public static void OnConsoleString( string str ) diff --git a/Scripts/Engines/RemoteAdmin/PacketHandlers.cs b/Scripts/Engines/RemoteAdmin/PacketHandlers.cs index 728a1e2b6..809d8bc72 100644 --- a/Scripts/Engines/RemoteAdmin/PacketHandlers.cs +++ b/Scripts/Engines/RemoteAdmin/PacketHandlers.cs @@ -18,10 +18,10 @@ namespace Server.RemoteAdmin static RemoteAdminHandlers() { //0x02 = login request, handled by AdminNetwork - Register( 0x04, new OnPacketReceive( ServerInfoRequest ) ); - Register( 0x05, new OnPacketReceive( AccountSearch ) ); - Register( 0x06, new OnPacketReceive( RemoveAccount ) ); - Register( 0x07, new OnPacketReceive( UpdateAccount ) ); + Register( 0x04, ServerInfoRequest ); + Register( 0x05, AccountSearch ); + Register( 0x06, RemoveAccount ); + Register( 0x07, UpdateAccount ); } public static void Register( byte command, OnPacketReceive handler ) diff --git a/Scripts/Engines/Reports/Objects/Charts/BarGraph.cs b/Scripts/Engines/Reports/Objects/Charts/BarGraph.cs index 6afca5749..36dfdab95 100644 --- a/Scripts/Engines/Reports/Objects/Charts/BarGraph.cs +++ b/Scripts/Engines/Reports/Objects/Charts/BarGraph.cs @@ -12,7 +12,7 @@ namespace Server.Engines.Reports public class BarGraph : Chart { #region Type Identification - public static readonly PersistableType ThisTypeID = new PersistableType( "bg", new ConstructCallback( Construct ) ); + public static readonly PersistableType ThisTypeID = new PersistableType( "bg", Construct ); private static PersistableObject Construct() { diff --git a/Scripts/Engines/Reports/Objects/Charts/ChartItem.cs b/Scripts/Engines/Reports/Objects/Charts/ChartItem.cs index 3f575515e..ca288b368 100644 --- a/Scripts/Engines/Reports/Objects/Charts/ChartItem.cs +++ b/Scripts/Engines/Reports/Objects/Charts/ChartItem.cs @@ -3,7 +3,7 @@ namespace Server.Engines.Reports public class ChartItem : PersistableObject { #region Type Identification - public static readonly PersistableType ThisTypeID = new PersistableType( "ci", new ConstructCallback( Construct ) ); + public static readonly PersistableType ThisTypeID = new PersistableType( "ci", Construct ); private static PersistableObject Construct() { diff --git a/Scripts/Engines/Reports/Objects/Charts/PieChart.cs b/Scripts/Engines/Reports/Objects/Charts/PieChart.cs index 7badf0986..bb6d08f9a 100644 --- a/Scripts/Engines/Reports/Objects/Charts/PieChart.cs +++ b/Scripts/Engines/Reports/Objects/Charts/PieChart.cs @@ -3,7 +3,7 @@ namespace Server.Engines.Reports public class PieChart : Chart { #region Type Identification - public static readonly PersistableType ThisTypeID = new PersistableType( "pc", new ConstructCallback( Construct ) ); + public static readonly PersistableType ThisTypeID = new PersistableType( "pc", Construct ); private static PersistableObject Construct() { diff --git a/Scripts/Engines/Reports/Objects/Reports/ItemValue.cs b/Scripts/Engines/Reports/Objects/Reports/ItemValue.cs index 6e7861e80..e5c5085ec 100644 --- a/Scripts/Engines/Reports/Objects/Reports/ItemValue.cs +++ b/Scripts/Engines/Reports/Objects/Reports/ItemValue.cs @@ -3,7 +3,7 @@ namespace Server.Engines.Reports public class ItemValue : PersistableObject { #region Type Identification - public static readonly PersistableType ThisTypeID = new PersistableType( "iv", new ConstructCallback( Construct ) ); + public static readonly PersistableType ThisTypeID = new PersistableType( "iv", Construct ); private static PersistableObject Construct() { diff --git a/Scripts/Engines/Reports/Objects/Reports/Report.cs b/Scripts/Engines/Reports/Objects/Reports/Report.cs index fbbf6e494..c61a6b45d 100644 --- a/Scripts/Engines/Reports/Objects/Reports/Report.cs +++ b/Scripts/Engines/Reports/Objects/Reports/Report.cs @@ -3,7 +3,7 @@ namespace Server.Engines.Reports public class Report : PersistableObject { #region Type Identification - public static readonly PersistableType ThisTypeID = new PersistableType( "rp", new ConstructCallback( Construct ) ); + public static readonly PersistableType ThisTypeID = new PersistableType( "rp", Construct ); private static PersistableObject Construct() { diff --git a/Scripts/Engines/Reports/Objects/Reports/ReportColumn.cs b/Scripts/Engines/Reports/Objects/Reports/ReportColumn.cs index 9def8932d..8b34c50fd 100644 --- a/Scripts/Engines/Reports/Objects/Reports/ReportColumn.cs +++ b/Scripts/Engines/Reports/Objects/Reports/ReportColumn.cs @@ -3,7 +3,7 @@ namespace Server.Engines.Reports public class ReportColumn : PersistableObject { #region Type Identification - public static readonly PersistableType ThisTypeID = new PersistableType( "rc", new ConstructCallback( Construct ) ); + public static readonly PersistableType ThisTypeID = new PersistableType( "rc", Construct ); private static PersistableObject Construct() { diff --git a/Scripts/Engines/Reports/Objects/Reports/ReportItem.cs b/Scripts/Engines/Reports/Objects/Reports/ReportItem.cs index ba5c4bb49..8a9dd1be6 100644 --- a/Scripts/Engines/Reports/Objects/Reports/ReportItem.cs +++ b/Scripts/Engines/Reports/Objects/Reports/ReportItem.cs @@ -3,7 +3,7 @@ namespace Server.Engines.Reports public class ReportItem : PersistableObject { #region Type Identification - public static readonly PersistableType ThisTypeID = new PersistableType( "ri", new ConstructCallback( Construct ) ); + public static readonly PersistableType ThisTypeID = new PersistableType( "ri", Construct ); private static PersistableObject Construct() { diff --git a/Scripts/Engines/Reports/Objects/Snapshots/Snapshot.cs b/Scripts/Engines/Reports/Objects/Snapshots/Snapshot.cs index b24ba5e72..462dfbf58 100644 --- a/Scripts/Engines/Reports/Objects/Snapshots/Snapshot.cs +++ b/Scripts/Engines/Reports/Objects/Snapshots/Snapshot.cs @@ -5,7 +5,7 @@ namespace Server.Engines.Reports public class Snapshot : PersistableObject { #region Type Identification - public static readonly PersistableType ThisTypeID = new PersistableType( "ss", new ConstructCallback( Construct ) ); + public static readonly PersistableType ThisTypeID = new PersistableType( "ss", Construct ); private static PersistableObject Construct() { diff --git a/Scripts/Engines/Reports/Objects/Snapshots/SnapshotHistory.cs b/Scripts/Engines/Reports/Objects/Snapshots/SnapshotHistory.cs index 378d891bd..1eff8bc62 100644 --- a/Scripts/Engines/Reports/Objects/Snapshots/SnapshotHistory.cs +++ b/Scripts/Engines/Reports/Objects/Snapshots/SnapshotHistory.cs @@ -5,7 +5,7 @@ namespace Server.Engines.Reports public class SnapshotHistory : PersistableObject { #region Type Identification - public static readonly PersistableType ThisTypeID = new PersistableType( "sh", new ConstructCallback( Construct ) ); + public static readonly PersistableType ThisTypeID = new PersistableType( "sh", Construct ); private static PersistableObject Construct() { diff --git a/Scripts/Engines/Reports/Objects/Staffing/PageInfo.cs b/Scripts/Engines/Reports/Objects/Staffing/PageInfo.cs index 5c00d9013..63c4ee647 100644 --- a/Scripts/Engines/Reports/Objects/Staffing/PageInfo.cs +++ b/Scripts/Engines/Reports/Objects/Staffing/PageInfo.cs @@ -16,7 +16,7 @@ namespace Server.Engines.Reports public class PageInfo : PersistableObject { #region Type Identification - public static readonly PersistableType ThisTypeID = new PersistableType( "pi", new ConstructCallback( Construct ) ); + public static readonly PersistableType ThisTypeID = new PersistableType( "pi", Construct ); private static PersistableObject Construct() { diff --git a/Scripts/Engines/Reports/Objects/Staffing/QueueStatus.cs b/Scripts/Engines/Reports/Objects/Staffing/QueueStatus.cs index a31c7b651..4939f4fae 100644 --- a/Scripts/Engines/Reports/Objects/Staffing/QueueStatus.cs +++ b/Scripts/Engines/Reports/Objects/Staffing/QueueStatus.cs @@ -5,7 +5,7 @@ namespace Server.Engines.Reports public class QueueStatus : PersistableObject { #region Type Identification - public static readonly PersistableType ThisTypeID = new PersistableType( "qs", new ConstructCallback( Construct ) ); + public static readonly PersistableType ThisTypeID = new PersistableType( "qs", Construct ); private static PersistableObject Construct() { diff --git a/Scripts/Engines/Reports/Objects/Staffing/ResponseInfo.cs b/Scripts/Engines/Reports/Objects/Staffing/ResponseInfo.cs index 4b221ef2c..54468e18d 100644 --- a/Scripts/Engines/Reports/Objects/Staffing/ResponseInfo.cs +++ b/Scripts/Engines/Reports/Objects/Staffing/ResponseInfo.cs @@ -5,7 +5,7 @@ namespace Server.Engines.Reports public class ResponseInfo : PersistableObject { #region Type Identification - public static readonly PersistableType ThisTypeID = new PersistableType( "rs", new ConstructCallback( Construct ) ); + public static readonly PersistableType ThisTypeID = new PersistableType( "rs", Construct ); private static PersistableObject Construct() { diff --git a/Scripts/Engines/Reports/Objects/Staffing/StaffHistory.cs b/Scripts/Engines/Reports/Objects/Staffing/StaffHistory.cs index 73fb09b11..14eb9c9fb 100644 --- a/Scripts/Engines/Reports/Objects/Staffing/StaffHistory.cs +++ b/Scripts/Engines/Reports/Objects/Staffing/StaffHistory.cs @@ -7,7 +7,7 @@ namespace Server.Engines.Reports public class StaffHistory : PersistableObject { #region Type Identification - public static readonly PersistableType ThisTypeID = new PersistableType( "stfhst", new ConstructCallback( Construct ) ); + public static readonly PersistableType ThisTypeID = new PersistableType( "stfhst", Construct ); private static PersistableObject Construct() { diff --git a/Scripts/Engines/Reports/Reports.cs b/Scripts/Engines/Reports/Reports.cs index 65f47168d..1003701fc 100644 --- a/Scripts/Engines/Reports/Reports.cs +++ b/Scripts/Engines/Reports/Reports.cs @@ -32,7 +32,7 @@ namespace Server.Engines.Reports m_GenerateTime = date + TimeSpan.FromHours( Math.Ceiling( timeOfDay.TotalHours ) ); - Timer.DelayCall( TimeSpan.FromMinutes( 0.5 ), TimeSpan.FromMinutes( 0.5 ), new TimerCallback( CheckRegenerate ) ); + Timer.DelayCall( TimeSpan.FromMinutes( 0.5 ), TimeSpan.FromMinutes( 0.5 ), CheckRegenerate ); } private static DateTime m_GenerateTime; @@ -62,7 +62,7 @@ namespace Server.Engines.Reports m_StatsHistory.Snapshots.Add( ss ); m_StaffHistory.QueueStats.Add( new QueueStatus( Help.PageQueue.List.Count ) ); - ThreadPool.QueueUserWorkItem( new WaitCallback( UpdateOutput ), ss ); + ThreadPool.QueueUserWorkItem( UpdateOutput, ss ); } private static void UpdateOutput( object state ) diff --git a/Scripts/Engines/VeteranRewards/Character Statue Maker/CharacterStatue.cs b/Scripts/Engines/VeteranRewards/Character Statue Maker/CharacterStatue.cs index 9f5def128..b7997d929 100644 --- a/Scripts/Engines/VeteranRewards/Character Statue Maker/CharacterStatue.cs +++ b/Scripts/Engines/VeteranRewards/Character Statue Maker/CharacterStatue.cs @@ -233,7 +233,7 @@ namespace Server.Mobiles if ( m_SculptedBy == null || Map == Map.Internal ) // Remove preview statues { - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( Delete ) ); + Timer.DelayCall( TimeSpan.Zero, Delete ); } } diff --git a/Scripts/Engines/VeteranRewards/Character Statue Maker/CharacterStatuePlinth.cs b/Scripts/Engines/VeteranRewards/Character Statue Maker/CharacterStatuePlinth.cs index d717603b0..9bd2860ea 100644 --- a/Scripts/Engines/VeteranRewards/Character Statue Maker/CharacterStatuePlinth.cs +++ b/Scripts/Engines/VeteranRewards/Character Statue Maker/CharacterStatuePlinth.cs @@ -68,7 +68,7 @@ namespace Server.Items if ( m_Statue?.SculptedBy == null || Map == Map.Internal ) { - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( Delete ) ); + Timer.DelayCall( TimeSpan.Zero, Delete ); } } diff --git a/Scripts/Engines/VeteranRewards/RewardSystem.cs b/Scripts/Engines/VeteranRewards/RewardSystem.cs index 8e4649f78..aa865c436 100644 --- a/Scripts/Engines/VeteranRewards/RewardSystem.cs +++ b/Scripts/Engines/VeteranRewards/RewardSystem.cs @@ -465,7 +465,7 @@ namespace Server.Engines.VeteranRewards public static void Initialize() { if ( Enabled ) - EventSink.Login += new LoginEventHandler( EventSink_Login ); + EventSink.Login += EventSink_Login; } private static void EventSink_Login( LoginEventArgs e ) diff --git a/Scripts/Engines/Virtues/Compassion.cs b/Scripts/Engines/Virtues/Compassion.cs index 55459b107..207df3efa 100644 --- a/Scripts/Engines/Virtues/Compassion.cs +++ b/Scripts/Engines/Virtues/Compassion.cs @@ -10,7 +10,7 @@ namespace Server public static void Initialize() { - VirtueGump.Register( 105, new OnVirtueUsed( OnVirtueUsed ) ); + VirtueGump.Register( 105, OnVirtueUsed ); } public static void OnVirtueUsed( Mobile from ) diff --git a/Scripts/Engines/Virtues/Honor.cs b/Scripts/Engines/Virtues/Honor.cs index 38fa9f2f9..3cf2cae2c 100644 --- a/Scripts/Engines/Virtues/Honor.cs +++ b/Scripts/Engines/Virtues/Honor.cs @@ -13,7 +13,7 @@ namespace Server public static void Initialize() { - VirtueGump.Register( 107, new OnVirtueUsed( OnVirtueUsed ) ); + VirtueGump.Register( 107, OnVirtueUsed ); } private static void OnVirtueUsed( Mobile from ) diff --git a/Scripts/Engines/Virtues/Justice.cs b/Scripts/Engines/Virtues/Justice.cs index 02dc4ec3f..cfebdbeb3 100644 --- a/Scripts/Engines/Virtues/Justice.cs +++ b/Scripts/Engines/Virtues/Justice.cs @@ -12,7 +12,7 @@ namespace Server public static void Initialize() { - VirtueGump.Register( 109, new OnVirtueUsed( OnVirtueUsed ) ); + VirtueGump.Register( 109, OnVirtueUsed ); } public static bool CheckMapRegion( Mobile first, Mobile second ) @@ -65,7 +65,7 @@ namespace Server } else { - protector.BeginTarget( 14, false, TargetFlags.None, new TargetCallback( OnVirtueTargeted ) ); + protector.BeginTarget( 14, false, TargetFlags.None, OnVirtueTargeted ); protector.SendLocalizedMessage( 1049366 ); // Choose the player you wish to protect. } } diff --git a/Scripts/Engines/Virtues/Sacrifice.cs b/Scripts/Engines/Virtues/Sacrifice.cs index c0f5637af..8b298b142 100644 --- a/Scripts/Engines/Virtues/Sacrifice.cs +++ b/Scripts/Engines/Virtues/Sacrifice.cs @@ -14,7 +14,7 @@ namespace Server public static void Initialize() { - VirtueGump.Register( 110, new OnVirtueUsed( OnVirtueUsed ) ); + VirtueGump.Register( 110, OnVirtueUsed ); } public static void OnVirtueUsed( Mobile from ) @@ -137,7 +137,7 @@ namespace Server from.SendLocalizedMessage( 1052010 ); // You have set the creature free. - Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), new TimerCallback( targ.Delete ) ); + Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), targ.Delete ); pm.LastSacrificeGain = DateTime.UtcNow; diff --git a/Scripts/Engines/Virtues/Valor.cs b/Scripts/Engines/Virtues/Valor.cs index 98e70d9c8..635b5d6f2 100644 --- a/Scripts/Engines/Virtues/Valor.cs +++ b/Scripts/Engines/Virtues/Valor.cs @@ -12,7 +12,7 @@ namespace Server public static void Initialize() { - VirtueGump.Register( 112, new OnVirtueUsed( OnVirtueUsed ) ); + VirtueGump.Register( 112, OnVirtueUsed ); } public static void OnVirtueUsed( Mobile from ) diff --git a/Scripts/Engines/Virtues/VirtueGump.cs b/Scripts/Engines/Virtues/VirtueGump.cs index 9108418ba..d5780fb6b 100644 --- a/Scripts/Engines/Virtues/VirtueGump.cs +++ b/Scripts/Engines/Virtues/VirtueGump.cs @@ -13,9 +13,9 @@ namespace Server public static void Initialize() { - EventSink.VirtueGumpRequest += new VirtueGumpRequestEventHandler( EventSink_VirtueGumpRequest ); - EventSink.VirtueItemRequest += new VirtueItemRequestEventHandler( EventSink_VirtueItemRequest ); - EventSink.VirtueMacroRequest += new VirtueMacroRequestEventHandler( EventSink_VirtueMacroRequest ); + EventSink.VirtueGumpRequest += EventSink_VirtueGumpRequest; + EventSink.VirtueItemRequest += EventSink_VirtueItemRequest; + EventSink.VirtueMacroRequest += EventSink_VirtueMacroRequest; } public static void Register( int gumpID, OnVirtueUsed callback ) diff --git a/Scripts/Gumps/AddDoorGump.cs b/Scripts/Gumps/AddDoorGump.cs index 00bec7a4e..28092b03d 100644 --- a/Scripts/Gumps/AddDoorGump.cs +++ b/Scripts/Gumps/AddDoorGump.cs @@ -91,7 +91,7 @@ namespace Server.Gumps public static void Initialize() { - CommandSystem.Register( "AddDoor", AccessLevel.GameMaster, new CommandEventHandler( AddDoor_OnCommand ) ); + CommandSystem.Register( "AddDoor", AccessLevel.GameMaster, AddDoor_OnCommand ); } [Usage( "AddDoor" )] diff --git a/Scripts/Gumps/AddGump.cs b/Scripts/Gumps/AddGump.cs index caf98b3a4..cc746c5fe 100644 --- a/Scripts/Gumps/AddGump.cs +++ b/Scripts/Gumps/AddGump.cs @@ -15,7 +15,7 @@ namespace Server.Gumps public static void Initialize() { - CommandSystem.Register( "AddMenu", AccessLevel.GameMaster, new CommandEventHandler( AddMenu_OnCommand ) ); + CommandSystem.Register( "AddMenu", AccessLevel.GameMaster, AddMenu_OnCommand ); } [Usage( "AddMenu [searchString]" )] diff --git a/Scripts/Gumps/AdminGump.cs b/Scripts/Gumps/AdminGump.cs index 3fcf924a3..918245d0c 100644 --- a/Scripts/Gumps/AdminGump.cs +++ b/Scripts/Gumps/AdminGump.cs @@ -125,7 +125,7 @@ namespace Server.Gumps public static void Initialize() { - CommandSystem.Register( "Admin", AccessLevel.Administrator, new CommandEventHandler( Admin_OnCommand ) ); + CommandSystem.Register( "Admin", AccessLevel.Administrator, Admin_OnCommand ); } [Usage( "Admin" )] @@ -1503,7 +1503,7 @@ namespace Server.Gumps NetState.Resume(); from.SendGump( new NoticeGump( 1060637, 30720, - $"You have {(ban ? "banned" : "deleted")} the account{(rads.Count == 1 ? "" : "s")}.", 0xFFC000, 420, 280, new NoticeGumpCallback( ResendGump_Callback ), new object[]{ list, rads, ban ? page : 0 } ) ); + $"You have {(ban ? "banned" : "deleted")} the account{(rads.Count == 1 ? "" : "s")}.", 0xFFC000, 420, 280, ResendGump_Callback, new object[]{ list, rads, ban ? page : 0 } ) ); if ( ban ) from.SendGump( new BanDurationGump( rads ) ); @@ -1511,7 +1511,7 @@ namespace Server.Gumps else { from.SendGump( new NoticeGump( 1060637, 30720, - $"You have chosen not to {(ban ? "ban" : "delete")} the account{(rads.Count == 1 ? "" : "s")}.", 0xFFC000, 420, 280, new NoticeGumpCallback( ResendGump_Callback ), new object[]{ list, rads, page } ) ); + $"You have chosen not to {(ban ? "ban" : "delete")} the account{(rads.Count == 1 ? "" : "s")}.", 0xFFC000, 420, 280, ResendGump_Callback, new object[]{ list, rads, page } ) ); } } @@ -2178,7 +2178,7 @@ namespace Server.Gumps for ( int i = 0; i < list.Count; ++i ) sb.AppendFormat( "
- {0}", ((Account)list[i]).Username ); - from.SendGump( new WarningGump( 1060635, 30720, sb.ToString(), 0xFFC000, 420, 400, new WarningGumpCallback( BanShared_Callback ), a ) ); + from.SendGump( new WarningGump( 1060635, 30720, sb.ToString(), 0xFFC000, 420, 400, BanShared_Callback, a ) ); } else if ( a.LoginIPs.Length > 0 ) { @@ -2199,7 +2199,7 @@ namespace Server.Gumps if ( a.LoginIPs.Length > 0 ) { from.SendGump( new WarningGump( 1060635, 30720, - $"You are about to firewall {a.LoginIPs.Length} address{(a.LoginIPs.Length != 1 ? "s" : "")}. Do you wish to continue?", 0xFFC000, 420, 400, new WarningGumpCallback( FirewallShared_Callback ), a ) ); + $"You are about to firewall {a.LoginIPs.Length} address{(a.LoginIPs.Length != 1 ? "s" : "")}. Do you wish to continue?", 0xFFC000, 420, 400, FirewallShared_Callback, a ) ); } else { @@ -2292,7 +2292,7 @@ namespace Server.Gumps break; from.SendGump( new WarningGump( 1060635, 30720, - $"
Account of {a.Username}

You are about to permanently delete the account. Likewise, all characters on the account will be deleted, including equipped, inventory, and banked items. Any houses tied to the account will be demolished.

Do you wish to continue?", 0xFFC000, 420, 280, new WarningGumpCallback( AccountDelete_Callback ), m_State ) ); + $"
Account of {a.Username}

You are about to permanently delete the account. Likewise, all characters on the account will be deleted, including equipped, inventory, and banked items. Any houses tied to the account will be demolished.

Do you wish to continue?", 0xFFC000, 420, 280, AccountDelete_Callback, m_State ) ); break; } case 26: // View all shared accounts @@ -2309,9 +2309,9 @@ namespace Server.Gumps if ( rads.Count > 0 ) from.SendGump( new WarningGump( 1060635, 30720, - $"You are about to ban {rads.Count} marked account{(rads.Count == 1 ? "" : "s")}. Be cautioned, the only way to reverse this is by hand--manually unbanning each account.

Do you wish to continue?", 0xFFC000, 420, 280, new WarningGumpCallback( Marked_Callback ), new object[]{ true, list, rads, m_ListPage } ) ); + $"You are about to ban {rads.Count} marked account{(rads.Count == 1 ? "" : "s")}. Be cautioned, the only way to reverse this is by hand--manually unbanning each account.

Do you wish to continue?", 0xFFC000, 420, 280, Marked_Callback, new object[]{ true, list, rads, m_ListPage } ) ); else - from.SendGump( new NoticeGump( 1060637, 30720, "You have not yet marked any accounts. Place a check mark next to the accounts you wish to ban and then try again.", 0xFFC000, 420, 280, new NoticeGumpCallback( ResendGump_Callback ), new object[]{ list, rads, m_ListPage } ) ); + from.SendGump( new NoticeGump( 1060637, 30720, "You have not yet marked any accounts. Place a check mark next to the accounts you wish to ban and then try again.", 0xFFC000, 420, 280, ResendGump_Callback, new object[]{ list, rads, m_ListPage } ) ); break; } @@ -2323,9 +2323,9 @@ namespace Server.Gumps break; if ( rads.Count > 0 ) - from.SendGump( new WarningGump( 1060635, 30720, string.Format( "You are about to permanently delete {0} marked account{1}. Likewise, all characters on the account{1} will be deleted, including equipped, inventory, and banked items. Any houses tied to the account{1} will be demolished.

Do you wish to continue?", rads.Count, rads.Count == 1 ? "" : "s" ), 0xFFC000, 420, 280, new WarningGumpCallback( Marked_Callback ), new object[]{ false, list, rads, m_ListPage } ) ); + from.SendGump( new WarningGump( 1060635, 30720, string.Format( "You are about to permanently delete {0} marked account{1}. Likewise, all characters on the account{1} will be deleted, including equipped, inventory, and banked items. Any houses tied to the account{1} will be demolished.

Do you wish to continue?", rads.Count, rads.Count == 1 ? "" : "s" ), 0xFFC000, 420, 280, Marked_Callback, new object[]{ false, list, rads, m_ListPage } ) ); else - from.SendGump( new NoticeGump( 1060637, 30720, "You have not yet marked any accounts. Place a check mark next to the accounts you wish to ban and then try again.", 0xFFC000, 420, 280, new NoticeGumpCallback( ResendGump_Callback ), new object[]{ list, rads, m_ListPage } ) ); + from.SendGump( new NoticeGump( 1060637, 30720, "You have not yet marked any accounts. Place a check mark next to the accounts you wish to ban and then try again.", 0xFFC000, 420, 280, ResendGump_Callback, new object[]{ list, rads, m_ListPage } ) ); break; } @@ -2440,7 +2440,7 @@ namespace Server.Gumps from.SendGump( new AdminGump( from, AdminGumpPage.AccountDetails_Access_ClientIPs, 0, null, "This account has not yet been accessed.", m_State ) ); else from.SendGump( new WarningGump( 1060635, 30720, - $"You are about to clear the address list for account {a} containing {ips.Length} {((ips.Length == 1) ? "entry" : "entries")}. Do you wish to continue?", 0xFFC000, 420, 280, new WarningGumpCallback( RemoveLoginIPs_Callback ), a ) ); + $"You are about to clear the address list for account {a} containing {ips.Length} {((ips.Length == 1) ? "entry" : "entries")}. Do you wish to continue?", 0xFFC000, 420, 280, RemoveLoginIPs_Callback, a ) ); break; } @@ -2735,7 +2735,7 @@ namespace Server.Gumps if ( m_PageType == AdminGumpPage.AccountDetails_Access_ClientIPs ) { from.SendGump( new WarningGump( 1060635, 30720, - $"You are about to firewall {m_List[index]}. All connection attempts from a matching IP will be refused. Are you sure?", 0xFFC000, 420, 280, new WarningGumpCallback( Firewall_Callback ), new[]{ a, m_List[index] } ) ); + $"You are about to firewall {m_List[index]}. All connection attempts from a matching IP will be refused. Are you sure?", 0xFFC000, 420, 280, Firewall_Callback, new[]{ a, m_List[index] } ) ); } else if ( m_PageType == AdminGumpPage.AccountDetails_Access_Restrictions ) { @@ -2796,7 +2796,7 @@ namespace Server.Gumps break; from.SendGump( new WarningGump( 1060635, 30720, - $"You are about to remove address {ip} from account {a}. Do you wish to continue?", 0xFFC000, 420, 280, new WarningGumpCallback( RemoveLoginIP_Callback ), new object[] { a, ip } ) ); + $"You are about to remove address {ip} from account {a}. Do you wish to continue?", 0xFFC000, 420, 280, RemoveLoginIP_Callback, new object[] { a, ip } ) ); } } diff --git a/Scripts/Gumps/CommentsGump.cs b/Scripts/Gumps/CommentsGump.cs index 32f224694..7e67c015e 100644 --- a/Scripts/Gumps/CommentsGump.cs +++ b/Scripts/Gumps/CommentsGump.cs @@ -12,7 +12,7 @@ namespace Server.Gumps { public static void Initialize() { - CommandSystem.Register( "Comments", AccessLevel.Counselor, new CommandEventHandler( Comments_OnCommand ) ); + CommandSystem.Register( "Comments", AccessLevel.Counselor, Comments_OnCommand ); } [Usage( "Comments" )] @@ -20,7 +20,7 @@ namespace Server.Gumps private static void Comments_OnCommand( CommandEventArgs args ) { args.Mobile.SendMessage( "Select the player to view account comments." ); - args.Mobile.BeginTarget( -1, false, TargetFlags.None, new TargetCallback( OnTarget ) ); + args.Mobile.BeginTarget( -1, false, TargetFlags.None, OnTarget ); } private static void OnTarget( Mobile from, object target ) diff --git a/Scripts/Gumps/Guilds/New Guild System/DiplomacyGump.cs b/Scripts/Gumps/Guilds/New Guild System/DiplomacyGump.cs index a86dda0fc..4cd3ccfee 100644 --- a/Scripts/Gumps/Guilds/New Guild System/DiplomacyGump.cs +++ b/Scripts/Gumps/Guilds/New Guild System/DiplomacyGump.cs @@ -274,7 +274,7 @@ namespace Server.Guilds return; if ( AllowAdvancedSearch && info.ButtonID == 8 ) - pm.SendGump( new GuildAdvancedSearchGump( pm, guild, m_Display, new SearchSelectionCallback( AdvancedSearch_Callback ) )); + pm.SendGump( new GuildAdvancedSearchGump( pm, guild, m_Display, AdvancedSearch_Callback )); } diff --git a/Scripts/Gumps/Guilds/New Guild System/GuildInfoGump.cs b/Scripts/Gumps/Guilds/New Guild System/GuildInfoGump.cs index 46d4ed2a7..65b4a4a7f 100644 --- a/Scripts/Gumps/Guilds/New Guild System/GuildInfoGump.cs +++ b/Scripts/Gumps/Guilds/New Guild System/GuildInfoGump.cs @@ -103,7 +103,7 @@ namespace Server.Guilds { pm.SendLocalizedMessage( 1013071 ); // Enter the new guild charter (50 characters max): - pm.BeginPrompt( new PromptCallback( SetCharter_Callback ), true ); //Have the same callback handle both canceling and deletion cause the 2nd callback would just get a text of "" + pm.BeginPrompt( SetCharter_Callback, true ); //Have the same callback handle both canceling and deletion cause the 2nd callback would just get a text of "" } break; } @@ -112,7 +112,7 @@ namespace Server.Guilds if ( IsLeader( pm, guild ) ) { pm.SendLocalizedMessage( 1013072 ); // Enter the new website for the guild (50 characters max): - pm.BeginPrompt( new PromptCallback( SetWebsite_Callback ), true ); //Have the same callback handle both canceling and deletion cause the 2nd callback would just get a text of "" + pm.BeginPrompt( SetWebsite_Callback, true ); //Have the same callback handle both canceling and deletion cause the 2nd callback would just get a text of "" } break; } diff --git a/Scripts/Gumps/Guilds/New Guild System/GuildMemberInfoGump.cs b/Scripts/Gumps/Guilds/New Guild System/GuildMemberInfoGump.cs index 8476f54c6..475450ea0 100644 --- a/Scripts/Gumps/Guilds/New Guild System/GuildMemberInfoGump.cs +++ b/Scripts/Gumps/Guilds/New Guild System/GuildMemberInfoGump.cs @@ -127,7 +127,7 @@ namespace Server.Guilds { pm.SendLocalizedMessage( 1011128 ); // Enter the new title for this guild member or 'none' to remove a title: - pm.BeginPrompt( new PromptCallback( SetTitle_Callback ) ); + pm.BeginPrompt( SetTitle_Callback ); } else if ( m_Member.GuildTitle == null || m_Member.GuildTitle.Length <= 0 ) { diff --git a/Scripts/Gumps/Guilds/New Guild System/OtherGuildInfo.cs b/Scripts/Gumps/Guilds/New Guild System/OtherGuildInfo.cs index f9aad9b02..7b408e018 100644 --- a/Scripts/Gumps/Guilds/New Guild System/OtherGuildInfo.cs +++ b/Scripts/Gumps/Guilds/New Guild System/OtherGuildInfo.cs @@ -411,7 +411,7 @@ namespace Server.Guilds else { pm.SendLocalizedMessage( 1063439 ); // Enter a name for the new alliance: - pm.BeginPrompt( new PromptCallback( CreateAlliance_Callback ) ); + pm.BeginPrompt( CreateAlliance_Callback ); } } #endregion diff --git a/Scripts/Gumps/HouseGumpAOS.cs b/Scripts/Gumps/HouseGumpAOS.cs index d1f560b13..e428668cd 100644 --- a/Scripts/Gumps/HouseGumpAOS.cs +++ b/Scripts/Gumps/HouseGumpAOS.cs @@ -956,7 +956,7 @@ namespace Server.Gumps case 3: // Clear Co-Owner List { if ( isOwner ) - from.SendGump( new WarningGump( 1060635, 30720, 1060736, 32512, 420, 280, new WarningGumpCallback( ClearCoOwners_Callback ), m_House ) ); + from.SendGump( new WarningGump( 1060635, 30720, 1060736, 32512, 420, 280, ClearCoOwners_Callback, m_House ) ); break; } @@ -986,7 +986,7 @@ namespace Server.Gumps case 7: // Clear Friend List { if ( isCoOwner ) - from.SendGump( new WarningGump( 1060635, 30720, 1018039, 32512, 420, 280, new WarningGumpCallback( ClearFriends_Callback ), m_House ) ); + from.SendGump( new WarningGump( 1060635, 30720, 1018039, 32512, 420, 280, ClearFriends_Callback, m_House ) ); break; } @@ -998,7 +998,7 @@ namespace Server.Gumps } case 9: // Clear Ban List { - from.SendGump( new WarningGump( 1060635, 30720, 1060753, 32512, 420, 280, new WarningGumpCallback( ClearBans_Callback ), m_House ) ); + from.SendGump( new WarningGump( 1060635, 30720, 1060753, 32512, 420, 280, ClearBans_Callback, m_House ) ); break; } @@ -1010,7 +1010,7 @@ namespace Server.Gumps } case 11: // Clear Access List { - from.SendGump( new WarningGump( 1060635, 30720, 1061842, 32512, 420, 280, new WarningGumpCallback( ClearAccess_Callback ), m_House ) ); + from.SendGump( new WarningGump( 1060635, 30720, 1061842, 32512, 420, 280, ClearAccess_Callback, m_House ) ); break; } @@ -1021,14 +1021,14 @@ namespace Server.Gumps if ( m_House.PlayerVendors.Count > 0 ) { // You have vendors working out of this building. It cannot be declared private until there are no vendors in place. - from.SendGump( new NoticeGump( 1060637, 30720, 501887, 32512, 320, 180, new NoticeGumpCallback( PublicPrivateNotice_Callback ), m_House ) ); + from.SendGump( new NoticeGump( 1060637, 30720, 501887, 32512, 320, 180, PublicPrivateNotice_Callback, m_House ) ); break; } if ( m_House.VendorRentalContracts.Count > 0 ) { // You cannot currently take this action because you have vendor contracts locked down in your home. You must remove them first. - from.SendGump( new NoticeGump( 1060637, 30720, 1062351, 32512, 320, 180, new NoticeGumpCallback( PublicPrivateNotice_Callback ), m_House ) ); + from.SendGump( new NoticeGump( 1060637, 30720, 1062351, 32512, 320, 180, PublicPrivateNotice_Callback, m_House ) ); break; } @@ -1037,7 +1037,7 @@ namespace Server.Gumps m_House.ChangeLocks( from ); // This house is now private. - from.SendGump( new NoticeGump( 1060637, 30720, 501888, 32512, 320, 180, new NoticeGumpCallback( PublicPrivateNotice_Callback ), m_House ) ); + from.SendGump( new NoticeGump( 1060637, 30720, 501888, 32512, 320, 180, PublicPrivateNotice_Callback, m_House ) ); Region r = m_House.Region; List list = r.GetMobiles(); @@ -1065,11 +1065,11 @@ namespace Server.Gumps if ( BaseHouse.NewVendorSystem ) { // This house is now public. The owner may now place vendors and vendor rental contracts. - from.SendGump( new NoticeGump( 1060637, 30720, 501886, 32512, 320, 180, new NoticeGumpCallback( PublicPrivateNotice_Callback ), m_House ) ); + from.SendGump( new NoticeGump( 1060637, 30720, 501886, 32512, 320, 180, PublicPrivateNotice_Callback, m_House ) ); } else { - from.SendGump( new NoticeGump( 1060637, 30720, "This house is now public. Friends of the house may now have vendors working out of this building.", 0xF8C000, 320, 180, new NoticeGumpCallback( PublicPrivateNotice_Callback ), m_House ) ); + from.SendGump( new NoticeGump( 1060637, 30720, "This house is now public. Friends of the house may now have vendors working out of this building.", 0xF8C000, 320, 180, PublicPrivateNotice_Callback, m_House ) ); } Region r = m_House.Region; @@ -1101,7 +1101,7 @@ namespace Server.Gumps if ( m_House.HasRentedVendors ) { // You cannot perform this action while you still have vendors rented out in this house. - from.SendGump( new NoticeGump( 1060637, 30720, 1062395, 32512, 320, 180, new NoticeGumpCallback( CustomizeNotice_Callback ), m_House ) ); + from.SendGump( new NoticeGump( 1060637, 30720, 1062395, 32512, 320, 180, CustomizeNotice_Callback, m_House ) ); } else { @@ -1117,7 +1117,7 @@ namespace Server.Gumps * Your house will be leveled to its foundation, and you will be able to build new walls, windows, doors, and stairs. * Are you sure you wish to continue? */ - from.SendGump( new WarningGump( 1060635, 30720, 1060013, 32512, 420, 280, new WarningGumpCallback( ConvertHouse_Callback ), m_House ) ); + from.SendGump( new WarningGump( 1060635, 30720, 1060013, 32512, 420, 280, ConvertHouse_Callback, m_House ) ); } } } @@ -1131,14 +1131,14 @@ namespace Server.Gumps if ( m_House.HasRentedVendors ) { // You cannot perform this action while you still have vendors rented out in this house. - from.SendGump( new NoticeGump( 1060637, 30720, 1062395, 32512, 320, 180, new NoticeGumpCallback( CustomizeNotice_Callback ), m_House ) ); + from.SendGump( new NoticeGump( 1060637, 30720, 1062395, 32512, 320, 180, CustomizeNotice_Callback, m_House ) ); } #region Mondain's Legacy else if ( m_House.HasAddonContainers ) { // The house can not be customized when add-on containers such as aquariums, elven furniture containers, vanities, and boiling cauldrons // are present in the house. Please re-deed the add-on containers before customizing the house. - from.SendGump( new NoticeGump( 1060637, 30720, 1074863, 32512, 320, 180, new NoticeGumpCallback( CustomizeNotice_Callback ), m_House ) ); + from.SendGump( new NoticeGump( 1060637, 30720, 1074863, 32512, 320, 180, CustomizeNotice_Callback, m_House ) ); } #endregion else diff --git a/Scripts/Gumps/ReportMurderer.cs b/Scripts/Gumps/ReportMurderer.cs index 8e2eaba0e..fdfdd713c 100644 --- a/Scripts/Gumps/ReportMurderer.cs +++ b/Scripts/Gumps/ReportMurderer.cs @@ -14,7 +14,7 @@ namespace Server.Gumps public static void Initialize() { - EventSink.PlayerDeath += new PlayerDeathEventHandler( EventSink_PlayerDeath ); + EventSink.PlayerDeath += EventSink_PlayerDeath; } public static void EventSink_PlayerDeath( PlayerDeathEventArgs e ) diff --git a/Scripts/Gumps/ToTAdminGump.cs b/Scripts/Gumps/ToTAdminGump.cs index 7da35f8a8..a5150aa4e 100644 --- a/Scripts/Gumps/ToTAdminGump.cs +++ b/Scripts/Gumps/ToTAdminGump.cs @@ -117,7 +117,7 @@ namespace Server.Gumps public static void Initialize() { - CommandSystem.Register( "ToTAdmin", AccessLevel.Administrator, new CommandEventHandler( ToTAdmin_OnCommand ) ); + CommandSystem.Register( "ToTAdmin", AccessLevel.Administrator, ToTAdmin_OnCommand ); } [Usage( "ToTAdmin" )] diff --git a/Scripts/Gumps/ViewHousesGump.cs b/Scripts/Gumps/ViewHousesGump.cs index 84dd1ff0c..c7eef73f2 100644 --- a/Scripts/Gumps/ViewHousesGump.cs +++ b/Scripts/Gumps/ViewHousesGump.cs @@ -12,14 +12,14 @@ namespace Server.Gumps { public static void Initialize() { - CommandSystem.Register( "ViewHouses", AccessLevel.GameMaster, new CommandEventHandler( ViewHouses_OnCommand ) ); + CommandSystem.Register( "ViewHouses", AccessLevel.GameMaster, ViewHouses_OnCommand ); } [Usage( "ViewHouses" )] [Description( "Displays a menu listing all houses of a targeted player. The menu also contains specific house details, and options to: go to house, open house menu, and demolish house." )] public static void ViewHouses_OnCommand( CommandEventArgs e ) { - e.Mobile.BeginTarget( -1, false, TargetFlags.None, new TargetCallback( ViewHouses_OnTarget ) ); + e.Mobile.BeginTarget( -1, false, TargetFlags.None, ViewHouses_OnTarget ); } public static void ViewHouses_OnTarget( Mobile from, object targeted ) diff --git a/Scripts/Gumps/WhoGump.cs b/Scripts/Gumps/WhoGump.cs index d9e698527..e1d2a8da6 100644 --- a/Scripts/Gumps/WhoGump.cs +++ b/Scripts/Gumps/WhoGump.cs @@ -10,8 +10,8 @@ namespace Server.Gumps { public static void Initialize() { - CommandSystem.Register( "Who", AccessLevel.Counselor, new CommandEventHandler( WhoList_OnCommand ) ); - CommandSystem.Register( "WhoList", AccessLevel.Counselor, new CommandEventHandler( WhoList_OnCommand ) ); + CommandSystem.Register( "Who", AccessLevel.Counselor, WhoList_OnCommand ); + CommandSystem.Register( "WhoList", AccessLevel.Counselor, WhoList_OnCommand ); } [Usage( "WhoList [filter]" )] diff --git a/Scripts/Holiday Stuff/Halloween/2006/Engines/TrickOrTreat.cs b/Scripts/Holiday Stuff/Halloween/2006/Engines/TrickOrTreat.cs index ac8d9781a..f2ad7231a 100644 --- a/Scripts/Holiday Stuff/Halloween/2006/Engines/TrickOrTreat.cs +++ b/Scripts/Holiday Stuff/Halloween/2006/Engines/TrickOrTreat.cs @@ -17,7 +17,7 @@ namespace Server.Engines.Events if ( DateTime.UtcNow >= HolidaySettings.StartHalloween && DateTime.UtcNow <= HolidaySettings.FinishHalloween ) { - EventSink.Speech += new SpeechEventHandler( EventSink_Speech ); + EventSink.Speech += EventSink_Speech; } } @@ -101,15 +101,15 @@ namespace Server.Engines.Events if ( m_Action == 0 ) { - Timer.DelayCall( OneSecond, OneSecond, 10, new TimerStateCallback( Bleeding ), from ); + Timer.DelayCall( OneSecond, OneSecond, 10, Bleeding, from ); } else if ( m_Action == 1 ) { - Timer.DelayCall( TimeSpan.FromSeconds( 2 ), new TimerStateCallback( SolidHueMobile ), from ); + Timer.DelayCall( TimeSpan.FromSeconds( 2 ), SolidHueMobile, from ); } else { - Timer.DelayCall( TimeSpan.FromSeconds( 2 ), new TimerStateCallback( MakeTwin ), from ); + Timer.DelayCall( TimeSpan.FromSeconds( 2 ), MakeTwin, from ); } } } @@ -148,7 +148,7 @@ namespace Server.Engines.Events { target.SolidHueOverride = Utility.RandomMinMax( 2501, 2644 ); - Timer.DelayCall( TimeSpan.FromSeconds( 10 ), new TimerStateCallback( RemoveHueMod ), target ); + Timer.DelayCall( TimeSpan.FromSeconds( 10 ), RemoveHueMod, target ); } } @@ -194,7 +194,7 @@ namespace Server.Engines.Events twin.MoveToWorld( m_From.Map.CanSpawnMobile( point ) ? point : m_From.Location, m_From.Map ); - Timer.DelayCall( TimeSpan.FromSeconds( 5 ), new TimerStateCallback( DeleteTwin ), twin ); + Timer.DelayCall( TimeSpan.FromSeconds( 5 ), DeleteTwin, twin ); } } } @@ -274,7 +274,7 @@ namespace Server.Engines.Events m_From = from; Name = $"{@from.Name}\'s Naughty Twin"; - Timer.DelayCall( TrickOrTreat.OneSecond, Utility.RandomBool() ? new TimerStateCallback( StealCandy ) : new TimerStateCallback( ToGate ), m_From ); + Timer.DelayCall( TrickOrTreat.OneSecond, Utility.RandomBool() ? StealCandy : new TimerStateCallback( ToGate ), m_From ); } } diff --git a/Scripts/Holiday Stuff/Halloween/2009/Engines/PumpkinPatch.cs b/Scripts/Holiday Stuff/Halloween/2009/Engines/PumpkinPatch.cs index 5f43cc2ce..a648c7757 100644 --- a/Scripts/Holiday Stuff/Halloween/2009/Engines/PumpkinPatch.cs +++ b/Scripts/Holiday Stuff/Halloween/2009/Engines/PumpkinPatch.cs @@ -26,7 +26,7 @@ namespace Server.Engines.Events if ( DateTime.UtcNow >= HolidaySettings.StartHalloween && DateTime.UtcNow <= HolidaySettings.FinishHalloween ) { - m_Timer = Timer.DelayCall( TimeSpan.Zero, TimeSpan.FromMinutes( .50 ), 0, new TimerCallback( PumpkinPatchSpawnerCallback )); + m_Timer = Timer.DelayCall( TimeSpan.Zero, TimeSpan.FromMinutes( .50 ), 0, PumpkinPatchSpawnerCallback); } } diff --git a/Scripts/Holiday Stuff/Halloween/2012/Engines/PlayerZombies.cs b/Scripts/Holiday Stuff/Halloween/2012/Engines/PlayerZombies.cs index b363f30f9..d91ae92a8 100644 --- a/Scripts/Holiday Stuff/Halloween/2012/Engines/PlayerZombies.cs +++ b/Scripts/Holiday Stuff/Halloween/2012/Engines/PlayerZombies.cs @@ -60,11 +60,11 @@ namespace Server.Engines.Events if ( today >= HolidaySettings.StartHalloween && today <= HolidaySettings.FinishHalloween ) { - m_Timer = Timer.DelayCall( tick, tick, new TimerCallback( Timer_Callback ) ); + m_Timer = Timer.DelayCall( tick, tick, Timer_Callback ); - m_ClearTimer = Timer.DelayCall( clear, clear, new TimerCallback( Clear_Callback ) ); + m_ClearTimer = Timer.DelayCall( clear, clear, Clear_Callback ); - EventSink.PlayerDeath += new PlayerDeathEventHandler( EventSink_PlayerDeath ); + EventSink.PlayerDeath += EventSink_PlayerDeath; } } diff --git a/Scripts/Holiday Stuff/Valentine/2012/Items/CupidsArrow.cs b/Scripts/Holiday Stuff/Valentine/2012/Items/CupidsArrow.cs index 1018c9c46..86a2b5bee 100644 --- a/Scripts/Holiday Stuff/Valentine/2012/Items/CupidsArrow.cs +++ b/Scripts/Holiday Stuff/Valentine/2012/Items/CupidsArrow.cs @@ -71,7 +71,7 @@ namespace Server.Items return; } - from.BeginTarget( 10, false, TargetFlags.None, new TargetCallback( OnTarget ) ); + from.BeginTarget( 10, false, TargetFlags.None, OnTarget ); from.SendMessage( "Who do you wish to use this on?" ); } diff --git a/Scripts/Items/Addons/SHTeleporter.cs b/Scripts/Items/Addons/SHTeleporter.cs index 1109f47f2..83fa5cfb0 100644 --- a/Scripts/Items/Addons/SHTeleporter.cs +++ b/Scripts/Items/Addons/SHTeleporter.cs @@ -127,7 +127,7 @@ namespace Server.Items { public static void Initialize() { - CommandSystem.Register( "SHTelGen", AccessLevel.Administrator, new CommandEventHandler( SHTelGen_OnCommand ) ); + CommandSystem.Register( "SHTelGen", AccessLevel.Administrator, SHTelGen_OnCommand ); } [Usage( "SHTelGen" )] diff --git a/Scripts/Items/Aquarium/Aquarium.cs b/Scripts/Items/Aquarium/Aquarium.cs index e9f6f3a11..5d65d7f17 100644 --- a/Scripts/Items/Aquarium/Aquarium.cs +++ b/Scripts/Items/Aquarium/Aquarium.cs @@ -142,7 +142,7 @@ namespace Server.Items m_Events = new List(); - m_Timer = Timer.DelayCall( EvaluationInterval, EvaluationInterval, new TimerCallback( Evaluate ) ); + m_Timer = Timer.DelayCall( EvaluationInterval, EvaluationInterval, Evaluate ); } public Aquarium( Serial serial ) : base( serial ) @@ -446,7 +446,7 @@ namespace Server.Items if ( next < DateTime.UtcNow ) next = DateTime.UtcNow; - m_Timer = Timer.DelayCall( next - DateTime.UtcNow, EvaluationInterval, new TimerCallback( Evaluate ) ); + m_Timer = Timer.DelayCall( next - DateTime.UtcNow, EvaluationInterval, Evaluate ); goto case 0; } diff --git a/Scripts/Items/Aquarium/BaseFish.cs b/Scripts/Items/Aquarium/BaseFish.cs index 1a6e7f010..b6c220a36 100644 --- a/Scripts/Items/Aquarium/BaseFish.cs +++ b/Scripts/Items/Aquarium/BaseFish.cs @@ -25,7 +25,7 @@ namespace Server.Items { m_Timer?.Stop(); - m_Timer = Timer.DelayCall( DeathDelay, new TimerCallback( Kill ) ); + m_Timer = Timer.DelayCall( DeathDelay, Kill ); InvalidateProperties(); } diff --git a/Scripts/Items/Books/BaseBook.cs b/Scripts/Items/Books/BaseBook.cs index 23e014654..f094f55f9 100644 --- a/Scripts/Items/Books/BaseBook.cs +++ b/Scripts/Items/Books/BaseBook.cs @@ -354,9 +354,9 @@ namespace Server.Items public static void Initialize() { - PacketHandlers.Register( 0xD4, 0, true, new OnPacketReceive( HeaderChange ) ); - PacketHandlers.Register( 0x66, 0, true, new OnPacketReceive( ContentChange ) ); - PacketHandlers.Register( 0x93, 99, true, new OnPacketReceive( OldHeaderChange ) ); + PacketHandlers.Register( 0xD4, 0, true, HeaderChange ); + PacketHandlers.Register( 0x66, 0, true, ContentChange ); + PacketHandlers.Register( 0x93, 99, true, OldHeaderChange ); } public static void OldHeaderChange( NetState state, PacketReader pvSrc ) diff --git a/Scripts/Items/Construction/Doors/BaseDoor.cs b/Scripts/Items/Construction/Doors/BaseDoor.cs index 06426484f..1c54c35f7 100644 --- a/Scripts/Items/Construction/Doors/BaseDoor.cs +++ b/Scripts/Items/Construction/Doors/BaseDoor.cs @@ -36,17 +36,17 @@ namespace Server.Items // Called by RunUO public static void Initialize() { - EventSink.OpenDoorMacroUsed += new OpenDoorMacroEventHandler( EventSink_OpenDoorMacroUsed ); + EventSink.OpenDoorMacroUsed += EventSink_OpenDoorMacroUsed; - CommandSystem.Register( "Link", AccessLevel.GameMaster, new CommandEventHandler( Link_OnCommand ) ); - CommandSystem.Register( "ChainLink", AccessLevel.GameMaster, new CommandEventHandler( ChainLink_OnCommand ) ); + CommandSystem.Register( "Link", AccessLevel.GameMaster, Link_OnCommand ); + CommandSystem.Register( "ChainLink", AccessLevel.GameMaster, ChainLink_OnCommand ); } [Usage( "Link" )] [Description( "Links two targeted doors together." )] private static void Link_OnCommand( CommandEventArgs e ) { - e.Mobile.BeginTarget( -1, false, TargetFlags.None, new TargetCallback( Link_OnFirstTarget ) ); + e.Mobile.BeginTarget( -1, false, TargetFlags.None, Link_OnFirstTarget ); e.Mobile.SendMessage( "Target the first door to link." ); } @@ -54,7 +54,7 @@ namespace Server.Items { if ( !(targeted is BaseDoor door) ) { - from.BeginTarget( -1, false, TargetFlags.None, new TargetCallback( Link_OnFirstTarget ) ); + from.BeginTarget( -1, false, TargetFlags.None, Link_OnFirstTarget ); from.SendMessage( "That is not a door. Try again." ); } else diff --git a/Scripts/Items/Containers/FillableContainers.cs b/Scripts/Items/Containers/FillableContainers.cs index 95b6ebccf..734714367 100644 --- a/Scripts/Items/Containers/FillableContainers.cs +++ b/Scripts/Items/Containers/FillableContainers.cs @@ -119,7 +119,7 @@ namespace Server.Items TimeSpan delay = TimeSpan.FromMinutes( mins ); m_NextRespawnTime = DateTime.UtcNow + delay; - m_RespawnTimer = Timer.DelayCall( delay, new TimerCallback( Respawn ) ); + m_RespawnTimer = Timer.DelayCall( delay, Respawn ); } } else if ( m_RespawnTimer != null ) @@ -258,7 +258,7 @@ namespace Server.Items m_NextRespawnTime = reader.ReadDeltaTime(); TimeSpan delay = m_NextRespawnTime - DateTime.UtcNow; - m_RespawnTimer = Timer.DelayCall( delay > TimeSpan.Zero ? delay : TimeSpan.Zero, new TimerCallback( Respawn ) ); + m_RespawnTimer = Timer.DelayCall( delay > TimeSpan.Zero ? delay : TimeSpan.Zero, Respawn ); } else { @@ -319,7 +319,7 @@ namespace Server.Items int version = reader.ReadEncodedInt(); if ( version == 0 && m_Content == null ) - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( AcquireContent ) ); + Timer.DelayCall( TimeSpan.Zero, AcquireContent ); } } diff --git a/Scripts/Items/Containers/MarkContainer.cs b/Scripts/Items/Containers/MarkContainer.cs index 8bab9d3ed..ea78f0e95 100644 --- a/Scripts/Items/Containers/MarkContainer.cs +++ b/Scripts/Items/Containers/MarkContainer.cs @@ -7,7 +7,7 @@ namespace Server.Items { public static void Initialize() { - CommandSystem.Register( "SecretLocGen", AccessLevel.Administrator, new CommandEventHandler( SecretLocGen_OnCommand ) ); + CommandSystem.Register( "SecretLocGen", AccessLevel.Administrator, SecretLocGen_OnCommand ); } [Usage( "SecretLocGen" )] diff --git a/Scripts/Items/Containers/Strongbox.cs b/Scripts/Items/Containers/Strongbox.cs index ede73a21b..056028e2d 100644 --- a/Scripts/Items/Containers/Strongbox.cs +++ b/Scripts/Items/Containers/Strongbox.cs @@ -65,7 +65,7 @@ namespace Server.Items } } - Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), new TimerCallback( Validate ) ); + Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), Validate ); } private void Validate() diff --git a/Scripts/Items/Decoration Artifacts/StealableArtifactsSpawner.cs b/Scripts/Items/Decoration Artifacts/StealableArtifactsSpawner.cs index 391e9c0bb..2b72cc9c9 100644 --- a/Scripts/Items/Decoration Artifacts/StealableArtifactsSpawner.cs +++ b/Scripts/Items/Decoration Artifacts/StealableArtifactsSpawner.cs @@ -191,8 +191,8 @@ namespace Server.Items public static void Initialize() { - CommandSystem.Register( "GenStealArties", AccessLevel.Administrator, new CommandEventHandler( GenStealArties_OnCommand ) ); - CommandSystem.Register( "RemoveStealArties", AccessLevel.Administrator, new CommandEventHandler( RemoveStealArties_OnCommand ) ); + CommandSystem.Register( "GenStealArties", AccessLevel.Administrator, GenStealArties_OnCommand ); + CommandSystem.Register( "RemoveStealArties", AccessLevel.Administrator, RemoveStealArties_OnCommand ); } [Usage( "GenStealArties" )] @@ -323,7 +323,7 @@ namespace Server.Items m_Artifacts[i] = new StealableInstance( m_Entries[i] ); } - m_RespawnTimer = Timer.DelayCall( TimeSpan.Zero, TimeSpan.FromMinutes( 15.0 ), new TimerCallback( CheckRespawn ) ); + m_RespawnTimer = Timer.DelayCall( TimeSpan.Zero, TimeSpan.FromMinutes( 15.0 ), CheckRespawn ); } public override void OnDelete() @@ -405,7 +405,7 @@ namespace Server.Items m_Artifacts[i] = new StealableInstance( m_Entries[i] ); } - m_RespawnTimer = Timer.DelayCall( TimeSpan.Zero, TimeSpan.FromMinutes( 15.0 ), new TimerCallback( CheckRespawn ) ); + m_RespawnTimer = Timer.DelayCall( TimeSpan.Zero, TimeSpan.FromMinutes( 15.0 ), CheckRespawn ); } } } diff --git a/Scripts/Items/Deeds/DragonBardingDeed.cs b/Scripts/Items/Deeds/DragonBardingDeed.cs index c5778ffd4..d8468c675 100644 --- a/Scripts/Items/Deeds/DragonBardingDeed.cs +++ b/Scripts/Items/Deeds/DragonBardingDeed.cs @@ -42,7 +42,7 @@ namespace Server.Items { if ( IsChildOf( from.Backpack ) ) { - from.BeginTarget( 6, false, TargetFlags.None, new TargetCallback( OnTarget ) ); + from.BeginTarget( 6, false, TargetFlags.None, OnTarget ); from.SendLocalizedMessage( 1053024 ); // Select the swamp dragon you wish to place the barding on. } else diff --git a/Scripts/Items/Farming/FarmableCrop.cs b/Scripts/Items/Farming/FarmableCrop.cs index 0039f3c38..d9650a2e9 100644 --- a/Scripts/Items/Farming/FarmableCrop.cs +++ b/Scripts/Items/Farming/FarmableCrop.cs @@ -41,7 +41,7 @@ namespace Server.Items Unlink(); - Timer.DelayCall( TimeSpan.FromMinutes( 5.0 ), new TimerCallback( Delete ) ); + Timer.DelayCall( TimeSpan.FromMinutes( 5.0 ), Delete ); } public void Unlink() diff --git a/Scripts/Items/Food/Beverage.cs b/Scripts/Items/Food/Beverage.cs index 3ce41c46b..0a823a0c5 100644 --- a/Scripts/Items/Food/Beverage.cs +++ b/Scripts/Items/Food/Beverage.cs @@ -829,7 +829,7 @@ namespace Server.Items public static void Initialize() { - EventSink.Login += new LoginEventHandler( EventSink_Login ); + EventSink.Login += EventSink_Login; } private static void EventSink_Login( LoginEventArgs e ) @@ -1072,12 +1072,12 @@ namespace Server.Items if ( !Fillable || !ValidateUse( from, true ) ) return; - from.BeginTarget( -1, true, TargetFlags.None, new TargetCallback( Fill_OnTarget ) ); + from.BeginTarget( -1, true, TargetFlags.None, Fill_OnTarget ); SendLocalizedMessageTo( from, 500837 ); // Fill from what? } else if ( Pourable && ValidateUse( from, true ) ) { - from.BeginTarget( -1, true, TargetFlags.None, new TargetCallback( Pour_OnTarget ) ); + from.BeginTarget( -1, true, TargetFlags.None, Pour_OnTarget ); from.SendLocalizedMessage( 1010086 ); // What do you want to use this on? } } diff --git a/Scripts/Items/Food/Cooking.cs b/Scripts/Items/Food/Cooking.cs index 9bf0b8377..6da462e67 100644 --- a/Scripts/Items/Food/Cooking.cs +++ b/Scripts/Items/Food/Cooking.cs @@ -611,7 +611,7 @@ namespace Server.Items if ( !Movable ) return; - from.BeginTarget( 4, false, TargetFlags.None, new TargetCallback( OnTarget ) ); + from.BeginTarget( 4, false, TargetFlags.None, OnTarget ); } public virtual void OnTarget( Mobile from, object obj ) diff --git a/Scripts/Items/Games/Mahjong/MahjongPacketHandlers.cs b/Scripts/Items/Games/Mahjong/MahjongPacketHandlers.cs index 190d6e851..62e9b30f0 100644 --- a/Scripts/Items/Games/Mahjong/MahjongPacketHandlers.cs +++ b/Scripts/Items/Games/Mahjong/MahjongPacketHandlers.cs @@ -27,20 +27,20 @@ namespace Server.Engines.Mahjong public static void Initialize() { - PacketHandlers.Register( 0xDA, 0, true, new OnPacketReceive( OnPacket ) ); + PacketHandlers.Register( 0xDA, 0, true, OnPacket ); - RegisterSubCommand( 0x6, new OnMahjongPacketReceive( ExitGame ) ); - RegisterSubCommand( 0xA, new OnMahjongPacketReceive( GivePoints ) ); - RegisterSubCommand( 0xB, new OnMahjongPacketReceive( RollDice ) ); - RegisterSubCommand( 0xC, new OnMahjongPacketReceive( BuildWalls ) ); - RegisterSubCommand( 0xD, new OnMahjongPacketReceive( ResetScores ) ); - RegisterSubCommand( 0xF, new OnMahjongPacketReceive( AssignDealer ) ); - RegisterSubCommand( 0x10, new OnMahjongPacketReceive( OpenSeat ) ); - RegisterSubCommand( 0x11, new OnMahjongPacketReceive( ChangeOption ) ); - RegisterSubCommand( 0x15, new OnMahjongPacketReceive( MoveWallBreakIndicator ) ); - RegisterSubCommand( 0x16, new OnMahjongPacketReceive( TogglePublicHand ) ); - RegisterSubCommand( 0x17, new OnMahjongPacketReceive( MoveTile ) ); - RegisterSubCommand( 0x18, new OnMahjongPacketReceive( MoveDealerIndicator ) ); + RegisterSubCommand( 0x6, ExitGame ); + RegisterSubCommand( 0xA, GivePoints ); + RegisterSubCommand( 0xB, RollDice ); + RegisterSubCommand( 0xC, BuildWalls ); + RegisterSubCommand( 0xD, ResetScores ); + RegisterSubCommand( 0xF, AssignDealer ); + RegisterSubCommand( 0x10, OpenSeat ); + RegisterSubCommand( 0x11, ChangeOption ); + RegisterSubCommand( 0x15, MoveWallBreakIndicator ); + RegisterSubCommand( 0x16, TogglePublicHand ); + RegisterSubCommand( 0x17, MoveTile ); + RegisterSubCommand( 0x18, MoveDealerIndicator ); } public static void OnPacket( NetState state, PacketReader pvSrc ) diff --git a/Scripts/Items/Guilds/Guildstone.cs b/Scripts/Items/Guilds/Guildstone.cs index 355bf4edc..6bc06bdfc 100644 --- a/Scripts/Items/Guilds/Guildstone.cs +++ b/Scripts/Items/Guilds/Guildstone.cs @@ -109,7 +109,7 @@ namespace Server.Items m_BeforeChangeover = true; if ( Guild.NewGuildSystem && m_BeforeChangeover ) - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( AddToHouse ) ); + Timer.DelayCall( TimeSpan.Zero, AddToHouse ); if ( !Guild.NewGuildSystem && m_Guild == null ) Delete(); @@ -382,7 +382,7 @@ namespace Server.Items if ( house != null && house.IsOwner( from ) ) { from.SendLocalizedMessage( 1062838 ); // Where would you like to place this decoration? - from.BeginTarget( -1, true, Targeting.TargetFlags.None, new TargetStateCallback( Placement_OnTarget ), null ); + from.BeginTarget( -1, true, Targeting.TargetFlags.None, Placement_OnTarget, null ); } else { diff --git a/Scripts/Items/Maps/MapItem.cs b/Scripts/Items/Maps/MapItem.cs index ca5cf21a2..b54ce5f4d 100644 --- a/Scripts/Items/Maps/MapItem.cs +++ b/Scripts/Items/Maps/MapItem.cs @@ -291,7 +291,7 @@ namespace Server.Items public static void Initialize() { - PacketHandlers.Register( 0x56, 11, true, new OnPacketReceive( OnMapCommand ) ); + PacketHandlers.Register( 0x56, 11, true, OnMapCommand ); } private static void OnMapCommand( NetState state, PacketReader pvSrc ) diff --git a/Scripts/Items/Maps/TreasureMap.cs b/Scripts/Items/Maps/TreasureMap.cs index bd728646e..a7004619f 100644 --- a/Scripts/Items/Maps/TreasureMap.cs +++ b/Scripts/Items/Maps/TreasureMap.cs @@ -902,7 +902,7 @@ namespace Server.Items { Movable = false; - Timer.DelayCall( TimeSpan.FromMinutes( 2.0 ), new TimerCallback( Delete ) ); + Timer.DelayCall( TimeSpan.FromMinutes( 2.0 ), Delete ); } public TreasureChestDirt( Serial serial ) : base( serial ) diff --git a/Scripts/Items/Misc/AcidSlime.cs b/Scripts/Items/Misc/AcidSlime.cs index 85aa378d2..aeca45243 100644 --- a/Scripts/Items/Misc/AcidSlime.cs +++ b/Scripts/Items/Misc/AcidSlime.cs @@ -30,7 +30,7 @@ namespace Server.Items m_MaxDamage = maxDamage; m_Created = DateTime.UtcNow; m_Duration = duration; - m_Timer = Timer.DelayCall( TimeSpan.Zero, TimeSpan.FromSeconds( 1 ), new TimerCallback( OnTick ) ); + m_Timer = Timer.DelayCall( TimeSpan.Zero, TimeSpan.FromSeconds( 1 ), OnTick ); } public override void OnAfterDelete() diff --git a/Scripts/Items/Misc/ArcaneGem.cs b/Scripts/Items/Misc/ArcaneGem.cs index 5e2e77117..a266c2216 100644 --- a/Scripts/Items/Misc/ArcaneGem.cs +++ b/Scripts/Items/Misc/ArcaneGem.cs @@ -26,7 +26,7 @@ namespace Server.Items } else { - from.BeginTarget( 2, false, TargetFlags.None, new TargetCallback( OnTarget ) ); + from.BeginTarget( 2, false, TargetFlags.None, OnTarget ); from.SendMessage( "What do you wish to use the gem on?" ); } } diff --git a/Scripts/Items/Misc/BulletinBoards.cs b/Scripts/Items/Misc/BulletinBoards.cs index 86ccb6c01..ce6683c78 100644 --- a/Scripts/Items/Misc/BulletinBoards.cs +++ b/Scripts/Items/Misc/BulletinBoards.cs @@ -210,7 +210,7 @@ namespace Server.Items public static void Initialize() { - PacketHandlers.Register( 0x71, 0, true, new OnPacketReceive( BBClientRequest ) ); + PacketHandlers.Register( 0x71, 0, true, BBClientRequest ); } public static void BBClientRequest( NetState state, PacketReader pvSrc ) diff --git a/Scripts/Items/Misc/Corpses/Corpse.cs b/Scripts/Items/Misc/Corpses/Corpse.cs index e9eb28690..19786c5ac 100644 --- a/Scripts/Items/Misc/Corpses/Corpse.cs +++ b/Scripts/Items/Misc/Corpses/Corpse.cs @@ -409,7 +409,7 @@ namespace Server.Items public static void Initialize() { - Mobile.CreateCorpseHandler += new CreateCorpseHandler( Mobile_CreateCorpseHandler ); + Mobile.CreateCorpseHandler += Mobile_CreateCorpseHandler; } public static Container Mobile_CreateCorpseHandler( Mobile owner, HairInfo hair, FacialHairInfo facialhair, List initialContent, List equipItems ) diff --git a/Scripts/Items/Misc/DeceitBrazier.cs b/Scripts/Items/Misc/DeceitBrazier.cs index b36c484c2..05ceac121 100644 --- a/Scripts/Items/Misc/DeceitBrazier.cs +++ b/Scripts/Items/Misc/DeceitBrazier.cs @@ -140,7 +140,7 @@ namespace Server.Items if ( Utility.InRange( m.Location, Location, 1 ) && !Utility.InRange( oldLocation, Location, 1 ) && m.Player && !(m.AccessLevel > AccessLevel.Player || m.Hidden) ) { if ( m_Timer == null || !m_Timer.Running ) - m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 2 ), new TimerCallback( HeedWarning ) ); + m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 2 ), HeedWarning ); } } diff --git a/Scripts/Items/Misc/EffectController.cs b/Scripts/Items/Misc/EffectController.cs index 2f75cb883..aa6135b3d 100644 --- a/Scripts/Items/Misc/EffectController.cs +++ b/Scripts/Items/Misc/EffectController.cs @@ -335,13 +335,13 @@ namespace Server.Items return; if (m_SoundID > 0) - Timer.DelayCall(m_SoundDelay, new TimerStateCallback(PlaySound), trigger); + Timer.DelayCall(m_SoundDelay, PlaySound, trigger); if (m_Trigger != null) - Timer.DelayCall(m_TriggerDelay, new TimerStateCallback(m_Trigger.DoEffect), trigger); + Timer.DelayCall(m_TriggerDelay, m_Trigger.DoEffect, trigger); if (m_EffectType != ECEffectType.None) - Timer.DelayCall(m_EffectDelay, new TimerStateCallback(InternalDoEffect), trigger); + Timer.DelayCall(m_EffectDelay, InternalDoEffect, trigger); } public void InternalDoEffect(IEntity trigger) diff --git a/Scripts/Items/Misc/Firebomb.cs b/Scripts/Items/Misc/Firebomb.cs index e6cf31e76..d055089a4 100644 --- a/Scripts/Items/Misc/Firebomb.cs +++ b/Scripts/Items/Misc/Firebomb.cs @@ -61,7 +61,7 @@ namespace Server.Items if ( m_Timer == null ) { - m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 1 ), TimeSpan.FromSeconds( 1 ), new TimerCallback( OnFirebombTimerTick ) ); + m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 1 ), TimeSpan.FromSeconds( 1 ), OnFirebombTimerTick ); m_LitBy = from; from.SendLocalizedMessage( 1060582 ); // You light the firebomb. Throw it now! } @@ -221,7 +221,7 @@ namespace Server.Items m_LitBy = litBy; m_Expire = DateTime.UtcNow + TimeSpan.FromSeconds( 10 ); m_Burning = toDamage; - m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), TimeSpan.FromSeconds( 1.0 ), new TimerCallback( OnFirebombFieldTimerTick ) ); + m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), TimeSpan.FromSeconds( 1.0 ), OnFirebombFieldTimerTick ); } public FirebombField( Serial serial ) : base( serial ) diff --git a/Scripts/Items/Misc/FlippableAttribute.cs b/Scripts/Items/Misc/FlippableAttribute.cs index 908ba5437..72810ad19 100644 --- a/Scripts/Items/Misc/FlippableAttribute.cs +++ b/Scripts/Items/Misc/FlippableAttribute.cs @@ -9,7 +9,7 @@ namespace Server.Items { public static void Initialize() { - CommandSystem.Register( "Flip", AccessLevel.GameMaster, new CommandEventHandler( Flip_OnCommand ) ); + CommandSystem.Register( "Flip", AccessLevel.GameMaster, Flip_OnCommand ); } [Usage( "Flip" )] diff --git a/Scripts/Items/Misc/Guillotine.cs b/Scripts/Items/Misc/Guillotine.cs index 3566a7229..a7cbbcaf5 100644 --- a/Scripts/Items/Misc/Guillotine.cs +++ b/Scripts/Items/Misc/Guillotine.cs @@ -33,10 +33,10 @@ namespace Server.Items Effects.PlaySound( GetWorldLocation(), Map, 0x387 ); - Timer.DelayCall( TimeSpan.FromSeconds( 0.25 ), new TimerCallback( Down1 ) ); - Timer.DelayCall( TimeSpan.FromSeconds( 0.50 ), new TimerCallback( Down2 ) ); + Timer.DelayCall( TimeSpan.FromSeconds( 0.25 ), Down1 ); + Timer.DelayCall( TimeSpan.FromSeconds( 0.50 ), Down2 ); - Timer.DelayCall( TimeSpan.FromSeconds( 5.00 ), new TimerCallback( BackUp ) ); + Timer.DelayCall( TimeSpan.FromSeconds( 5.00 ), BackUp ); m_NextUse = DateTime.UtcNow + TimeSpan.FromSeconds( 10.0 ); } diff --git a/Scripts/Items/Misc/MorphItem.cs b/Scripts/Items/Misc/MorphItem.cs index 370e6bc3d..8f2e70bc3 100644 --- a/Scripts/Items/Misc/MorphItem.cs +++ b/Scripts/Items/Misc/MorphItem.cs @@ -140,7 +140,7 @@ namespace Server.Items } } - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( Refresh ) ); + Timer.DelayCall( TimeSpan.Zero, Refresh ); } } } diff --git a/Scripts/Items/Misc/OilCloth.cs b/Scripts/Items/Misc/OilCloth.cs index a1a1c1e53..efd81d945 100644 --- a/Scripts/Items/Misc/OilCloth.cs +++ b/Scripts/Items/Misc/OilCloth.cs @@ -40,7 +40,7 @@ namespace Server.Items { if ( IsChildOf( from.Backpack ) ) { - from.BeginTarget( -1, false, TargetFlags.None, new TargetCallback( OnTarget ) ); + from.BeginTarget( -1, false, TargetFlags.None, OnTarget ); from.SendLocalizedMessage( 1005424 ); // Select the weapon or armor you wish to use the cloth on. } else diff --git a/Scripts/Items/Misc/PoolOfAcid.cs b/Scripts/Items/Misc/PoolOfAcid.cs index 07256ae2b..bd1d162d4 100644 --- a/Scripts/Items/Misc/PoolOfAcid.cs +++ b/Scripts/Items/Misc/PoolOfAcid.cs @@ -32,7 +32,7 @@ namespace Server.Items m_Created = DateTime.UtcNow; m_Duration = duration; - m_Timer = Timer.DelayCall( TimeSpan.Zero, TimeSpan.FromSeconds( 1 ), new TimerCallback( OnTick ) ); + m_Timer = Timer.DelayCall( TimeSpan.Zero, TimeSpan.FromSeconds( 1 ), OnTick ); } public override void OnAfterDelete() diff --git a/Scripts/Items/Misc/PublicMoongate.cs b/Scripts/Items/Misc/PublicMoongate.cs index dc42c02ee..6d38fc225 100644 --- a/Scripts/Items/Misc/PublicMoongate.cs +++ b/Scripts/Items/Misc/PublicMoongate.cs @@ -99,7 +99,7 @@ namespace Server.Items public static void Initialize() { - CommandSystem.Register( "MoonGen", AccessLevel.Administrator, new CommandEventHandler( MoonGen_OnCommand ) ); + CommandSystem.Register( "MoonGen", AccessLevel.Administrator, MoonGen_OnCommand ); } [Usage( "MoonGen" )] diff --git a/Scripts/Items/Misc/Teleporter.cs b/Scripts/Items/Misc/Teleporter.cs index bbb8d053e..a4e9ca53d 100644 --- a/Scripts/Items/Misc/Teleporter.cs +++ b/Scripts/Items/Misc/Teleporter.cs @@ -550,7 +550,7 @@ namespace Server.Items { m_Table = new Dictionary(); - EventSink.Logout += new LogoutEventHandler(EventSink_Logout); + EventSink.Logout += EventSink_Logout; } public static void EventSink_Logout(LogoutEventArgs e) diff --git a/Scripts/Items/Misc/WarningItem.cs b/Scripts/Items/Misc/WarningItem.cs index 1ffce81d7..d87464fca 100644 --- a/Scripts/Items/Misc/WarningItem.cs +++ b/Scripts/Items/Misc/WarningItem.cs @@ -117,7 +117,7 @@ namespace Server.Items list[i].Broadcast( triggerer ); } - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( InternalCallback ) ); + Timer.DelayCall( TimeSpan.Zero, InternalCallback ); } private void InternalCallback() diff --git a/Scripts/Items/Misc/Waypoint.cs b/Scripts/Items/Misc/Waypoint.cs index b9cc592a1..fd674805d 100644 --- a/Scripts/Items/Misc/Waypoint.cs +++ b/Scripts/Items/Misc/Waypoint.cs @@ -8,7 +8,7 @@ namespace Server.Items { public static void Initialize() { - CommandSystem.Register( "WayPointSeq", AccessLevel.GameMaster, new CommandEventHandler( WayPointSeq_OnCommand ) ); + CommandSystem.Register( "WayPointSeq", AccessLevel.GameMaster, WayPointSeq_OnCommand ); } public static void WayPointSeq_OnCommand( CommandEventArgs arg ) diff --git a/Scripts/Items/Skill Items/Camping/Bedroll.cs b/Scripts/Items/Skill Items/Camping/Bedroll.cs index 9d44366dd..3bf220fec 100644 --- a/Scripts/Items/Skill Items/Camping/Bedroll.cs +++ b/Scripts/Items/Skill Items/Camping/Bedroll.cs @@ -64,7 +64,7 @@ namespace Server.Items m_Entry = entry; m_Bedroll = bedroll; - m_CloseTimer = Timer.DelayCall( TimeSpan.FromSeconds( 10.0 ), new TimerCallback( CloseGump ) ); + m_CloseTimer = Timer.DelayCall( TimeSpan.FromSeconds( 10.0 ), CloseGump ); AddBackground( 0, 0, 400, 350, 0xA28 ); diff --git a/Scripts/Items/Skill Items/Camping/Campfire.cs b/Scripts/Items/Skill Items/Camping/Campfire.cs index d1ba87da2..923dcda1c 100644 --- a/Scripts/Items/Skill Items/Camping/Campfire.cs +++ b/Scripts/Items/Skill Items/Camping/Campfire.cs @@ -42,7 +42,7 @@ namespace Server.Items m_Entries = new ArrayList(); m_Created = DateTime.UtcNow; - m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), TimeSpan.FromSeconds( 1.0 ), new TimerCallback( OnTick ) ); + m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), TimeSpan.FromSeconds( 1.0 ), OnTick ); } public Campfire( Serial serial ) : base( serial ) diff --git a/Scripts/Items/Skill Items/Carpenter Items/TaxidermyKit.cs b/Scripts/Items/Skill Items/Carpenter Items/TaxidermyKit.cs index 3eab45002..e3530cc3e 100644 --- a/Scripts/Items/Skill Items/Carpenter Items/TaxidermyKit.cs +++ b/Scripts/Items/Skill Items/Carpenter Items/TaxidermyKit.cs @@ -294,7 +294,7 @@ namespace Server.Items } } - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( FixMovingCrate ) ); + Timer.DelayCall( TimeSpan.Zero, FixMovingCrate ); } private void FixMovingCrate() diff --git a/Scripts/Items/Skill Items/Fishing/Misc/SpecialFishingNet.cs b/Scripts/Items/Skill Items/Fishing/Misc/SpecialFishingNet.cs index 7e01633fb..ae16a20c5 100644 --- a/Scripts/Items/Skill Items/Fishing/Misc/SpecialFishingNet.cs +++ b/Scripts/Items/Skill Items/Fishing/Misc/SpecialFishingNet.cs @@ -104,7 +104,7 @@ namespace Server.Items else if ( IsChildOf( from.Backpack ) ) { from.SendLocalizedMessage( 1010484 ); // Where do you wish to use the net? - from.BeginTarget( -1, true, TargetFlags.None, new TargetCallback( OnTarget ) ); + from.BeginTarget( -1, true, TargetFlags.None, OnTarget ); } else { diff --git a/Scripts/Items/Skill Items/Magical/Misc/Moongate.cs b/Scripts/Items/Skill Items/Magical/Misc/Moongate.cs index 3a8584ead..d42456ff8 100644 --- a/Scripts/Items/Skill Items/Magical/Misc/Moongate.cs +++ b/Scripts/Items/Skill Items/Magical/Misc/Moongate.cs @@ -326,7 +326,7 @@ namespace Server.Items if ( m_GumpWidth > 0 && m_GumpHeight > 0 && m_TitleNumber > 0 && (m_MessageNumber > 0 || m_MessageString != null) ) { from.CloseGump( typeof( WarningGump ) ); - from.SendGump( new WarningGump( m_TitleNumber, m_TitleColor, m_MessageString == null ? (object)m_MessageNumber : (object)m_MessageString, m_MessageColor, m_GumpWidth, m_GumpHeight, new WarningGumpCallback( Warning_Callback ), from ) ); + from.SendGump( new WarningGump( m_TitleNumber, m_TitleColor, m_MessageString == null ? (object)m_MessageNumber : (object)m_MessageString, m_MessageColor, m_GumpWidth, m_GumpHeight, Warning_Callback, from ) ); } else { diff --git a/Scripts/Items/Skill Items/Magical/Misc/PotionKeg.cs b/Scripts/Items/Skill Items/Magical/Misc/PotionKeg.cs index 45ee7678d..f9a824a7d 100644 --- a/Scripts/Items/Skill Items/Magical/Misc/PotionKeg.cs +++ b/Scripts/Items/Skill Items/Magical/Misc/PotionKeg.cs @@ -79,7 +79,7 @@ namespace Server.Items } if ( version < 1 ) - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( UpdateWeight ) ); + Timer.DelayCall( TimeSpan.Zero, UpdateWeight ); } public override int LabelNumber diff --git a/Scripts/Items/Skill Items/Magical/Potions/Confusion Blast Potions/BaseConfusionBlastPotion.cs b/Scripts/Items/Skill Items/Magical/Potions/Confusion Blast Potions/BaseConfusionBlastPotion.cs index 8fba3c02c..a3b41cbe5 100644 --- a/Scripts/Items/Skill Items/Magical/Potions/Confusion Blast Potions/BaseConfusionBlastPotion.cs +++ b/Scripts/Items/Skill Items/Magical/Potions/Confusion Blast Potions/BaseConfusionBlastPotion.cs @@ -90,7 +90,7 @@ namespace Server.Items // Effects Effects.PlaySound( loc, map, 0x207 ); - Geometry.Circle2D( loc, map, Radius, new DoEffect_Callback( BlastEffect ), 270, 90 ); + Geometry.Circle2D( loc, map, Radius, BlastEffect, 270, 90 ); Timer.DelayCall( TimeSpan.FromSeconds( 0.3 ), new TimerStateCallback( CircleEffect2 ), new object[] { loc, map } ); @@ -117,7 +117,7 @@ namespace Server.Items { object[] states = (object[]) state; - Geometry.Circle2D( (Point3D)states[0], (Map)states[1], Radius, new DoEffect_Callback( BlastEffect ), 90, 270 ); + Geometry.Circle2D( (Point3D)states[0], (Map)states[1], Radius, BlastEffect, 90, 270 ); } #endregion diff --git a/Scripts/Items/Skill Items/Magical/Spellbook.cs b/Scripts/Items/Skill Items/Magical/Spellbook.cs index e39b0091e..37e093e02 100644 --- a/Scripts/Items/Skill Items/Magical/Spellbook.cs +++ b/Scripts/Items/Skill Items/Magical/Spellbook.cs @@ -47,17 +47,17 @@ namespace Server.Items public static void Initialize() { - EventSink.OpenSpellbookRequest += new OpenSpellbookRequestEventHandler( EventSink_OpenSpellbookRequest ); - EventSink.CastSpellRequest += new CastSpellRequestEventHandler( EventSink_CastSpellRequest ); + EventSink.OpenSpellbookRequest += EventSink_OpenSpellbookRequest; + EventSink.CastSpellRequest += EventSink_CastSpellRequest; - CommandSystem.Register( "AllSpells", AccessLevel.GameMaster, new CommandEventHandler( AllSpells_OnCommand ) ); + CommandSystem.Register( "AllSpells", AccessLevel.GameMaster, AllSpells_OnCommand ); } [Usage( "AllSpells" )] [Description( "Completely fills a targeted spellbook with scrolls." )] private static void AllSpells_OnCommand( CommandEventArgs e ) { - e.Mobile.BeginTarget( -1, false, TargetFlags.None, new TargetCallback( AllSpells_OnTarget ) ); + e.Mobile.BeginTarget( -1, false, TargetFlags.None, AllSpells_OnTarget ); e.Mobile.SendMessage( "Target the spellbook to fill." ); } @@ -76,7 +76,7 @@ namespace Server.Items } else { - from.BeginTarget( -1, false, TargetFlags.None, new TargetCallback( AllSpells_OnTarget ) ); + from.BeginTarget( -1, false, TargetFlags.None, AllSpells_OnTarget ); from.SendMessage( "That is not a spellbook. Try again." ); } } diff --git a/Scripts/Items/Skill Items/Misc/Bandage.cs b/Scripts/Items/Skill Items/Misc/Bandage.cs index 07f3535ce..65ba5262c 100644 --- a/Scripts/Items/Skill Items/Misc/Bandage.cs +++ b/Scripts/Items/Skill Items/Misc/Bandage.cs @@ -14,7 +14,7 @@ namespace Server.Items public static void Initialize() { - EventSink.BandageTargetRequest += new BandageTargetRequestEventHandler(EventSink_BandageTargetRequest); + EventSink.BandageTargetRequest += EventSink_BandageTargetRequest; } [Constructible] diff --git a/Scripts/Items/Skill Items/Musical Instruments/BaseInstrument.cs b/Scripts/Items/Skill Items/Musical Instruments/BaseInstrument.cs index 8ab58579b..b91d18cd8 100644 --- a/Scripts/Items/Skill Items/Musical Instruments/BaseInstrument.cs +++ b/Scripts/Items/Skill Items/Musical Instruments/BaseInstrument.cs @@ -361,7 +361,7 @@ namespace Server.Items } if ( m_UsesRemaining != oldUses ) - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( InvalidateProperties ) ); + Timer.DelayCall( TimeSpan.Zero, InvalidateProperties ); } public override void OnSingleClick( Mobile from ) diff --git a/Scripts/Items/Skill Items/Ninjitsu/NinjaWeapons.cs b/Scripts/Items/Skill Items/Ninjitsu/NinjaWeapons.cs index 7bcd18d08..f2261f46c 100644 --- a/Scripts/Items/Skill Items/Ninjitsu/NinjaWeapons.cs +++ b/Scripts/Items/Skill Items/Ninjitsu/NinjaWeapons.cs @@ -44,7 +44,7 @@ namespace Server.Items { if (CanUseWeapon(from, weapon)) { - from.BeginTarget(weapon.WeaponMaxRange, false, TargetFlags.Harmful, new TargetStateCallback(OnTarget), weapon); + from.BeginTarget(weapon.WeaponMaxRange, false, TargetFlags.Harmful, OnTarget, weapon); } } @@ -66,10 +66,10 @@ namespace Server.Items if (CombatCheck(from, target)) { - Timer.DelayCall(TimeSpan.FromSeconds(1.0), new TimerStateCallback(OnHit), new object[] { from, target, weapon }); + Timer.DelayCall(TimeSpan.FromSeconds(1.0), OnHit, new object[] { from, target, weapon }); } - Timer.DelayCall(TimeSpan.FromSeconds(2.5), new TimerStateCallback(ResetUsing), from); + Timer.DelayCall(TimeSpan.FromSeconds(2.5), ResetUsing, from); } else { @@ -356,7 +356,7 @@ namespace Server.Items { if (WeaponIsValid(weapon, Owner.From)) { - Owner.From.BeginTarget(10, false, TargetFlags.Harmful, new TargetStateCallback(OnTarget), weapon); + Owner.From.BeginTarget(10, false, TargetFlags.Harmful, OnTarget, weapon); } } } diff --git a/Scripts/Items/Skill Items/Tailor Items/Misc/Dyes.cs b/Scripts/Items/Skill Items/Tailor Items/Misc/Dyes.cs index 1ade5b64d..9d003e872 100644 --- a/Scripts/Items/Skill Items/Tailor Items/Misc/Dyes.cs +++ b/Scripts/Items/Skill Items/Tailor Items/Misc/Dyes.cs @@ -92,11 +92,11 @@ namespace Server.Items { if ( tub.MetallicHues ) /* OSI has three metallic tubs now */ { - from.SendGump( new MetallicHuePicker( from, new MetallicHuePicker.MetallicHuePickerCallback( SetTubHue ), tub ) ); + from.SendGump( new MetallicHuePicker( from, SetTubHue, tub ) ); } else if ( tub.CustomHuePicker != null ) { - from.SendGump( new CustomHuePickerGump( from, tub.CustomHuePicker, new CustomHuePickerCallback( SetTubHue ), tub ) ); + from.SendGump( new CustomHuePickerGump( from, tub.CustomHuePicker, SetTubHue, tub ) ); } else { diff --git a/Scripts/Items/Special/8th Anniversary Items/Dawn's Music Box/DawnsMusicBox.cs b/Scripts/Items/Special/8th Anniversary Items/Dawn's Music Box/DawnsMusicBox.cs index 3f4de163f..c2d17ffc9 100644 --- a/Scripts/Items/Special/8th Anniversary Items/Dawn's Music Box/DawnsMusicBox.cs +++ b/Scripts/Items/Special/8th Anniversary Items/Dawn's Music Box/DawnsMusicBox.cs @@ -134,7 +134,7 @@ namespace Server.Items m_ItemID = ItemID; m.Send( new PlayMusic( music ) ); - m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 0.5 ), TimeSpan.FromSeconds( 0.5 ), 4, new TimerCallback( Animate ) ); + m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 0.5 ), TimeSpan.FromSeconds( 0.5 ), 4, Animate ); } public void EndMusic( Mobile m ) diff --git a/Scripts/Items/Special/8th Anniversary Items/FountainOfLife.cs b/Scripts/Items/Special/8th Anniversary Items/FountainOfLife.cs index 7b90ef1b1..ea2e1eaca 100644 --- a/Scripts/Items/Special/8th Anniversary Items/FountainOfLife.cs +++ b/Scripts/Items/Special/8th Anniversary Items/FountainOfLife.cs @@ -93,7 +93,7 @@ namespace Server.Items { m_Charges = charges; - m_Timer = Timer.DelayCall( RechargeTime, RechargeTime, new TimerCallback( Recharge ) ); + m_Timer = Timer.DelayCall( RechargeTime, RechargeTime, Recharge ); } public FountainOfLife( Serial serial ) @@ -172,9 +172,9 @@ namespace Server.Items DateTime next = reader.ReadDateTime(); if ( next < DateTime.UtcNow ) - m_Timer = Timer.DelayCall( TimeSpan.Zero, RechargeTime, new TimerCallback( Recharge ) ); + m_Timer = Timer.DelayCall( TimeSpan.Zero, RechargeTime, Recharge ); else - m_Timer = Timer.DelayCall( next - DateTime.UtcNow, RechargeTime, new TimerCallback( Recharge ) ); + m_Timer = Timer.DelayCall( next - DateTime.UtcNow, RechargeTime, Recharge ); } public void Recharge() diff --git a/Scripts/Items/Special/Evil Home Decor Collection/CreepyPortrait.cs b/Scripts/Items/Special/Evil Home Decor Collection/CreepyPortrait.cs index d3c806071..8a8879ff3 100644 --- a/Scripts/Items/Special/Evil Home Decor Collection/CreepyPortrait.cs +++ b/Scripts/Items/Special/Evil Home Decor Collection/CreepyPortrait.cs @@ -34,7 +34,7 @@ namespace Server.Items if ( ItemID == 0x2A69 || ItemID == 0x2A6D ) { Up(); - Timer.DelayCall( TimeSpan.FromSeconds( 0.5 ), TimeSpan.FromSeconds( 0.5 ), 2, new TimerCallback( Up ) ); + Timer.DelayCall( TimeSpan.FromSeconds( 0.5 ), TimeSpan.FromSeconds( 0.5 ), 2, Up ); } } else if ( Utility.InRange( old, Location, 2 ) && !Utility.InRange( m.Location, Location, 2 ) ) @@ -42,7 +42,7 @@ namespace Server.Items if ( ItemID == 0x2A6C || ItemID == 0x2A70 ) { Down(); - Timer.DelayCall( TimeSpan.FromSeconds( 0.5 ), TimeSpan.FromSeconds( 0.5 ), 2, new TimerCallback( Down ) ); + Timer.DelayCall( TimeSpan.FromSeconds( 0.5 ), TimeSpan.FromSeconds( 0.5 ), 2, Down ); } } } diff --git a/Scripts/Items/Special/Evil Home Decor Collection/DisturbingPortrait.cs b/Scripts/Items/Special/Evil Home Decor Collection/DisturbingPortrait.cs index ea078d4c2..b0457e99b 100644 --- a/Scripts/Items/Special/Evil Home Decor Collection/DisturbingPortrait.cs +++ b/Scripts/Items/Special/Evil Home Decor Collection/DisturbingPortrait.cs @@ -12,7 +12,7 @@ namespace Server.Items public DisturbingPortraitComponent() : base( 0x2A5D ) { - m_Timer = Timer.DelayCall( TimeSpan.FromMinutes( 3 ), TimeSpan.FromMinutes( 3 ), new TimerCallback( Change ) ); + m_Timer = Timer.DelayCall( TimeSpan.FromMinutes( 3 ), TimeSpan.FromMinutes( 3 ), Change ); } public DisturbingPortraitComponent( Serial serial ) : base( serial ) @@ -48,7 +48,7 @@ namespace Server.Items int version = reader.ReadEncodedInt(); - m_Timer = Timer.DelayCall( TimeSpan.FromMinutes( 3 ), TimeSpan.FromMinutes( 3 ), new TimerCallback( Change ) ); + m_Timer = Timer.DelayCall( TimeSpan.FromMinutes( 3 ), TimeSpan.FromMinutes( 3 ), Change ); } private void Change() diff --git a/Scripts/Items/Special/Evil Home Decor Collection/SacrificialAltar.cs b/Scripts/Items/Special/Evil Home Decor Collection/SacrificialAltar.cs index 55dd8cf4c..7b3d77bce 100644 --- a/Scripts/Items/Special/Evil Home Decor Collection/SacrificialAltar.cs +++ b/Scripts/Items/Special/Evil Home Decor Collection/SacrificialAltar.cs @@ -41,7 +41,7 @@ namespace Server.Items m_Timer?.Stop(); - m_Timer = Timer.DelayCall( TimeSpan.FromMinutes( 3 ), new TimerCallback( Empty ) ); + m_Timer = Timer.DelayCall( TimeSpan.FromMinutes( 3 ), Empty ); } return true; @@ -63,7 +63,7 @@ namespace Server.Items m_Timer?.Stop(); - m_Timer = Timer.DelayCall( TimeSpan.FromMinutes( 3 ), new TimerCallback( Empty ) ); + m_Timer = Timer.DelayCall( TimeSpan.FromMinutes( 3 ), Empty ); } return true; @@ -83,7 +83,7 @@ namespace Server.Items int version = reader.ReadEncodedInt(); if ( Items.Count > 0 ) - m_Timer = Timer.DelayCall( TimeSpan.FromMinutes( 3 ), new TimerCallback( Empty ) ); + m_Timer = Timer.DelayCall( TimeSpan.FromMinutes( 3 ), Empty ); } public virtual void Flip( Mobile from, Direction direction ) diff --git a/Scripts/Items/Special/Evil Home Decor Collection/UnsettlingPortrait.cs b/Scripts/Items/Special/Evil Home Decor Collection/UnsettlingPortrait.cs index ef662d2e0..54223a89c 100644 --- a/Scripts/Items/Special/Evil Home Decor Collection/UnsettlingPortrait.cs +++ b/Scripts/Items/Special/Evil Home Decor Collection/UnsettlingPortrait.cs @@ -12,7 +12,7 @@ namespace Server.Items public UnsettlingPortraitComponent() : base( 0x2A65 ) { - m_Timer = Timer.DelayCall( TimeSpan.FromMinutes( 3 ), TimeSpan.FromMinutes( 3 ), new TimerCallback( ChangeDirection ) ); + m_Timer = Timer.DelayCall( TimeSpan.FromMinutes( 3 ), TimeSpan.FromMinutes( 3 ), ChangeDirection ); } public UnsettlingPortraitComponent( Serial serial ) : base( serial ) @@ -47,7 +47,7 @@ namespace Server.Items int version = reader.ReadEncodedInt(); - m_Timer = Timer.DelayCall( TimeSpan.FromMinutes( 3 ), TimeSpan.FromMinutes( 3 ), new TimerCallback( ChangeDirection ) ); + m_Timer = Timer.DelayCall( TimeSpan.FromMinutes( 3 ), TimeSpan.FromMinutes( 3 ), ChangeDirection ); } private void ChangeDirection() diff --git a/Scripts/Items/Special/Heritage Items/FruitTrees.cs b/Scripts/Items/Special/Heritage Items/FruitTrees.cs index d96e93367..86677d3c1 100644 --- a/Scripts/Items/Special/Heritage Items/FruitTrees.cs +++ b/Scripts/Items/Special/Heritage Items/FruitTrees.cs @@ -25,7 +25,7 @@ namespace Server.Items public BaseFruitTreeAddon() { - Timer.DelayCall( TimeSpan.FromMinutes( 5 ), new TimerCallback( Respawn ) ); + Timer.DelayCall( TimeSpan.FromMinutes( 5 ), Respawn ); } public BaseFruitTreeAddon( Serial serial ) : base( serial ) @@ -51,7 +51,7 @@ namespace Server.Items else { if ( --m_Fruits == 0 ) - Timer.DelayCall( TimeSpan.FromMinutes( 30 ), new TimerCallback( Respawn ) ); + Timer.DelayCall( TimeSpan.FromMinutes( 30 ), Respawn ); from.SendLocalizedMessage( 501016 ); // You pick some fruit and put it in your backpack. } diff --git a/Scripts/Items/Special/Holiday/Wreath.cs b/Scripts/Items/Special/Holiday/Wreath.cs index bbdd33a61..9c0f72d33 100644 --- a/Scripts/Items/Special/Holiday/Wreath.cs +++ b/Scripts/Items/Special/Holiday/Wreath.cs @@ -48,7 +48,7 @@ namespace Server.Items int version = reader.ReadInt(); - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( FixMovingCrate ) ); + Timer.DelayCall( TimeSpan.Zero, FixMovingCrate ); } private void FixMovingCrate() @@ -207,7 +207,7 @@ namespace Server.Items if ( house != null && house.IsCoOwner( from ) ) { from.SendLocalizedMessage( 1062838 ); // Where would you like to place this decoration? - from.BeginTarget( -1, true, TargetFlags.None, new TargetStateCallback( Placement_OnTarget ), null ); + from.BeginTarget( -1, true, TargetFlags.None, Placement_OnTarget, null ); } else { diff --git a/Scripts/Items/Special/House Raffle/HouseRaffleStone.cs b/Scripts/Items/Special/House Raffle/HouseRaffleStone.cs index 827e709fe..8079f6022 100644 --- a/Scripts/Items/Special/House Raffle/HouseRaffleStone.cs +++ b/Scripts/Items/Special/House Raffle/HouseRaffleStone.cs @@ -248,7 +248,7 @@ namespace Server.Items } } - Timer.DelayCall( TimeSpan.FromMinutes( 1.0 ), TimeSpan.FromMinutes( 1.0 ), new TimerCallback( CheckEnd_OnTick ) ); + Timer.DelayCall( TimeSpan.FromMinutes( 1.0 ), TimeSpan.FromMinutes( 1.0 ), CheckEnd_OnTick ); } [Constructible] @@ -462,7 +462,7 @@ namespace Server.Items else { from.SendGump( new WarningGump( 1150470, 0x7F00, - $"You are about to purchase a raffle ticket for the house plot located at {FormatLocation()}. The ticket price is {FormatPrice()}. Tickets are non-refundable and you can only purchase one ticket per account. Do you wish to continue?", 0xFFFFFF, 420, 280, new WarningGumpCallback( Purchase_Callback ), null ) ); // CONFIRM TICKET PURCHASE + $"You are about to purchase a raffle ticket for the house plot located at {FormatLocation()}. The ticket price is {FormatPrice()}. Tickets are non-refundable and you can only purchase one ticket per account. Do you wish to continue?", 0xFFFFFF, 420, 280, Purchase_Callback, null ) ); // CONFIRM TICKET PURCHASE } } diff --git a/Scripts/Items/Special/ML/GrizzledMareStatuette.cs b/Scripts/Items/Special/ML/GrizzledMareStatuette.cs index 8b661077c..a19a0ea20 100644 --- a/Scripts/Items/Special/ML/GrizzledMareStatuette.cs +++ b/Scripts/Items/Special/ML/GrizzledMareStatuette.cs @@ -74,7 +74,7 @@ namespace Server.Mobiles if ( version < 1 ) { - Timer.DelayCall( TimeSpan.FromSeconds( 0 ), new TimerCallback( OnAfterDeserialize_Callback ) ); + Timer.DelayCall( TimeSpan.FromSeconds( 0 ), OnAfterDeserialize_Callback ); } } } diff --git a/Scripts/Items/Special/Mutation Core/PlagueBeastBlood.cs b/Scripts/Items/Special/Mutation Core/PlagueBeastBlood.cs index 0cd0761a9..d8a741045 100644 --- a/Scripts/Items/Special/Mutation Core/PlagueBeastBlood.cs +++ b/Scripts/Items/Special/Mutation Core/PlagueBeastBlood.cs @@ -13,7 +13,7 @@ namespace Server.Items public PlagueBeastBlood() : base( 0x122C, 0 ) { - m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 1.5 ), TimeSpan.FromSeconds( 1.5 ), 3, new TimerCallback( Hemorrhage ) ); + m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 1.5 ), TimeSpan.FromSeconds( 1.5 ), 3, Hemorrhage ); } public override void OnAfterDelete() diff --git a/Scripts/Items/Special/Mutation Core/PlagueBeastMutationCore.cs b/Scripts/Items/Special/Mutation Core/PlagueBeastMutationCore.cs index da6b637c8..7a57301f1 100644 --- a/Scripts/Items/Special/Mutation Core/PlagueBeastMutationCore.cs +++ b/Scripts/Items/Special/Mutation Core/PlagueBeastMutationCore.cs @@ -38,7 +38,7 @@ namespace Server.Items from.LocalOverheadMessage( MessageType.Regular, 0x34, 1071906 ); // * You remove the plague mutation core from the plague beast, causing it to dissolve into a pile of goo * if ( owner != null ) - Timer.DelayCall( TimeSpan.FromSeconds( 1 ), new TimerStateCallback( KillParent ), owner ); + Timer.DelayCall( TimeSpan.FromSeconds( 1 ), KillParent, owner ); return true; } diff --git a/Scripts/Items/Special/Mutation Core/PlagueBeastOrgans.cs b/Scripts/Items/Special/Mutation Core/PlagueBeastOrgans.cs index 41b0b90eb..5efdae9b0 100644 --- a/Scripts/Items/Special/Mutation Core/PlagueBeastOrgans.cs +++ b/Scripts/Items/Special/Mutation Core/PlagueBeastOrgans.cs @@ -42,7 +42,7 @@ namespace Server.Items Movable = false; - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( Initialize ) ); + Timer.DelayCall( TimeSpan.Zero, Initialize ); } public virtual void Initialize() @@ -67,7 +67,7 @@ namespace Server.Items { if ( !m_Opened && m_Timer == null ) { - m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 3 ), new TimerStateCallback( FinishOpening ), from ); + m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 3 ), FinishOpening, from ); scissors.PublicOverheadMessage( MessageType.Regular, 0x3B2, 1071897 ); // You carefully cut into the organ. return true; } @@ -392,7 +392,7 @@ namespace Server.Items if ( to.Hue == 0x1 && m_Gland == null && item is PlagueBeastGland ) { m_Gland = item; - m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 3 ), new TimerCallback( FinishHealing ) ); + m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 3 ), FinishHealing ); from.SendAsciiMessage( 0x3B2, "* You place the healthy gland inside the organ sac *" ); item.Movable = false; @@ -420,7 +420,7 @@ namespace Server.Items for ( int i = 0; i < 7 && i < Components.Count; i++ ) Components[ i ].Hue = 0x6; - m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 2 ), new TimerCallback( OpenOrgan ) ); + m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 2 ), OpenOrgan ); } public void OpenOrgan() diff --git a/Scripts/Items/Special/Mutation Core/PlagueBeastVein.cs b/Scripts/Items/Special/Mutation Core/PlagueBeastVein.cs index d4e1b7985..860e087b6 100644 --- a/Scripts/Items/Special/Mutation Core/PlagueBeastVein.cs +++ b/Scripts/Items/Special/Mutation Core/PlagueBeastVein.cs @@ -22,7 +22,7 @@ namespace Server.Items { if ( !m_Cut && m_Timer == null ) { - m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 3 ), new TimerStateCallback( CuttingDone ), from ); + m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 3 ), CuttingDone, from ); scissors.PublicOverheadMessage( MessageType.Regular, 0x3B2, 1071899 ); // You begin cutting through the vein. return true; } diff --git a/Scripts/Items/Special/Solen Items/BallOfSummoning.cs b/Scripts/Items/Special/Solen Items/BallOfSummoning.cs index 3c0479760..364cfec9d 100644 --- a/Scripts/Items/Special/Solen Items/BallOfSummoning.cs +++ b/Scripts/Items/Special/Solen Items/BallOfSummoning.cs @@ -113,13 +113,13 @@ namespace Server.Items { if ( Pet == null ) { - list.Add( new BallEntry( new BallCallback( LinkPet ), 6180 ) ); + list.Add( new BallEntry( LinkPet, 6180 ) ); } else { - list.Add(new BallEntry(new BallCallback( CastSummonPet ), 6181 )); - list.Add( new BallEntry( new BallCallback( UpdatePetName ), 6183 ) ); - list.Add( new BallEntry( new BallCallback( UnlinkPet ), 6182 ) ); + list.Add(new BallEntry(CastSummonPet, 6181 )); + list.Add( new BallEntry( UpdatePetName, 6183 ) ); + list.Add( new BallEntry( UnlinkPet, 6182 ) ); } } } diff --git a/Scripts/Items/Special/Solen Items/BraceletOfBinding.cs b/Scripts/Items/Special/Solen Items/BraceletOfBinding.cs index e2b1565e6..f304bfafd 100644 --- a/Scripts/Items/Special/Solen Items/BraceletOfBinding.cs +++ b/Scripts/Items/Special/Solen Items/BraceletOfBinding.cs @@ -110,10 +110,10 @@ namespace Server.Items { BraceletOfBinding bound = Bound; - list.Add( new BraceletEntry( new BraceletCallback( Activate ), 6170, bound != null ) ); - list.Add( new BraceletEntry( new BraceletCallback( Search ), 6171, bound != null ) ); - list.Add( new BraceletEntry( new BraceletCallback( Bind ), bound == null ? 6173 : 6174, true ) ); - list.Add( new BraceletEntry( new BraceletCallback( Inscribe ), 6175, true ) ); + list.Add( new BraceletEntry( Activate, 6170, bound != null ) ); + list.Add( new BraceletEntry( Search, 6171, bound != null ) ); + list.Add( new BraceletEntry( Bind, bound == null ? 6173 : 6174, true ) ); + list.Add( new BraceletEntry( Inscribe, 6175, true ) ); } } diff --git a/Scripts/Items/Special/Valentines/2007/ValentinesCard.cs b/Scripts/Items/Special/Valentines/2007/ValentinesCard.cs index 8aed83150..9c8dc462b 100644 --- a/Scripts/Items/Special/Valentines/2007/ValentinesCard.cs +++ b/Scripts/Items/Special/Valentines/2007/ValentinesCard.cs @@ -63,7 +63,7 @@ namespace Server.Items { if (IsChildOf(from)) { - from.BeginTarget(10, false, TargetFlags.None, new TargetCallback(OnTarget)); + from.BeginTarget(10, false, TargetFlags.None, OnTarget); from.SendLocalizedMessage(1077497); //To whom do you wish to give this card? } diff --git a/Scripts/Items/Special/Veteran Rewards/MiningCart.cs b/Scripts/Items/Special/Veteran Rewards/MiningCart.cs index 12ed6c541..6b9d5885b 100644 --- a/Scripts/Items/Special/Veteran Rewards/MiningCart.cs +++ b/Scripts/Items/Special/Veteran Rewards/MiningCart.cs @@ -112,7 +112,7 @@ namespace Server.Items break; } - m_Timer = Timer.DelayCall( TimeSpan.FromDays( 1 ), TimeSpan.FromDays( 1 ), new TimerCallback( GiveResources ) ); + m_Timer = Timer.DelayCall( TimeSpan.FromDays( 1 ), TimeSpan.FromDays( 1 ), GiveResources ); } public MiningCart( Serial serial ) : base( serial ) @@ -294,7 +294,7 @@ namespace Server.Items if ( next < DateTime.UtcNow ) next = DateTime.UtcNow; - m_Timer = Timer.DelayCall( next - DateTime.UtcNow, TimeSpan.FromDays( 1 ), new TimerCallback( GiveResources ) ); + m_Timer = Timer.DelayCall( next - DateTime.UtcNow, TimeSpan.FromDays( 1 ), GiveResources ); break; } } diff --git a/Scripts/Items/Special/Veteran Rewards/TreeStump.cs b/Scripts/Items/Special/Veteran Rewards/TreeStump.cs index 195c6efd4..62ea5cff2 100644 --- a/Scripts/Items/Special/Veteran Rewards/TreeStump.cs +++ b/Scripts/Items/Special/Veteran Rewards/TreeStump.cs @@ -45,7 +45,7 @@ namespace Server.Items { AddComponent( new AddonComponent( itemID ), 0, 0, 0 ); - m_Timer = Timer.DelayCall( TimeSpan.FromDays( 1 ), TimeSpan.FromDays( 1 ), new TimerCallback( GiveLogs ) ); + m_Timer = Timer.DelayCall( TimeSpan.FromDays( 1 ), TimeSpan.FromDays( 1 ), GiveLogs ); } public TreeStump( Serial serial ) : base( serial ) @@ -151,7 +151,7 @@ namespace Server.Items if ( next < DateTime.UtcNow ) next = DateTime.UtcNow; - m_Timer = Timer.DelayCall( next - DateTime.UtcNow, TimeSpan.FromDays( 1 ), new TimerCallback( GiveLogs ) ); + m_Timer = Timer.DelayCall( next - DateTime.UtcNow, TimeSpan.FromDays( 1 ), GiveLogs ); } } diff --git a/Scripts/Items/Talismans/BaseTalisman.cs b/Scripts/Items/Talismans/BaseTalisman.cs index b0cc7ecad..63b2e69c9 100644 --- a/Scripts/Items/Talismans/BaseTalisman.cs +++ b/Scripts/Items/Talismans/BaseTalisman.cs @@ -23,7 +23,7 @@ namespace Server.Items { public static void Initialize() { - CommandSystem.Register("RandomTalisman", AccessLevel.GameMaster, new CommandEventHandler(RandomTalisman_OnCommand)); + CommandSystem.Register("RandomTalisman", AccessLevel.GameMaster, RandomTalisman_OnCommand); } [Usage("RandomTalisman ")] @@ -722,7 +722,7 @@ namespace Server.Items public virtual void StartTimer() { if (m_Timer == null || !m_Timer.Running) - m_Timer = Timer.DelayCall(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(10), new TimerCallback(Slice)); + m_Timer = Timer.DelayCall(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(10), Slice); } public virtual void StopTimer() diff --git a/Scripts/Items/Talismans/TalismanSummons.cs b/Scripts/Items/Talismans/TalismanSummons.cs index f92478b16..510d9f8cf 100644 --- a/Scripts/Items/Talismans/TalismanSummons.cs +++ b/Scripts/Items/Talismans/TalismanSummons.cs @@ -569,7 +569,7 @@ namespace Server.Mobiles Hue = 0x480; BaseSoundID = 0xC9; - Timer.DelayCall( TimeSpan.FromMinutes( 30.0 ), new TimerCallback( BeginTunnel ) ); + Timer.DelayCall( TimeSpan.FromMinutes( 30.0 ), BeginTunnel ); } public SummonedVorpalBunny( Serial serial ) : base( serial ) @@ -587,7 +587,7 @@ namespace Server.Mobiles Say( "* The bunny begins to dig a tunnel back to its underground lair *" ); PlaySound( 0x247 ); - Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), new TimerCallback( Delete ) ); + Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), Delete ); } public override void Serialize( GenericWriter writer ) diff --git a/Scripts/Items/Traps/FlameSpurtTrap.cs b/Scripts/Items/Traps/FlameSpurtTrap.cs index e6dec2565..2e2fbb13e 100644 --- a/Scripts/Items/Traps/FlameSpurtTrap.cs +++ b/Scripts/Items/Traps/FlameSpurtTrap.cs @@ -16,7 +16,7 @@ namespace Server.Items public virtual void StartTimer() { if ( m_Timer == null ) - m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), TimeSpan.FromSeconds( 1.0 ), new TimerCallback( Refresh ) ); + m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), TimeSpan.FromSeconds( 1.0 ), Refresh ); } public virtual void StopTimer() diff --git a/Scripts/Items/Traps/MushroomTrap.cs b/Scripts/Items/Traps/MushroomTrap.cs index d95648f57..90ce01dac 100644 --- a/Scripts/Items/Traps/MushroomTrap.cs +++ b/Scripts/Items/Traps/MushroomTrap.cs @@ -25,7 +25,7 @@ namespace Server.Items Spells.SpellHelper.Damage( TimeSpan.FromSeconds( 0.5 ), from, from, Utility.Dice( 2, 4, 0 ) ); - Timer.DelayCall( TimeSpan.FromSeconds( 2.0 ), new TimerCallback( OnMushroomReset ) ); + Timer.DelayCall( TimeSpan.FromSeconds( 2.0 ), OnMushroomReset ); } public virtual void OnMushroomReset() diff --git a/Scripts/Items/Traps/SpikeTrap.cs b/Scripts/Items/Traps/SpikeTrap.cs index 43c41ba74..1feda9100 100644 --- a/Scripts/Items/Traps/SpikeTrap.cs +++ b/Scripts/Items/Traps/SpikeTrap.cs @@ -109,7 +109,7 @@ namespace Server.Items Spells.SpellHelper.Damage( TimeSpan.FromTicks( 1 ), mob, mob, Utility.RandomMinMax( 1, 6 ) * 6 ); } - Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), new TimerCallback( OnSpikeExtended ) ); + Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), OnSpikeExtended ); from.LocalOverheadMessage( MessageType.Regular, 0x22, 500852 ); // You stepped onto a spike trap! } @@ -117,7 +117,7 @@ namespace Server.Items public virtual void OnSpikeExtended() { Extended = true; - Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), new TimerCallback( OnSpikeRetracted ) ); + Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), OnSpikeRetracted ); } public virtual void OnSpikeRetracted() diff --git a/Scripts/Items/Traps/StoneFaceTrap.cs b/Scripts/Items/Traps/StoneFaceTrap.cs index daaa0eef9..88d5cc0db 100644 --- a/Scripts/Items/Traps/StoneFaceTrap.cs +++ b/Scripts/Items/Traps/StoneFaceTrap.cs @@ -89,8 +89,8 @@ namespace Server.Items Breathing = true; - Timer.DelayCall( TimeSpan.FromSeconds( 2.0 ), new TimerCallback( FinishBreath ) ); - Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), new TimerCallback( TriggerDamage ) ); + Timer.DelayCall( TimeSpan.FromSeconds( 2.0 ), FinishBreath ); + Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), TriggerDamage ); } public virtual void FinishBreath() diff --git a/Scripts/Items/Wands/BaseWand.cs b/Scripts/Items/Wands/BaseWand.cs index 9d445ae40..41ba4ee45 100644 --- a/Scripts/Items/Wands/BaseWand.cs +++ b/Scripts/Items/Wands/BaseWand.cs @@ -86,7 +86,7 @@ namespace Server.Items public virtual void ApplyDelayTo( Mobile from ) { from.BeginAction( typeof( BaseWand ) ); - Timer.DelayCall(GetUseDelay, new TimerStateCallback(ReleaseWandLock_Callback), from); + Timer.DelayCall(GetUseDelay, ReleaseWandLock_Callback, from); } public virtual void ReleaseWandLock_Callback(Mobile state) diff --git a/Scripts/Items/Weapons/Abilities/WeaponAbility.cs b/Scripts/Items/Weapons/Abilities/WeaponAbility.cs index eb9f5a058..398881996 100644 --- a/Scripts/Items/Weapons/Abilities/WeaponAbility.cs +++ b/Scripts/Items/Weapons/Abilities/WeaponAbility.cs @@ -407,7 +407,7 @@ namespace Server.Items public static void Initialize() { - EventSink.SetAbility += new SetAbilityEventHandler( EventSink_SetAbility ); + EventSink.SetAbility += EventSink_SetAbility; } public WeaponAbility() diff --git a/Scripts/Items/Weapons/Fists.cs b/Scripts/Items/Weapons/Fists.cs index f660b8a8a..16bbfc3a1 100644 --- a/Scripts/Items/Weapons/Fists.cs +++ b/Scripts/Items/Weapons/Fists.cs @@ -8,8 +8,8 @@ namespace Server.Items { Mobile.DefaultWeapon = new Fists(); - EventSink.DisarmRequest += new DisarmRequestEventHandler( EventSink_DisarmRequest ); - EventSink.StunRequest += new StunRequestEventHandler( EventSink_StunRequest ); + EventSink.DisarmRequest += EventSink_DisarmRequest; + EventSink.StunRequest += EventSink_StunRequest; } public override WeaponAbility PrimaryAbility => WeaponAbility.Disarm; diff --git a/Scripts/Items/Weapons/Ranged/BaseRanged.cs b/Scripts/Items/Weapons/Ranged/BaseRanged.cs index 546ef8e58..49f9599cb 100644 --- a/Scripts/Items/Weapons/Ranged/BaseRanged.cs +++ b/Scripts/Items/Weapons/Ranged/BaseRanged.cs @@ -141,7 +141,7 @@ namespace Server.Items if ( !pm.Warmode ) { if ( m_RecoveryTimer == null ) - m_RecoveryTimer = Timer.DelayCall( TimeSpan.FromSeconds( 10 ), new TimerCallback( pm.RecoverAmmo ) ); + m_RecoveryTimer = Timer.DelayCall( TimeSpan.FromSeconds( 10 ), pm.RecoverAmmo ); if ( !m_RecoveryTimer.Running ) m_RecoveryTimer.Start(); diff --git a/Scripts/Items/Weapons/Ranged/JukaBow.cs b/Scripts/Items/Weapons/Ranged/JukaBow.cs index cde4f8028..8d19ff132 100644 --- a/Scripts/Items/Weapons/Ranged/JukaBow.cs +++ b/Scripts/Items/Weapons/Ranged/JukaBow.cs @@ -33,7 +33,7 @@ namespace Server.Items } else { - from.BeginTarget( 2, false, Targeting.TargetFlags.None, new TargetCallback( OnTargetGears ) ); + from.BeginTarget( 2, false, Targeting.TargetFlags.None, OnTargetGears ); from.SendMessage( "Select the gears you wish to use." ); } } diff --git a/Scripts/Misc/Animations.cs b/Scripts/Misc/Animations.cs index 8b012869f..581404e74 100644 --- a/Scripts/Misc/Animations.cs +++ b/Scripts/Misc/Animations.cs @@ -4,7 +4,7 @@ namespace Server.Misc { public static void Initialize() { - EventSink.AnimateRequest += new AnimateRequestEventHandler( EventSink_AnimateRequest ); + EventSink.AnimateRequest += EventSink_AnimateRequest; } private static void EventSink_AnimateRequest( AnimateRequestEventArgs e ) diff --git a/Scripts/Misc/Assistants.cs b/Scripts/Misc/Assistants.cs index 4d1957f96..73368f8b5 100644 --- a/Scripts/Misc/Assistants.cs +++ b/Scripts/Misc/Assistants.cs @@ -87,15 +87,15 @@ namespace Server.Misc { private static Dictionary m_Dictionary = new Dictionary(); - private static TimerStateCallback OnHandshakeTimeout_Callback = new TimerStateCallback(OnHandshakeTimeout); - private static TimerStateCallback OnForceDisconnect_Callback = new TimerStateCallback(OnForceDisconnect); + private static TimerStateCallback OnHandshakeTimeout_Callback = OnHandshakeTimeout; + private static TimerStateCallback OnForceDisconnect_Callback = OnForceDisconnect; public static void Initialize() { if (Settings.Enabled) { - EventSink.Login += new LoginEventHandler(EventSink_Login); - ProtocolExtensions.Register(0xFF, true, new OnPacketReceive(OnHandshakeResponse)); + EventSink.Login += EventSink_Login; + ProtocolExtensions.Register(0xFF, true, OnHandshakeResponse); } } diff --git a/Scripts/Misc/AttackMessage.cs b/Scripts/Misc/AttackMessage.cs index 7dd07538b..5f5cb21d9 100644 --- a/Scripts/Misc/AttackMessage.cs +++ b/Scripts/Misc/AttackMessage.cs @@ -14,7 +14,7 @@ namespace Server.Misc public static void Initialize() { - EventSink.AggressiveAction += new AggressiveActionEventHandler( EventSink_AggressiveAction ); + EventSink.AggressiveAction += EventSink_AggressiveAction; } public static void EventSink_AggressiveAction( AggressiveActionEventArgs e ) diff --git a/Scripts/Misc/AutoRestart.cs b/Scripts/Misc/AutoRestart.cs index b8e197a61..b09a9fdb7 100644 --- a/Scripts/Misc/AutoRestart.cs +++ b/Scripts/Misc/AutoRestart.cs @@ -19,7 +19,7 @@ namespace Server.Misc public static void Initialize() { - CommandSystem.Register( "Restart", AccessLevel.Administrator, new CommandEventHandler( Restart_OnCommand ) ); + CommandSystem.Register( "Restart", AccessLevel.Administrator, Restart_OnCommand ); new AutoRestart().Start(); } @@ -68,14 +68,14 @@ namespace Server.Misc if ( WarningDelay > TimeSpan.Zero ) { Warning_Callback(); - DelayCall( WarningDelay, WarningDelay, new TimerCallback( Warning_Callback ) ); + DelayCall( WarningDelay, WarningDelay, Warning_Callback ); } AutoSave.Save(); m_Restarting = true; - DelayCall( RestartDelay, new TimerCallback( Restart_Callback ) ); + DelayCall( RestartDelay, Restart_Callback ); } } } \ No newline at end of file diff --git a/Scripts/Misc/AutoSave.cs b/Scripts/Misc/AutoSave.cs index 767ccbb31..5ae91ae9b 100644 --- a/Scripts/Misc/AutoSave.cs +++ b/Scripts/Misc/AutoSave.cs @@ -13,7 +13,7 @@ namespace Server.Misc public static void Initialize() { new AutoSave().Start(); - CommandSystem.Register( "SetSaves", AccessLevel.Administrator, new CommandEventHandler( SetSaves_OnCommand ) ); + CommandSystem.Register( "SetSaves", AccessLevel.Administrator, SetSaves_OnCommand ); } private static bool m_SavesEnabled = true; @@ -66,7 +66,7 @@ namespace Server.Misc else World.Broadcast( 0x35, true, "The world will save in {0} second{1}.", s, s != 1 ? "s" : "" ); - DelayCall( m_Warning, new TimerCallback( Save ) ); + DelayCall( m_Warning, Save ); } } diff --git a/Scripts/Misc/Broadcasts.cs b/Scripts/Misc/Broadcasts.cs index 0508834a5..de7c69a8b 100644 --- a/Scripts/Misc/Broadcasts.cs +++ b/Scripts/Misc/Broadcasts.cs @@ -4,8 +4,8 @@ namespace Server.Misc { public static void Initialize() { - EventSink.Crashed += new CrashedEventHandler( EventSink_Crashed ); - EventSink.Shutdown += new ShutdownEventHandler( EventSink_Shutdown ); + EventSink.Crashed += EventSink_Crashed; + EventSink.Shutdown += EventSink_Shutdown; } public static void EventSink_Crashed( CrashedEventArgs e ) diff --git a/Scripts/Misc/BuffIcons.cs b/Scripts/Misc/BuffIcons.cs index af561c93e..1756293cf 100644 --- a/Scripts/Misc/BuffIcons.cs +++ b/Scripts/Misc/BuffIcons.cs @@ -12,11 +12,11 @@ namespace Server { if ( Enabled ) { - EventSink.ClientVersionReceived += new ClientVersionReceivedHandler( delegate( ClientVersionReceivedArgs args ) + EventSink.ClientVersionReceived += delegate( ClientVersionReceivedArgs args ) { if ( args.State.Mobile is PlayerMobile pm ) Timer.DelayCall( TimeSpan.Zero, pm.ResendBuffs ); - } ); + }; } } @@ -72,14 +72,13 @@ namespace Server m_TimeLength = length; m_TimeStart = DateTime.UtcNow; - m_Timer = Timer.DelayCall( length, new TimerCallback( - delegate - { - if ( !(m is PlayerMobile pm) ) - return; + m_Timer = Timer.DelayCall( length, delegate + { + if ( !(m is PlayerMobile pm) ) + return; - pm.RemoveBuff( this ); - } ) ); + pm.RemoveBuff( this ); + } ); } diff --git a/Scripts/Misc/CharacterCreation.cs b/Scripts/Misc/CharacterCreation.cs index 557296f8e..959eaad1e 100644 --- a/Scripts/Misc/CharacterCreation.cs +++ b/Scripts/Misc/CharacterCreation.cs @@ -11,7 +11,7 @@ namespace Server.Misc public static void Initialize() { // Register our event handler - EventSink.CharacterCreated += new CharacterCreatedEventHandler( EventSink_CharacterCreated ); + EventSink.CharacterCreated += EventSink_CharacterCreated; } private static void AddBackpack( Mobile m ) diff --git a/Scripts/Misc/Cleanup.cs b/Scripts/Misc/Cleanup.cs index a002fdb16..760da1c95 100644 --- a/Scripts/Misc/Cleanup.cs +++ b/Scripts/Misc/Cleanup.cs @@ -10,7 +10,7 @@ namespace Server.Misc { public static void Initialize() { - Timer.DelayCall( TimeSpan.FromSeconds( 2.5 ), new TimerCallback( Run ) ); + Timer.DelayCall( TimeSpan.FromSeconds( 2.5 ), Run ); } public static void Run() diff --git a/Scripts/Misc/ClientVerification.cs b/Scripts/Misc/ClientVerification.cs index 7018b010d..e34c2cff7 100644 --- a/Scripts/Misc/ClientVerification.cs +++ b/Scripts/Misc/ClientVerification.cs @@ -61,7 +61,7 @@ namespace Server.Misc public static void Initialize() { - EventSink.ClientVersionReceived += new ClientVersionReceivedHandler( EventSink_ClientVersionReceived ); + EventSink.ClientVersionReceived += EventSink_ClientVersionReceived; //ClientVersion.Required = null; //Required = new ClientVersion( "6.0.0.0" ); diff --git a/Scripts/Misc/CrashGuard.cs b/Scripts/Misc/CrashGuard.cs index f44941d6c..8fab0ac06 100644 --- a/Scripts/Misc/CrashGuard.cs +++ b/Scripts/Misc/CrashGuard.cs @@ -18,7 +18,7 @@ namespace Server.Misc public static void Initialize() { if ( Enabled ) // If enabled, register our crash event handler - EventSink.Crashed += new CrashedEventHandler( CrashGuard_OnCrash ); + EventSink.Crashed += CrashGuard_OnCrash; } public static void CrashGuard_OnCrash( CrashedEventArgs e ) diff --git a/Scripts/Misc/CurrentExpansion.cs b/Scripts/Misc/CurrentExpansion.cs index 56cb27711..43c31ca61 100644 --- a/Scripts/Misc/CurrentExpansion.cs +++ b/Scripts/Misc/CurrentExpansion.cs @@ -32,7 +32,7 @@ namespace Server PacketHandlers.SingleClickProps = true; // single click for everything is overridden to check object property list Mobile.ActionDelay = 1000; - Mobile.AOSStatusHandler = new AOSStatusHandler( AOS.GetStatus ); + Mobile.AOSStatusHandler = AOS.GetStatus; } } } diff --git a/Scripts/Misc/DoorGenerator.cs b/Scripts/Misc/DoorGenerator.cs index bc5b9a4c5..63ae332df 100644 --- a/Scripts/Misc/DoorGenerator.cs +++ b/Scripts/Misc/DoorGenerator.cs @@ -324,7 +324,7 @@ namespace Server public static void Initialize() { - CommandSystem.Register( "DoorGen", AccessLevel.Administrator, new CommandEventHandler( DoorGen_OnCommand ) ); + CommandSystem.Register( "DoorGen", AccessLevel.Administrator, DoorGen_OnCommand ); } [Usage( "DoorGen" )] diff --git a/Scripts/Misc/Email.cs b/Scripts/Misc/Email.cs index 98e708878..2ab8f6e8c 100644 --- a/Scripts/Misc/Email.cs +++ b/Scripts/Misc/Email.cs @@ -82,7 +82,7 @@ namespace Server.Misc public static void AsyncSend( MailMessage message ) { - ThreadPool.QueueUserWorkItem( new WaitCallback( SendCallback ), message ); + ThreadPool.QueueUserWorkItem( SendCallback, message ); } private static void SendCallback( object state ) diff --git a/Scripts/Misc/Fastwalk.cs b/Scripts/Misc/Fastwalk.cs index 9885c156a..d6928e9fc 100644 --- a/Scripts/Misc/Fastwalk.cs +++ b/Scripts/Misc/Fastwalk.cs @@ -19,7 +19,7 @@ namespace Server.Misc Mobile.FwdAccessOverride = AccessOverride; if ( Enabled ) - EventSink.FastWalk += new FastWalkEventHandler( OnFastWalk ); + EventSink.FastWalk += OnFastWalk; } public static void OnFastWalk( FastWalkEventArgs e ) diff --git a/Scripts/Misc/Gifts/Winter2004/Mistletoe.cs b/Scripts/Misc/Gifts/Winter2004/Mistletoe.cs index e23359513..0c0651839 100644 --- a/Scripts/Misc/Gifts/Winter2004/Mistletoe.cs +++ b/Scripts/Misc/Gifts/Winter2004/Mistletoe.cs @@ -48,7 +48,7 @@ namespace Server.Items int version = reader.ReadInt(); - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( FixMovingCrate ) ); + Timer.DelayCall( TimeSpan.Zero, FixMovingCrate ); } private void FixMovingCrate() @@ -221,7 +221,7 @@ namespace Server.Items if ( house != null && house.IsCoOwner( from ) ) { from.SendLocalizedMessage( 1062838 ); // Where would you like to place this decoration? - from.BeginTarget( -1, true, TargetFlags.None, new TargetStateCallback( Placement_OnTarget ), null ); + from.BeginTarget( -1, true, TargetFlags.None, Placement_OnTarget, null ); } else { diff --git a/Scripts/Misc/Guild.cs b/Scripts/Misc/Guild.cs index 00afc3f3c..ea0d62ec4 100644 --- a/Scripts/Misc/Guild.cs +++ b/Scripts/Misc/Guild.cs @@ -565,10 +565,10 @@ namespace Server.Guilds { public static void Configure() { - EventSink.CreateGuild += new CreateGuildHandler( EventSink_CreateGuild ); - EventSink.GuildGumpRequest += new GuildGumpRequestHandler( EventSink_GuildGumpRequest ); + EventSink.CreateGuild += EventSink_CreateGuild; + EventSink.GuildGumpRequest += EventSink_GuildGumpRequest; - CommandSystem.Register( "GuildProps", AccessLevel.Counselor, new CommandEventHandler( GuildProps_OnCommand ) ); + CommandSystem.Register( "GuildProps", AccessLevel.Counselor, GuildProps_OnCommand ); } #region GuildProps @@ -1272,7 +1272,7 @@ namespace Server.Guilds Disband(); */ - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( VerifyGuild_Callback ) ); + Timer.DelayCall( TimeSpan.Zero, VerifyGuild_Callback ); } private void VerifyGuild_Callback() diff --git a/Scripts/Misc/HardwareInfo.cs b/Scripts/Misc/HardwareInfo.cs index b27ffcde9..50755595d 100644 --- a/Scripts/Misc/HardwareInfo.cs +++ b/Scripts/Misc/HardwareInfo.cs @@ -101,16 +101,16 @@ namespace Server public static void Initialize() { - PacketHandlers.Register( 0xD9, 0x10C, false, new OnPacketReceive( OnReceive ) ); + PacketHandlers.Register( 0xD9, 0x10C, false, OnReceive ); - CommandSystem.Register( "HWInfo", AccessLevel.GameMaster, new CommandEventHandler( HWInfo_OnCommand ) ); + CommandSystem.Register( "HWInfo", AccessLevel.GameMaster, HWInfo_OnCommand ); } [Usage( "HWInfo" )] [Description( "Displays information about a targeted player's hardware." )] public static void HWInfo_OnCommand( CommandEventArgs e ) { - e.Mobile.BeginTarget( -1, false, TargetFlags.None, new TargetCallback( HWInfo_OnTarget ) ); + e.Mobile.BeginTarget( -1, false, TargetFlags.None, HWInfo_OnTarget ); e.Mobile.SendMessage( "Target a player to view their hardware information." ); } @@ -137,7 +137,7 @@ namespace Server } else { - from.BeginTarget( -1, false, TargetFlags.None, new TargetCallback( HWInfo_OnTarget ) ); + from.BeginTarget( -1, false, TargetFlags.None, HWInfo_OnTarget ); from.SendMessage( "That is not a player. Try again." ); } } diff --git a/Scripts/Misc/Keywords.cs b/Scripts/Misc/Keywords.cs index fc06ba161..ca15f8353 100644 --- a/Scripts/Misc/Keywords.cs +++ b/Scripts/Misc/Keywords.cs @@ -9,7 +9,7 @@ namespace Server.Misc public static void Initialize() { // Register our speech handler - EventSink.Speech += new SpeechEventHandler( EventSink_Speech ); + EventSink.Speech += EventSink_Speech; } public static void EventSink_Speech( SpeechEventArgs args ) diff --git a/Scripts/Misc/LanguageStatistics.cs b/Scripts/Misc/LanguageStatistics.cs index 98eb9807a..430932867 100644 --- a/Scripts/Misc/LanguageStatistics.cs +++ b/Scripts/Misc/LanguageStatistics.cs @@ -237,7 +237,7 @@ namespace Server.Misc public static void Initialize() { - CommandSystem.Register( "LanguageStatistics", AccessLevel.Administrator, new CommandEventHandler( LanguageStatistics_OnCommand ) ); + CommandSystem.Register( "LanguageStatistics", AccessLevel.Administrator, LanguageStatistics_OnCommand ); } [Usage( "LanguageStatistics" )] diff --git a/Scripts/Misc/LightCycle.cs b/Scripts/Misc/LightCycle.cs index 5b5f9cd34..321ea1c96 100644 --- a/Scripts/Misc/LightCycle.cs +++ b/Scripts/Misc/LightCycle.cs @@ -33,9 +33,9 @@ namespace Server public static void Initialize() { new LightCycleTimer().Start(); - EventSink.Login += new LoginEventHandler( OnLogin ); + EventSink.Login += OnLogin; - CommandSystem.Register( "GlobalLight", AccessLevel.GameMaster, new CommandEventHandler( Light_OnCommand ) ); + CommandSystem.Register( "GlobalLight", AccessLevel.GameMaster, Light_OnCommand ); } [Usage( "GlobalLight " )] diff --git a/Scripts/Misc/LoginStats.cs b/Scripts/Misc/LoginStats.cs index ce2ea765e..bc166a124 100644 --- a/Scripts/Misc/LoginStats.cs +++ b/Scripts/Misc/LoginStats.cs @@ -7,7 +7,7 @@ namespace Server.Misc public static void Initialize() { // Register our event handler - EventSink.Login += new LoginEventHandler( EventSink_Login ); + EventSink.Login += EventSink_Login; } private static void EventSink_Login( LoginEventArgs args ) diff --git a/Scripts/Misc/MapUO.cs b/Scripts/Misc/MapUO.cs index ac42c082d..30630d329 100644 --- a/Scripts/Misc/MapUO.cs +++ b/Scripts/Misc/MapUO.cs @@ -17,10 +17,10 @@ namespace Server.Misc public static void Initialize() { if ( Settings.PartyTrack ) - ProtocolExtensions.Register( 0x00, true, new OnPacketReceive( OnPartyTrack ) ); + ProtocolExtensions.Register( 0x00, true, OnPartyTrack ); if ( Settings.GuildTrack ) - ProtocolExtensions.Register( 0x01, true, new OnPacketReceive( OnGuildTrack ) ); + ProtocolExtensions.Register( 0x01, true, OnGuildTrack ); } private static void OnPartyTrack( NetState state, PacketReader pvSrc ) diff --git a/Scripts/Misc/NameVerification.cs b/Scripts/Misc/NameVerification.cs index 75c6eb9f3..cf1813e42 100644 --- a/Scripts/Misc/NameVerification.cs +++ b/Scripts/Misc/NameVerification.cs @@ -12,7 +12,7 @@ namespace Server.Misc public static void Initialize() { - CommandSystem.Register( "ValidateName", AccessLevel.Administrator, new CommandEventHandler( ValidateName_OnCommand ) ); + CommandSystem.Register( "ValidateName", AccessLevel.Administrator, ValidateName_OnCommand ); } [Usage( "ValidateName" )] diff --git a/Scripts/Misc/Notoriety.cs b/Scripts/Misc/Notoriety.cs index 6dab3a8fd..462162684 100644 --- a/Scripts/Misc/Notoriety.cs +++ b/Scripts/Misc/Notoriety.cs @@ -22,10 +22,10 @@ namespace Server.Misc Notoriety.Hues[Notoriety.Murderer] = 0x22; Notoriety.Hues[Notoriety.Invulnerable] = 0x35; - Notoriety.Handler = new NotorietyHandler( MobileNotoriety ); + Notoriety.Handler = MobileNotoriety; - Mobile.AllowBeneficialHandler = new AllowBeneficialHandler( Mobile_AllowBeneficial ); - Mobile.AllowHarmfulHandler = new AllowHarmfulHandler( Mobile_AllowHarmful ); + Mobile.AllowBeneficialHandler = Mobile_AllowBeneficial; + Mobile.AllowHarmfulHandler = Mobile_AllowHarmful; } private enum GuildStatus { None, Peaceful, Waring } diff --git a/Scripts/Misc/Paperdoll.cs b/Scripts/Misc/Paperdoll.cs index e54f1f238..414bf497e 100644 --- a/Scripts/Misc/Paperdoll.cs +++ b/Scripts/Misc/Paperdoll.cs @@ -7,7 +7,7 @@ namespace Server.Misc { public static void Initialize() { - EventSink.PaperdollRequest += new PaperdollRequestEventHandler( EventSink_PaperdollRequest ); + EventSink.PaperdollRequest += EventSink_PaperdollRequest; } public static void EventSink_PaperdollRequest( PaperdollRequestEventArgs e ) diff --git a/Scripts/Misc/ProfanityProtection.cs b/Scripts/Misc/ProfanityProtection.cs index 8d1eb8c72..c8856bdc8 100644 --- a/Scripts/Misc/ProfanityProtection.cs +++ b/Scripts/Misc/ProfanityProtection.cs @@ -20,7 +20,7 @@ namespace Server.Misc public static void Initialize() { if ( Enabled ) - EventSink.Speech += new SpeechEventHandler( EventSink_Speech ); + EventSink.Speech += EventSink_Speech; } private static bool OnProfanityDetected( Mobile from, string speech ) diff --git a/Scripts/Misc/Profile.cs b/Scripts/Misc/Profile.cs index 7a201b775..87fc18061 100644 --- a/Scripts/Misc/Profile.cs +++ b/Scripts/Misc/Profile.cs @@ -8,8 +8,8 @@ namespace Server.Misc { public static void Initialize() { - EventSink.ProfileRequest += new ProfileRequestEventHandler( EventSink_ProfileRequest ); - EventSink.ChangeProfileRequest += new ChangeProfileRequestEventHandler( EventSink_ChangeProfileRequest ); + EventSink.ProfileRequest += EventSink_ProfileRequest; + EventSink.ChangeProfileRequest += EventSink_ChangeProfileRequest; } public static void EventSink_ChangeProfileRequest( ChangeProfileRequestEventArgs e ) diff --git a/Scripts/Misc/ProtocolExtensions.cs b/Scripts/Misc/ProtocolExtensions.cs index 446b0b07c..312d18224 100644 --- a/Scripts/Misc/ProtocolExtensions.cs +++ b/Scripts/Misc/ProtocolExtensions.cs @@ -9,7 +9,7 @@ namespace Server.Misc public static void Initialize() { - PacketHandlers.Register( 0xF0, 0, false, new OnPacketReceive( DecodeBundledPacket ) ); + PacketHandlers.Register( 0xF0, 0, false, DecodeBundledPacket ); } public static void Register( int packetID, bool ingame, OnPacketReceive onReceive ) diff --git a/Scripts/Misc/RegenRates.cs b/Scripts/Misc/RegenRates.cs index a0b66170c..5c46b5b80 100644 --- a/Scripts/Misc/RegenRates.cs +++ b/Scripts/Misc/RegenRates.cs @@ -16,12 +16,12 @@ namespace Server.Misc Mobile.DefaultStamRate = TimeSpan.FromSeconds( 7.0 ); Mobile.DefaultManaRate = TimeSpan.FromSeconds( 7.0 ); - Mobile.ManaRegenRateHandler = new RegenRateHandler( Mobile_ManaRegenRate ); + Mobile.ManaRegenRateHandler = Mobile_ManaRegenRate; if ( Core.AOS ) { - Mobile.StamRegenRateHandler = new RegenRateHandler( Mobile_StamRegenRate ); - Mobile.HitsRegenRateHandler = new RegenRateHandler( Mobile_HitsRegenRate ); + Mobile.StamRegenRateHandler = Mobile_StamRegenRate; + Mobile.HitsRegenRateHandler = Mobile_HitsRegenRate; } } diff --git a/Scripts/Misc/RenameRequests.cs b/Scripts/Misc/RenameRequests.cs index 4e60726a1..aacbe151e 100644 --- a/Scripts/Misc/RenameRequests.cs +++ b/Scripts/Misc/RenameRequests.cs @@ -6,7 +6,7 @@ namespace Server.Misc { public static void Initialize() { - EventSink.RenameRequest += new RenameRequestEventHandler( EventSink_RenameRequest ); + EventSink.RenameRequest += EventSink_RenameRequest; } private static void EventSink_RenameRequest( RenameRequestEventArgs e ) diff --git a/Scripts/Misc/ServerList.cs b/Scripts/Misc/ServerList.cs index a7cafc2d2..d42184e84 100644 --- a/Scripts/Misc/ServerList.cs +++ b/Scripts/Misc/ServerList.cs @@ -52,7 +52,7 @@ namespace Server.Misc Resolve( Address, out m_PublicAddress ); } - EventSink.ServerList += new ServerListEventHandler( EventSink_ServerList ); + EventSink.ServerList += EventSink_ServerList; } private static IPAddress m_PublicAddress; diff --git a/Scripts/Misc/ShardPoller.cs b/Scripts/Misc/ShardPoller.cs index cc8c8930b..db85fb1e5 100644 --- a/Scripts/Misc/ShardPoller.cs +++ b/Scripts/Misc/ShardPoller.cs @@ -158,7 +158,7 @@ namespace Server.Misc public static void Initialize() { - EventSink.Login += new LoginEventHandler( EventSink_Login ); + EventSink.Login += EventSink_Login; } private static List m_ActivePollers = new List(); @@ -611,7 +611,7 @@ namespace Server.Misc if ( text == null ) return null; - return m_UrlRegex.Replace( text, new MatchEvaluator( UrlRegex_Match ) ); + return m_UrlRegex.Replace( text, UrlRegex_Match ); } public override void OnResponse( Mobile from, string text ) diff --git a/Scripts/Misc/SkillCheck.cs b/Scripts/Misc/SkillCheck.cs index 3666878a0..d48c94d34 100644 --- a/Scripts/Misc/SkillCheck.cs +++ b/Scripts/Misc/SkillCheck.cs @@ -72,11 +72,11 @@ namespace Server.Misc public static void Initialize() { - Mobile.SkillCheckLocationHandler = new SkillCheckLocationHandler( Mobile_SkillCheckLocation ); - Mobile.SkillCheckDirectLocationHandler = new SkillCheckDirectLocationHandler( Mobile_SkillCheckDirectLocation ); + Mobile.SkillCheckLocationHandler = Mobile_SkillCheckLocation; + Mobile.SkillCheckDirectLocationHandler = Mobile_SkillCheckDirectLocation; - Mobile.SkillCheckTargetHandler = new SkillCheckTargetHandler( Mobile_SkillCheckTarget ); - Mobile.SkillCheckDirectTargetHandler = new SkillCheckDirectTargetHandler( Mobile_SkillCheckDirectTarget ); + Mobile.SkillCheckTargetHandler = Mobile_SkillCheckTarget; + Mobile.SkillCheckDirectTargetHandler = Mobile_SkillCheckDirectTarget; } public static bool Mobile_SkillCheckLocation( Mobile from, SkillName skillName, double minSkill, double maxSkill ) diff --git a/Scripts/Misc/SocketOptions.cs b/Scripts/Misc/SocketOptions.cs index 4df64509d..2e8b00eb4 100644 --- a/Scripts/Misc/SocketOptions.cs +++ b/Scripts/Misc/SocketOptions.cs @@ -21,7 +21,7 @@ namespace Server { SendQueue.CoalesceBufferSize = CoalesceBufferSize; - EventSink.SocketConnect += new SocketConnectEventHandler( EventSink_SocketConnect ); + EventSink.SocketConnect += EventSink_SocketConnect; Listener.EndPoints = m_ListenerEndPoints; } diff --git a/Scripts/Misc/ValidationQueue.cs b/Scripts/Misc/ValidationQueue.cs index 95ce79ce6..67bcd3072 100644 --- a/Scripts/Misc/ValidationQueue.cs +++ b/Scripts/Misc/ValidationQueue.cs @@ -25,7 +25,7 @@ namespace Server static ValidationQueue() { m_Queue = new List(); - ValidationQueue.StartValidation += new ValidationEventHandler( ValidateAll ); + ValidationQueue.StartValidation += ValidateAll; } public static void Add( T obj ) diff --git a/Scripts/Misc/VendorGenerator.cs b/Scripts/Misc/VendorGenerator.cs index 910a239b6..2150ce625 100644 --- a/Scripts/Misc/VendorGenerator.cs +++ b/Scripts/Misc/VendorGenerator.cs @@ -10,7 +10,7 @@ namespace Server { public static void Initialize() { - CommandSystem.Register( "VendorGen", AccessLevel.Administrator, new CommandEventHandler( VendorGen_OnCommand ) ); + CommandSystem.Register( "VendorGen", AccessLevel.Administrator, VendorGen_OnCommand ); } private static Rectangle2D[] m_BritRegions = { diff --git a/Scripts/Misc/Weather.cs b/Scripts/Misc/Weather.cs index 1ee00335c..62e097fdd 100644 --- a/Scripts/Misc/Weather.cs +++ b/Scripts/Misc/Weather.cs @@ -200,7 +200,7 @@ namespace Server.Misc list?.Add( this ); - Timer.DelayCall( TimeSpan.FromSeconds( (0.2+(Utility.RandomDouble()*0.8)) * interval.TotalSeconds ), interval, new TimerCallback( OnTick ) ); + Timer.DelayCall( TimeSpan.FromSeconds( (0.2+(Utility.RandomDouble()*0.8)) * interval.TotalSeconds ), interval, OnTick ); } public virtual void Reposition() diff --git a/Scripts/Misc/WeightOverloading.cs b/Scripts/Misc/WeightOverloading.cs index 22ea443c2..e20047900 100644 --- a/Scripts/Misc/WeightOverloading.cs +++ b/Scripts/Misc/WeightOverloading.cs @@ -13,7 +13,7 @@ namespace Server.Misc { public static void Initialize() { - EventSink.Movement += new MovementEventHandler( EventSink_Movement ); + EventSink.Movement += EventSink_Movement; } private static DFAlgorithm m_DFA; diff --git a/Scripts/Misc/uoamVendors.cs b/Scripts/Misc/uoamVendors.cs index a3800100e..032d4d551 100644 --- a/Scripts/Misc/uoamVendors.cs +++ b/Scripts/Misc/uoamVendors.cs @@ -22,7 +22,7 @@ namespace Server public static void Initialize() { - CommandSystem.Register( "UOAMVendors", AccessLevel.Administrator, new CommandEventHandler( Generate_OnCommand ) ); + CommandSystem.Register( "UOAMVendors", AccessLevel.Administrator, Generate_OnCommand ); } [Usage( "UOAMVendors" )] diff --git a/Scripts/Mobiles/AI/BaseAI.cs b/Scripts/Mobiles/AI/BaseAI.cs index 0bf578859..589222ada 100644 --- a/Scripts/Mobiles/AI/BaseAI.cs +++ b/Scripts/Mobiles/AI/BaseAI.cs @@ -2293,7 +2293,7 @@ namespace Server.Mobiles else if (!DoMove(m_Mobile.GetDirectionTo(m), true)) { m_Path = new PathFollower(m_Mobile, m); - m_Path.Mover = new MoveMethod(DoMoveImpl); + m_Path.Mover = DoMoveImpl; if (m_Path.Follow(run, 1)) { @@ -2358,7 +2358,7 @@ namespace Server.Mobiles if (!DoMove(dirTo, true) && needCloser) { m_Path = new PathFollower(m_Mobile, m); - m_Path.Mover = new MoveMethod(DoMoveImpl); + m_Path.Mover = DoMoveImpl; if (m_Path.Follow(bRun, 1)) m_Path = null; @@ -2647,12 +2647,12 @@ namespace Server.Mobiles { if (!m_Mobile.Region.AcceptsSpawnsFrom(se.Region)) { - Timer.DelayCall(TimeSpan.Zero, new TimerCallback(ReturnToHome)); + Timer.DelayCall(TimeSpan.Zero, ReturnToHome); } } else if (!m_Mobile.InRange(se.HomeLocation, se.HomeRange)) { - Timer.DelayCall(TimeSpan.Zero, new TimerCallback(ReturnToHome)); + Timer.DelayCall(TimeSpan.Zero, ReturnToHome); } } } diff --git a/Scripts/Mobiles/AI/HealerAI.cs b/Scripts/Mobiles/AI/HealerAI.cs index 30692c5c5..2dfa49f73 100644 --- a/Scripts/Mobiles/AI/HealerAI.cs +++ b/Scripts/Mobiles/AI/HealerAI.cs @@ -7,9 +7,9 @@ namespace Server.Mobiles { public class HealerAI : BaseAI { - private static NeedDelegate m_Cure = new NeedDelegate( NeedCure ); - private static NeedDelegate m_GHeal = new NeedDelegate( NeedGHeal ); - private static NeedDelegate m_LHeal = new NeedDelegate( NeedLHeal ); + private static NeedDelegate m_Cure = NeedCure; + private static NeedDelegate m_GHeal = NeedGHeal; + private static NeedDelegate m_LHeal = NeedLHeal; private static NeedDelegate[] m_ACure = { m_Cure }; private static NeedDelegate[] m_AGHeal = { m_GHeal }; private static NeedDelegate[] m_ALHeal = { m_LHeal }; diff --git a/Scripts/Mobiles/BaseCreature.cs b/Scripts/Mobiles/BaseCreature.cs index 0d21b71b1..796949c8b 100644 --- a/Scripts/Mobiles/BaseCreature.cs +++ b/Scripts/Mobiles/BaseCreature.cs @@ -1427,7 +1427,7 @@ namespace Server.Mobiles } else if ( from is PlayerMobile mobile ) { - Timer.DelayCall( TimeSpan.FromSeconds( 10 ), new TimerCallback( mobile.RecoverAmmo ) ); + Timer.DelayCall( TimeSpan.FromSeconds( 10 ), mobile.RecoverAmmo ); } base.OnDamage( amount, from, willKill ); @@ -3460,10 +3460,10 @@ namespace Server.Mobiles Say( 1013037 + Utility.Random( 16 ) ); guardedRegion.CallGuards( Location ); - Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), new TimerCallback( ReleaseGuardLock ) ); + Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), ReleaseGuardLock ); m_NoDupeGuards = m; - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( ReleaseGuardDupeLock ) ); + Timer.DelayCall( TimeSpan.Zero, ReleaseGuardDupeLock ); } } } @@ -5359,7 +5359,7 @@ namespace Server.Mobiles { if ( !Deleted && ReturnsToHome && IsSpawnerBound() && !InRange( Home, ( RangeHome + 5 ) ) ) { - Timer.DelayCall( TimeSpan.FromSeconds( ( Utility.Random( 45 ) + 15 ) ), new TimerCallback( GoHome_Callback ) ); + Timer.DelayCall( TimeSpan.FromSeconds( ( Utility.Random( 45 ) + 15 ) ), GoHome_Callback ); m_ReturnQueued = true; } diff --git a/Scripts/Mobiles/Familiars/HordeMinion.cs b/Scripts/Mobiles/Familiars/HordeMinion.cs index 761c7db3c..173c4f905 100644 --- a/Scripts/Mobiles/Familiars/HordeMinion.cs +++ b/Scripts/Mobiles/Familiars/HordeMinion.cs @@ -114,7 +114,7 @@ namespace Server.Mobiles Container pack = Backpack; if ( pack != null && pack.Items.Count > 0 ) - from.SendGump( new WarningGump( 1060635, 30720, 1061672, 32512, 420, 280, new WarningGumpCallback( ConfirmRelease_Callback ), null ) ); + from.SendGump( new WarningGump( 1060635, 30720, 1061672, 32512, 420, 280, ConfirmRelease_Callback, null ) ); else EndRelease( from ); } diff --git a/Scripts/Mobiles/Familiars/ShadowWisp.cs b/Scripts/Mobiles/Familiars/ShadowWisp.cs index 9f2f8a9b0..341524e9c 100644 --- a/Scripts/Mobiles/Familiars/ShadowWisp.cs +++ b/Scripts/Mobiles/Familiars/ShadowWisp.cs @@ -52,7 +52,7 @@ namespace Server.Mobiles FixedEffect( 0x37C4, 1, 12, 1109, 6 ); PlaySound( 0x1D3 ); - Timer.DelayCall( TimeSpan.FromSeconds( 0.5 ), new TimerCallback( Flare ) ); + Timer.DelayCall( TimeSpan.FromSeconds( 0.5 ), Flare ); } private void Flare() diff --git a/Scripts/Mobiles/Monsters/AOS/ShadowKnight.cs b/Scripts/Mobiles/Monsters/AOS/ShadowKnight.cs index 806bfda7f..a1a079064 100644 --- a/Scripts/Mobiles/Monsters/AOS/ShadowKnight.cs +++ b/Scripts/Mobiles/Monsters/AOS/ShadowKnight.cs @@ -147,7 +147,7 @@ namespace Server.Mobiles Effects.PlaySound( to, map, 0x1FE ); m_HasTeleportedAway = true; - m_SoundTimer = Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), TimeSpan.FromSeconds( 2.5 ), new TimerCallback( SendTrackingSound ) ); + m_SoundTimer = Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), TimeSpan.FromSeconds( 2.5 ), SendTrackingSound ); Frozen = true; diff --git a/Scripts/Mobiles/Monsters/Humanoid/Magic/SavageShaman.cs b/Scripts/Mobiles/Monsters/Humanoid/Magic/SavageShaman.cs index 61e7d3521..3f083e5a0 100644 --- a/Scripts/Mobiles/Monsters/Humanoid/Magic/SavageShaman.cs +++ b/Scripts/Mobiles/Monsters/Humanoid/Magic/SavageShaman.cs @@ -138,7 +138,7 @@ namespace Server.Mobiles dancer.AIObject.NextMove = Core.TickCount + 1000; } - Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), new TimerCallback( EndSavageDance ) ); + Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), EndSavageDance ); } } diff --git a/Scripts/Mobiles/Monsters/Humanoid/Melee/KhaldunRevenant.cs b/Scripts/Mobiles/Monsters/Humanoid/Melee/KhaldunRevenant.cs index 3656317f7..a05fb86f8 100644 --- a/Scripts/Mobiles/Monsters/Humanoid/Melee/KhaldunRevenant.cs +++ b/Scripts/Mobiles/Monsters/Humanoid/Melee/KhaldunRevenant.cs @@ -10,7 +10,7 @@ namespace Server.Mobiles public static void Initialize() { - EventSink.PlayerDeath += new PlayerDeathEventHandler( EventSink_PlayerDeath ); + EventSink.PlayerDeath += EventSink_PlayerDeath; } public static void EventSink_PlayerDeath( PlayerDeathEventArgs e ) diff --git a/Scripts/Mobiles/Monsters/LBR/Meers/MeerEternal.cs b/Scripts/Mobiles/Monsters/LBR/Meers/MeerEternal.cs index cf878ffca..0af3560ae 100644 --- a/Scripts/Mobiles/Monsters/LBR/Meers/MeerEternal.cs +++ b/Scripts/Mobiles/Monsters/LBR/Meers/MeerEternal.cs @@ -83,7 +83,7 @@ namespace Server.Mobiles Say( true, "Beware, mortals! You have provoked my wrath!" ); FixedParticles( 0x376A, 10, 10, 9537, 33, 0, EffectLayer.Waist ); - Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), new TimerCallback( DoAreaLeech_Finish ) ); + Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), DoAreaLeech_Finish ); } private void DoAreaLeech_Finish() diff --git a/Scripts/Mobiles/Monsters/ML/Animal/Ferret.cs b/Scripts/Mobiles/Monsters/ML/Animal/Ferret.cs index 567328fc5..a8301be99 100644 --- a/Scripts/Mobiles/Monsters/ML/Animal/Ferret.cs +++ b/Scripts/Mobiles/Monsters/ML/Animal/Ferret.cs @@ -76,11 +76,11 @@ namespace Server.Mobiles Say( m_Vocabulary[ Utility.Random( m_Vocabulary.Length ) ] ); if ( to != null && Utility.RandomBool() ) - Timer.DelayCall( TimeSpan.FromSeconds( Utility.RandomMinMax( 5, 8 ) ), new TimerCallback( delegate { to.Talk(); } ) ); + Timer.DelayCall( TimeSpan.FromSeconds( Utility.RandomMinMax( 5, 8 ) ), delegate { to.Talk(); } ); m_CanTalk = false; - Timer.DelayCall( TimeSpan.FromSeconds( Utility.RandomMinMax( 20, 30 ) ), new TimerCallback( delegate { m_CanTalk = true; } ) ); + Timer.DelayCall( TimeSpan.FromSeconds( Utility.RandomMinMax( 20, 30 ) ), delegate { m_CanTalk = true; } ); } } diff --git a/Scripts/Mobiles/Monsters/ML/Special/Meraktus.cs b/Scripts/Mobiles/Monsters/ML/Special/Meraktus.cs index 384c9153d..342108e4e 100644 --- a/Scripts/Mobiles/Monsters/ML/Special/Meraktus.cs +++ b/Scripts/Mobiles/Monsters/ML/Special/Meraktus.cs @@ -70,7 +70,7 @@ namespace Server.Mobiles PackTalismans(5); } - Timer.DelayCall(TimeSpan.FromSeconds(1), new TimerCallback(SpawnTormented)); + Timer.DelayCall(TimeSpan.FromSeconds(1), SpawnTormented); } public virtual void PackResources(int amount) diff --git a/Scripts/Mobiles/Monsters/Mammal/Melee/VorpalBunny.cs b/Scripts/Mobiles/Monsters/Mammal/Melee/VorpalBunny.cs index 89aa1cbf9..4f2d42d3f 100644 --- a/Scripts/Mobiles/Monsters/Mammal/Melee/VorpalBunny.cs +++ b/Scripts/Mobiles/Monsters/Mammal/Melee/VorpalBunny.cs @@ -61,7 +61,7 @@ namespace Server.Mobiles Movable = false; Hue = 1; - Timer.DelayCall( TimeSpan.FromSeconds( 40.0 ), new TimerCallback( Delete ) ); + Timer.DelayCall( TimeSpan.FromSeconds( 40.0 ), Delete ); } public BunnyHole( Serial serial ) : base( serial ) @@ -87,7 +87,7 @@ namespace Server.Mobiles public virtual void DelayBeginTunnel() { - Timer.DelayCall( TimeSpan.FromMinutes( 3.0 ), new TimerCallback( BeginTunnel ) ); + Timer.DelayCall( TimeSpan.FromMinutes( 3.0 ), BeginTunnel ); } public virtual void BeginTunnel() @@ -101,7 +101,7 @@ namespace Server.Mobiles Say( "* The bunny begins to dig a tunnel back to its underground lair *" ); PlaySound( 0x247 ); - Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), new TimerCallback( Delete ) ); + Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), Delete ); } public override int Meat => 1; diff --git a/Scripts/Mobiles/Monsters/Misc/Melee/PlagueBeastLord.cs b/Scripts/Mobiles/Monsters/Misc/Melee/PlagueBeastLord.cs index 94922d4af..d4ca130bf 100644 --- a/Scripts/Mobiles/Monsters/Misc/Melee/PlagueBeastLord.cs +++ b/Scripts/Mobiles/Monsters/Misc/Melee/PlagueBeastLord.cs @@ -175,7 +175,7 @@ namespace Server.Mobiles m_Timer = new DecayTimer( this ); m_Timer.Start(); - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( BroadcastMessage ) ); + Timer.DelayCall( TimeSpan.Zero, BroadcastMessage ); } private void BroadcastMessage() @@ -225,7 +225,7 @@ namespace Server.Mobiles } from.LocalOverheadMessage( MessageType.Regular, 0x21, 1071904 ); // * You slice through the plague beast's amorphous tissue * - Timer.DelayCall( TimeSpan.Zero, new TimerStateCallback( pack.Open ), from ); + Timer.DelayCall( TimeSpan.Zero, pack.Open, from ); } } diff --git a/Scripts/Mobiles/Monsters/SE/BakeKitsune.cs b/Scripts/Mobiles/Monsters/SE/BakeKitsune.cs index 55f15a184..782170de5 100644 --- a/Scripts/Mobiles/Monsters/SE/BakeKitsune.cs +++ b/Scripts/Mobiles/Monsters/SE/BakeKitsune.cs @@ -67,7 +67,7 @@ namespace Server.Mobiles public override void OnCombatantChange() { if ( Combatant == null && !IsBodyMod && !Controlled && m_DisguiseTimer == null && Utility.RandomBool() ) - m_DisguiseTimer = Timer.DelayCall( TimeSpan.FromSeconds( Utility.RandomMinMax( 15, 30 ) ), new TimerCallback( Disguise ) ); + m_DisguiseTimer = Timer.DelayCall( TimeSpan.FromSeconds( Utility.RandomMinMax( 15, 30 ) ), Disguise ); } public override bool OnBeforeDeath() @@ -119,7 +119,7 @@ namespace Server.Mobiles AddItem( new Robe( Utility.RandomNondyedHue() ) ); m_DisguiseTimer = null; - m_DisguiseTimer = Timer.DelayCall( TimeSpan.FromSeconds( 75 ), new TimerCallback( RemoveDisguise ) ); + m_DisguiseTimer = Timer.DelayCall( TimeSpan.FromSeconds( 75 ), RemoveDisguise ); } public void RemoveDisguise() @@ -270,7 +270,7 @@ namespace Server.Mobiles SetResistance( ResistanceType.Energy, 40, 60 ); } - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( RemoveDisguise ) ); + Timer.DelayCall( TimeSpan.Zero, RemoveDisguise ); } } } diff --git a/Scripts/Mobiles/PlayerMobile.cs b/Scripts/Mobiles/PlayerMobile.cs index 81e05f794..e5b58cda9 100644 --- a/Scripts/Mobiles/PlayerMobile.cs +++ b/Scripts/Mobiles/PlayerMobile.cs @@ -688,16 +688,16 @@ namespace Server.Mobiles public static void Initialize() { if ( FastwalkPrevention ) - PacketHandlers.RegisterThrottler( 0x02, new ThrottlePacketCallback( MovementThrottle_Callback ) ); + PacketHandlers.RegisterThrottler( 0x02, MovementThrottle_Callback ); - EventSink.Login += new LoginEventHandler( OnLogin ); - EventSink.Logout += new LogoutEventHandler( OnLogout ); - EventSink.Connected += new ConnectedEventHandler( EventSink_Connected ); - EventSink.Disconnected += new DisconnectedEventHandler( EventSink_Disconnected ); + EventSink.Login += OnLogin; + EventSink.Logout += OnLogout; + EventSink.Connected += EventSink_Connected; + EventSink.Disconnected += EventSink_Disconnected; if ( Core.SE ) { - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( CheckPets ) ); + Timer.DelayCall( TimeSpan.Zero, CheckPets ); } } @@ -734,7 +734,7 @@ namespace Server.Mobiles { m_Type = type; - m_Timer = Timer.DelayCall( duration, new TimerStateCallback( RemoveBlock ), mobile ); + m_Timer = Timer.DelayCall( duration, RemoveBlock, mobile ); } private void RemoveBlock( Mobile mobile ) @@ -917,7 +917,7 @@ namespace Server.Mobiles return; m_NoDeltaRecursion = true; - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( ValidateEquipment_Sandbox ) ); + Timer.DelayCall( TimeSpan.Zero, ValidateEquipment_Sandbox ); } private void ValidateEquipment_Sandbox() @@ -1588,21 +1588,21 @@ namespace Server.Mobiles if ( InsuranceEnabled ) { if ( Core.SA ) - list.Add( new CallbackEntry( 1114299, new ContextCallback( OpenItemInsuranceMenu ) ) ); // Open Item Insurance Menu + list.Add( new CallbackEntry( 1114299, OpenItemInsuranceMenu ) ); // Open Item Insurance Menu - list.Add( new CallbackEntry( 6201, new ContextCallback( ToggleItemInsurance ) ) ); // Toggle Item Insurance + list.Add( new CallbackEntry( 6201, ToggleItemInsurance ) ); // Toggle Item Insurance if ( !Core.SA ) { if ( AutoRenewInsurance ) - list.Add( new CallbackEntry( 6202, new ContextCallback( CancelRenewInventoryInsurance ) ) ); // Cancel Renewing Inventory Insurance + list.Add( new CallbackEntry( 6202, CancelRenewInventoryInsurance ) ); // Cancel Renewing Inventory Insurance else - list.Add( new CallbackEntry( 6200, new ContextCallback( AutoRenewInventoryInsurance ) ) ); // Auto Renew Inventory Insurance + list.Add( new CallbackEntry( 6200, AutoRenewInventoryInsurance ) ); // Auto Renew Inventory Insurance } } if ( MLQuestSystem.Enabled ) - list.Add( new CallbackEntry( 6169, new ContextCallback( ToggleQuestItem ) ) ); // Toggle Quest Item + list.Add( new CallbackEntry( 6169, ToggleQuestItem ) ); // Toggle Quest Item } BaseHouse house = BaseHouse.FindHouseAt( this ); @@ -1610,24 +1610,24 @@ namespace Server.Mobiles if ( house != null ) { if ( Alive && house.InternalizedVendors.Count > 0 && house.IsOwner( this ) ) - list.Add( new CallbackEntry( 6204, new ContextCallback( GetVendor ) ) ); + list.Add( new CallbackEntry( 6204, GetVendor ) ); if ( house.IsAosRules && !Region.IsPartOf( typeof( Engines.ConPVP.SafeZone ) ) ) // Dueling - list.Add( new CallbackEntry( 6207, new ContextCallback( LeaveHouse ) ) ); + list.Add( new CallbackEntry( 6207, LeaveHouse ) ); } if ( m_JusticeProtectors.Count > 0 ) - list.Add( new CallbackEntry( 6157, new ContextCallback( CancelProtection ) ) ); + list.Add( new CallbackEntry( 6157, CancelProtection ) ); if ( Alive ) - list.Add( new CallbackEntry( 6210, new ContextCallback( ToggleChampionTitleDisplay ) ) ); + list.Add( new CallbackEntry( 6210, ToggleChampionTitleDisplay ) ); if ( Core.HS ) { NetState ns = from.NetState; if ( ns != null && ns.ExtendedStatus ) - list.Add( new CallbackEntry( RefuseTrades ? 1154112 : 1154113, new ContextCallback( ToggleTrades ) ) ); // Allow Trades / Refuse Trades + list.Add( new CallbackEntry( RefuseTrades ? 1154112 : 1154113, ToggleTrades ) ); // Allow Trades / Refuse Trades } } else @@ -1690,7 +1690,7 @@ namespace Server.Mobiles if ( !CheckAlive() ) return; - BeginTarget( -1, false, TargetFlags.None, new TargetCallback( ToggleItemInsurance_Callback ) ); + BeginTarget( -1, false, TargetFlags.None, ToggleItemInsurance_Callback ); SendLocalizedMessage( 1060868 ); // Target the item you wish to toggle insurance status on to cancel } @@ -1733,7 +1733,7 @@ namespace Server.Mobiles if ( item == null || !item.IsChildOf( this ) ) { if ( target ) - BeginTarget( -1, false, TargetFlags.None, new TargetCallback( ToggleItemInsurance_Callback ) ); + BeginTarget( -1, false, TargetFlags.None, ToggleItemInsurance_Callback ); SendLocalizedMessage( 1060871, "", 0x23 ); // You can only insure items that you have equipped or that are in your backpack } @@ -1745,14 +1745,14 @@ namespace Server.Mobiles if ( target ) { - BeginTarget( -1, false, TargetFlags.None, new TargetCallback( ToggleItemInsurance_Callback ) ); + BeginTarget( -1, false, TargetFlags.None, ToggleItemInsurance_Callback ); SendLocalizedMessage( 1060868, "", 0x23 ); // Target the item you wish to toggle insurance status on to cancel } } else if ( !CanInsure( item ) ) { if ( target ) - BeginTarget( -1, false, TargetFlags.None, new TargetCallback( ToggleItemInsurance_Callback ) ); + BeginTarget( -1, false, TargetFlags.None, ToggleItemInsurance_Callback ); SendLocalizedMessage( 1060869, "", 0x23 ); // You cannot insure that } @@ -1780,7 +1780,7 @@ namespace Server.Mobiles if ( target ) { - BeginTarget( -1, false, TargetFlags.None, new TargetCallback( ToggleItemInsurance_Callback ) ); + BeginTarget( -1, false, TargetFlags.None, ToggleItemInsurance_Callback ); SendLocalizedMessage( 1060868, "", 0x23 ); // Target the item you wish to toggle insurance status on to cancel } } @@ -2133,7 +2133,7 @@ namespace Server.Mobiles //CloseGump( typeof( UnknownGump802 ) ); //CloseGump( typeof( UnknownGump804 ) ); - BeginTarget( -1, false, TargetFlags.None, new TargetCallback( ToggleQuestItem_Callback ) ); + BeginTarget( -1, false, TargetFlags.None, ToggleQuestItem_Callback ); SendLocalizedMessage( 1072352 ); // Target the item you wish to toggle Quest Item status on to cancel } @@ -2530,7 +2530,7 @@ namespace Server.Mobiles m_SentHonorContext?.OnSourceDamaged( @from, amount ); if ( willKill && @from is PlayerMobile mobile ) - Timer.DelayCall( TimeSpan.FromSeconds( 10 ), new TimerCallback( mobile.RecoverAmmo ) ); + Timer.DelayCall( TimeSpan.FromSeconds( 10 ), mobile.RecoverAmmo ); base.OnDamage( amount, from, willKill ); } @@ -2564,7 +2564,7 @@ namespace Server.Mobiles public override void OnWarmodeChanged() { if ( !Warmode ) - Timer.DelayCall( TimeSpan.FromSeconds( 10 ), new TimerCallback( RecoverAmmo ) ); + Timer.DelayCall( TimeSpan.FromSeconds( 10 ), RecoverAmmo ); } private Mobile m_InsuranceAward; @@ -2815,7 +2815,7 @@ namespace Server.Mobiles if ( Young && m_DuelContext == null ) { if ( YoungDeathTeleport() ) - Timer.DelayCall( TimeSpan.FromSeconds( 2.5 ), new TimerCallback( SendYoungDeathNotice ) ); + Timer.DelayCall( TimeSpan.FromSeconds( 2.5 ), SendYoungDeathNotice ); } if ( m_DuelContext == null || !m_DuelContext.Registered || !m_DuelContext.Started || m_DuelPlayer == null || m_DuelPlayer.Eliminated ) @@ -4993,7 +4993,7 @@ namespace Server.Mobiles if (pet.Map != Map) { pet.PlaySound( pet.GetAngerSound() ); - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( pet.Delete ) ); + Timer.DelayCall( TimeSpan.Zero, pet.Delete ); } continue; } diff --git a/Scripts/Mobiles/Townfolk/BaseEscortable.cs b/Scripts/Mobiles/Townfolk/BaseEscortable.cs index b9e9e2904..5d54fe960 100644 --- a/Scripts/Mobiles/Townfolk/BaseEscortable.cs +++ b/Scripts/Mobiles/Townfolk/BaseEscortable.cs @@ -388,7 +388,7 @@ namespace Server.Mobiles SetControlMaster(null); m_EscortTable.Remove(master); - Timer.DelayCall(TimeSpan.FromSeconds(5.0), new TimerCallback(Delete)); + Timer.DelayCall(TimeSpan.FromSeconds(5.0), Delete); return null; } else diff --git a/Scripts/Mobiles/Townfolk/TownCrier.cs b/Scripts/Mobiles/Townfolk/TownCrier.cs index 9d90683a4..4c47a2f83 100644 --- a/Scripts/Mobiles/Townfolk/TownCrier.cs +++ b/Scripts/Mobiles/Townfolk/TownCrier.cs @@ -23,7 +23,7 @@ namespace Server.Mobiles public static void Initialize() { - CommandSystem.Register( "TownCriers", AccessLevel.GameMaster, new CommandEventHandler( TownCriers_OnCommand ) ); + CommandSystem.Register( "TownCriers", AccessLevel.GameMaster, TownCriers_OnCommand ); } [Usage( "TownCriers" )] @@ -354,7 +354,7 @@ namespace Server.Mobiles public void ForceBeginAutoShout() { if ( m_AutoShoutTimer == null ) - m_AutoShoutTimer = Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), TimeSpan.FromMinutes( 1.0 ), new TimerCallback( AutoShout_Callback ) ); + m_AutoShoutTimer = Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), TimeSpan.FromMinutes( 1.0 ), AutoShout_Callback ); } public TownCrierEntry AddEntry( string[] lines, TimeSpan duration ) @@ -367,7 +367,7 @@ namespace Server.Mobiles m_Entries.Add( tce ); if ( m_AutoShoutTimer == null ) - m_AutoShoutTimer = Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), TimeSpan.FromMinutes( 1.0 ), new TimerCallback( AutoShout_Callback ) ); + m_AutoShoutTimer = Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), TimeSpan.FromMinutes( 1.0 ), AutoShout_Callback ); return tce; } diff --git a/Scripts/Mobiles/Vendors/BaseVendor.cs b/Scripts/Mobiles/Vendors/BaseVendor.cs index 0f7bf8d04..eaa11c81d 100644 --- a/Scripts/Mobiles/Vendors/BaseVendor.cs +++ b/Scripts/Mobiles/Vendors/BaseVendor.cs @@ -1369,7 +1369,7 @@ namespace Server.Mobiles if ( IsParagon ) IsParagon = false; - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( CheckMorph ) ); + Timer.DelayCall( TimeSpan.Zero, CheckMorph ); } public override void AddCustomContextEntries( Mobile from, List list ) diff --git a/Scripts/Mobiles/Vendors/NPC/RealEstateBroker.cs b/Scripts/Mobiles/Vendors/NPC/RealEstateBroker.cs index 53a646298..fa92473ec 100644 --- a/Scripts/Mobiles/Vendors/NPC/RealEstateBroker.cs +++ b/Scripts/Mobiles/Vendors/NPC/RealEstateBroker.cs @@ -58,7 +58,7 @@ namespace Server.Mobiles if ( !e.Handled && e.Mobile.Alive && e.HasKeyword( 0x38 ) ) // *appraise* { PublicOverheadMessage( MessageType.Regular, 0x3B2, 500608 ); // Which deed would you like appraised? - e.Mobile.BeginTarget( 12, false, TargetFlags.None, new TargetCallback( Appraise_OnTarget ) ); + e.Mobile.BeginTarget( 12, false, TargetFlags.None, Appraise_OnTarget ); e.Handled = true; } diff --git a/Scripts/Mobiles/Vendors/PlayerBarkeeper.cs b/Scripts/Mobiles/Vendors/PlayerBarkeeper.cs index 51008f829..b63bbc808 100644 --- a/Scripts/Mobiles/Vendors/PlayerBarkeeper.cs +++ b/Scripts/Mobiles/Vendors/PlayerBarkeeper.cs @@ -551,7 +551,7 @@ namespace Server.Mobiles } if ( version < 1 ) - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( UpgradeFromVersion0 ) ); + Timer.DelayCall( TimeSpan.Zero, UpgradeFromVersion0 ); } private void UpgradeFromVersion0() diff --git a/Scripts/Mobiles/Vendors/PlayerVendor.cs b/Scripts/Mobiles/Vendors/PlayerVendor.cs index 962c75e09..9b73cee87 100644 --- a/Scripts/Mobiles/Vendors/PlayerVendor.cs +++ b/Scripts/Mobiles/Vendors/PlayerVendor.cs @@ -412,7 +412,7 @@ namespace Server.Mobiles } else { - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( FixDresswear ) ); + Timer.DelayCall( TimeSpan.Zero, FixDresswear ); } m_NextPayTime = DateTime.UtcNow + PayTimer.GetInterval(); @@ -1722,7 +1722,7 @@ namespace Server.Mobiles m_Vendor = (PlayerVendor) reader.ReadMobile(); - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( Delete ) ); + Timer.DelayCall( TimeSpan.Zero, Delete ); } } } diff --git a/Scripts/Mobiles/Vendors/VendorInventory.cs b/Scripts/Mobiles/Vendors/VendorInventory.cs index 9466034c8..bf6cf227f 100644 --- a/Scripts/Mobiles/Vendors/VendorInventory.cs +++ b/Scripts/Mobiles/Vendors/VendorInventory.cs @@ -119,7 +119,7 @@ namespace Server.Mobiles if ( m_Items.Count == 0 && m_Gold == 0 ) { - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( Delete ) ); + Timer.DelayCall( TimeSpan.Zero, Delete ); } else { diff --git a/Scripts/Multis/BaseHouse.cs b/Scripts/Multis/BaseHouse.cs index 3ddef6c50..d9c759d44 100644 --- a/Scripts/Multis/BaseHouse.cs +++ b/Scripts/Multis/BaseHouse.cs @@ -244,7 +244,7 @@ namespace Server.Multis { if ( !Deleted && DecayLevel == DecayLevel.Collapsed ) { - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( Decay_Sandbox ) ); + Timer.DelayCall( TimeSpan.Zero, Decay_Sandbox ); return true; } @@ -940,7 +940,7 @@ namespace Server.Multis LockedDownFlag = 1; SecureFlag = 2; - Timer.DelayCall( TimeSpan.FromMinutes( 1.0 ), TimeSpan.FromMinutes( 1.0 ), new TimerCallback( Decay_OnTick ) ); + Timer.DelayCall( TimeSpan.FromMinutes( 1.0 ), TimeSpan.FromMinutes( 1.0 ), Decay_OnTick ); } public virtual int GetAosCurLockdowns() @@ -1816,7 +1816,7 @@ namespace Server.Multis * When you accept this house, you also accept landlordship for every * contract vendor in the house. */ - to.SendGump( new WarningGump( 1060635, 30720, 1062487, 32512, 420, 280, new WarningGumpCallback( ConfirmTransfer_Callback ), from ) ); + to.SendGump( new WarningGump( 1060635, 30720, 1062487, 32512, 420, 280, ConfirmTransfer_Callback, from ) ); } else { @@ -2487,7 +2487,7 @@ namespace Server.Multis Item child = children[j]; if ( child.Decays && !child.IsLockedDown && !child.IsSecure && (child.LastMoved + child.DecayTime) <= DateTime.UtcNow ) - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( child.Delete ) ); + Timer.DelayCall( TimeSpan.Zero, child.Delete ); } } } @@ -2703,7 +2703,7 @@ namespace Server.Multis * having a chance to fix it themselves. */ - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( FixLockdowns_Sandbox ) ); + Timer.DelayCall( TimeSpan.Zero, FixLockdowns_Sandbox ); } if ( version < 11 ) @@ -2722,10 +2722,10 @@ namespace Server.Multis if ( !CheckDecay() ) { if ( RelocatedEntities.Count > 0 ) - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( RestoreRelocatedEntities ) ); + Timer.DelayCall( TimeSpan.Zero, RestoreRelocatedEntities ); if ( m_Owner == null && m_Friends.Count == 0 && m_CoOwners.Count == 0 ) - Timer.DelayCall( TimeSpan.FromSeconds( 10.0 ), new TimerCallback( Delete ) ); + Timer.DelayCall( TimeSpan.FromSeconds( 10.0 ), Delete ); } } @@ -2783,7 +2783,7 @@ namespace Server.Multis }*/ if ( trans == null && !canClaim ) - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( house.Delete ) ); + Timer.DelayCall( TimeSpan.Zero, house.Delete ); else house.Owner = trans; } diff --git a/Scripts/Multis/Boats/BaseBoat.cs b/Scripts/Multis/Boats/BaseBoat.cs index 2b0f79d95..5128f2dce 100644 --- a/Scripts/Multis/Boats/BaseBoat.cs +++ b/Scripts/Multis/Boats/BaseBoat.cs @@ -1718,7 +1718,7 @@ namespace Server.Multis public static void Initialize() { new UpdateAllTimer().Start(); - EventSink.WorldSave += new WorldSaveEventHandler( EventSink_WorldSave ); + EventSink.WorldSave += EventSink_WorldSave; } private static void EventSink_WorldSave( WorldSaveEventArgs e ) diff --git a/Scripts/Multis/Boats/Strandedness.cs b/Scripts/Multis/Boats/Strandedness.cs index d869706c3..5c61b5041 100644 --- a/Scripts/Multis/Boats/Strandedness.cs +++ b/Scripts/Multis/Boats/Strandedness.cs @@ -84,7 +84,7 @@ namespace Server.Misc public static void Initialize() { - EventSink.Login += new LoginEventHandler( EventSink_Login ); + EventSink.Login += EventSink_Login; } private static bool IsStranded( Mobile from ) diff --git a/Scripts/Multis/Camps/BaseCamp.cs b/Scripts/Multis/Camps/BaseCamp.cs index 4497304ba..70c1a1f5c 100644 --- a/Scripts/Multis/Camps/BaseCamp.cs +++ b/Scripts/Multis/Camps/BaseCamp.cs @@ -32,7 +32,7 @@ namespace Server.Multis m_DecayDelay = TimeSpan.FromMinutes( 30.0 ); RefreshDecay( true ); - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( CheckAddComponents ) ); + Timer.DelayCall( TimeSpan.Zero, CheckAddComponents ); } public void CheckAddComponents() @@ -57,7 +57,7 @@ namespace Server.Multis if ( setDecayTime ) m_DecayTime = DateTime.UtcNow + DecayDelay; - m_DecayTimer = Timer.DelayCall( DecayDelay, new TimerCallback( Delete ) ); + m_DecayTimer = Timer.DelayCall( DecayDelay, Delete ); } public virtual void AddItem( Item item, int xOffset, int yOffset, int zOffset ) diff --git a/Scripts/Multis/HouseFoundation.cs b/Scripts/Multis/HouseFoundation.cs index cb2ff1326..ce25f83cb 100644 --- a/Scripts/Multis/HouseFoundation.cs +++ b/Scripts/Multis/HouseFoundation.cs @@ -778,25 +778,25 @@ namespace Server.Multis public static void Initialize() { - PacketHandlers.RegisterExtended( 0x1E, true, new OnPacketReceive( QueryDesignDetails ) ); + PacketHandlers.RegisterExtended( 0x1E, true, QueryDesignDetails ); - PacketHandlers.RegisterEncoded( 0x02, true, new OnEncodedPacketReceive( Designer_Backup ) ); - PacketHandlers.RegisterEncoded( 0x03, true, new OnEncodedPacketReceive( Designer_Restore ) ); - PacketHandlers.RegisterEncoded( 0x04, true, new OnEncodedPacketReceive( Designer_Commit ) ); - PacketHandlers.RegisterEncoded( 0x05, true, new OnEncodedPacketReceive( Designer_Delete ) ); - PacketHandlers.RegisterEncoded( 0x06, true, new OnEncodedPacketReceive( Designer_Build ) ); - PacketHandlers.RegisterEncoded( 0x0C, true, new OnEncodedPacketReceive( Designer_Close ) ); - PacketHandlers.RegisterEncoded( 0x0D, true, new OnEncodedPacketReceive( Designer_Stairs ) ); - PacketHandlers.RegisterEncoded( 0x0E, true, new OnEncodedPacketReceive( Designer_Sync ) ); - PacketHandlers.RegisterEncoded( 0x10, true, new OnEncodedPacketReceive( Designer_Clear ) ); - PacketHandlers.RegisterEncoded( 0x12, true, new OnEncodedPacketReceive( Designer_Level ) ); + PacketHandlers.RegisterEncoded( 0x02, true, Designer_Backup ); + PacketHandlers.RegisterEncoded( 0x03, true, Designer_Restore ); + PacketHandlers.RegisterEncoded( 0x04, true, Designer_Commit ); + PacketHandlers.RegisterEncoded( 0x05, true, Designer_Delete ); + PacketHandlers.RegisterEncoded( 0x06, true, Designer_Build ); + PacketHandlers.RegisterEncoded( 0x0C, true, Designer_Close ); + PacketHandlers.RegisterEncoded( 0x0D, true, Designer_Stairs ); + PacketHandlers.RegisterEncoded( 0x0E, true, Designer_Sync ); + PacketHandlers.RegisterEncoded( 0x10, true, Designer_Clear ); + PacketHandlers.RegisterEncoded( 0x12, true, Designer_Level ); - PacketHandlers.RegisterEncoded( 0x13, true, new OnEncodedPacketReceive( Designer_Roof ) ); // Samurai Empire roof - PacketHandlers.RegisterEncoded( 0x14, true, new OnEncodedPacketReceive( Designer_RoofDelete ) ); // Samurai Empire roof + PacketHandlers.RegisterEncoded( 0x13, true, Designer_Roof ); // Samurai Empire roof + PacketHandlers.RegisterEncoded( 0x14, true, Designer_RoofDelete ); // Samurai Empire roof - PacketHandlers.RegisterEncoded( 0x1A, true, new OnEncodedPacketReceive( Designer_Revert ) ); + PacketHandlers.RegisterEncoded( 0x1A, true, Designer_Revert ); - EventSink.Speech += new SpeechEventHandler( EventSink_Speech ); + EventSink.Speech += EventSink_Speech; } private static void EventSink_Speech( SpeechEventArgs e ) @@ -2439,7 +2439,7 @@ namespace Server.Multis m_SendQueueSyncRoot = ((ICollection)m_SendQueue).SyncRoot; m_Sync = new AutoResetEvent( false ); - m_Thread = new Thread( new ThreadStart( CompressionThread ) ); + m_Thread = new Thread( CompressionThread ); m_Thread.Name = "Housing Compression Thread"; m_Thread.Start(); } diff --git a/Scripts/Multis/HousePlacementTool.cs b/Scripts/Multis/HousePlacementTool.cs index 59f647e3c..82e5f7b52 100644 --- a/Scripts/Multis/HousePlacementTool.cs +++ b/Scripts/Multis/HousePlacementTool.cs @@ -509,7 +509,7 @@ namespace Server.Items * If you are absolutely certain you wish to proceed, click the button next to OKAY below. * If you do not wish to trade for this house, click CANCEL. */ - from.SendGump( new WarningGump( 1060635, 30720, 1049583, 32512, 420, 280, new WarningGumpCallback( PlacementWarning_Callback ), prev ) ); + from.SendGump( new WarningGump( 1060635, 30720, 1049583, 32512, 420, 280, PlacementWarning_Callback, prev ) ); return true; } diff --git a/Scripts/Multis/HouseSign.cs b/Scripts/Multis/HouseSign.cs index 61dc84a68..6a0bf900c 100644 --- a/Scripts/Multis/HouseSign.cs +++ b/Scripts/Multis/HouseSign.cs @@ -178,7 +178,7 @@ namespace Server.Multis * another house or have another house transferred to you for the * next 7 days. Do you wish to claim this house? */ - m.SendGump( new WarningGump( 501036, 32512, 1049719, 32512, 420, 280, new WarningGumpCallback( ClaimGump_Callback ), null ) ); + m.SendGump( new WarningGump( 501036, 32512, 1049719, 32512, 420, 280, ClaimGump_Callback, null ) ); } } diff --git a/Scripts/Multis/MovingCrate.cs b/Scripts/Multis/MovingCrate.cs index c567f196d..d1caf8953 100644 --- a/Scripts/Multis/MovingCrate.cs +++ b/Scripts/Multis/MovingCrate.cs @@ -239,7 +239,7 @@ namespace Server.Multis if ( m_House != null ) { m_House.MovingCrate = this; - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( Hide ) ); + Timer.DelayCall( TimeSpan.Zero, Hide ); } else { diff --git a/Scripts/Multis/PreviewHouse.cs b/Scripts/Multis/PreviewHouse.cs index 1474919f2..6c9780d4e 100644 --- a/Scripts/Multis/PreviewHouse.cs +++ b/Scripts/Multis/PreviewHouse.cs @@ -120,7 +120,7 @@ namespace Server.Multis } } - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( Delete ) ); + Timer.DelayCall( TimeSpan.Zero, Delete ); } private class DecayTimer : Timer diff --git a/Scripts/Regions/GuardedRegion.cs b/Scripts/Regions/GuardedRegion.cs index ec612b447..1aac3c012 100644 --- a/Scripts/Regions/GuardedRegion.cs +++ b/Scripts/Regions/GuardedRegion.cs @@ -23,9 +23,9 @@ namespace Server.Regions public static void Initialize() { - CommandSystem.Register( "CheckGuarded", AccessLevel.GameMaster, new CommandEventHandler( CheckGuarded_OnCommand ) ); - CommandSystem.Register( "SetGuarded", AccessLevel.Administrator, new CommandEventHandler( SetGuarded_OnCommand ) ); - CommandSystem.Register( "ToggleGuarded", AccessLevel.Administrator, new CommandEventHandler( ToggleGuarded_OnCommand ) ); + CommandSystem.Register( "CheckGuarded", AccessLevel.GameMaster, CheckGuarded_OnCommand ); + CommandSystem.Register( "SetGuarded", AccessLevel.Administrator, SetGuarded_OnCommand ); + CommandSystem.Register( "ToggleGuarded", AccessLevel.Administrator, ToggleGuarded_OnCommand ); } [Usage( "CheckGuarded" )] diff --git a/Scripts/Regions/HouseRegion.cs b/Scripts/Regions/HouseRegion.cs index e4dfd799d..a8a152af4 100644 --- a/Scripts/Regions/HouseRegion.cs +++ b/Scripts/Regions/HouseRegion.cs @@ -14,7 +14,7 @@ namespace Server.Regions public static void Initialize() { - EventSink.Login += new LoginEventHandler( OnLogin ); + EventSink.Login += OnLogin; } public static void OnLogin( LoginEventArgs e ) diff --git a/Scripts/Regions/Spawning/SpawnEntry.cs b/Scripts/Regions/Spawning/SpawnEntry.cs index 35daa5fe9..044664a2a 100644 --- a/Scripts/Regions/Spawning/SpawnEntry.cs +++ b/Scripts/Regions/Spawning/SpawnEntry.cs @@ -143,7 +143,7 @@ namespace Server.Regions if ( m_SpawnTimer == null ) { TimeSpan time = RandomTime(); - m_SpawnTimer = Timer.DelayCall( time, new TimerCallback( TimerCallback ) ); + m_SpawnTimer = Timer.DelayCall( time, TimerCallback ); m_NextSpawn = DateTime.UtcNow + time; } } @@ -264,7 +264,7 @@ namespace Server.Regions m_SpawnTimer?.Stop(); TimeSpan delay = m_NextSpawn - DateTime.UtcNow; - m_SpawnTimer = Timer.DelayCall( delay > TimeSpan.Zero ? delay : TimeSpan.Zero, new TimerCallback( TimerCallback ) ); + m_SpawnTimer = Timer.DelayCall( delay > TimeSpan.Zero ? delay : TimeSpan.Zero, TimerCallback ); } } @@ -311,14 +311,14 @@ namespace Server.Regions SpawnPersistence.EnsureExistence(); - CommandSystem.Register( "RespawnAllRegions", AccessLevel.Administrator, new CommandEventHandler( RespawnAllRegions_OnCommand ) ); - CommandSystem.Register( "RespawnRegion", AccessLevel.GameMaster, new CommandEventHandler( RespawnRegion_OnCommand ) ); - CommandSystem.Register( "DelAllRegionSpawns", AccessLevel.Administrator, new CommandEventHandler( DelAllRegionSpawns_OnCommand ) ); - CommandSystem.Register( "DelRegionSpawns", AccessLevel.GameMaster, new CommandEventHandler( DelRegionSpawns_OnCommand ) ); - CommandSystem.Register( "StartAllRegionSpawns", AccessLevel.Administrator, new CommandEventHandler( StartAllRegionSpawns_OnCommand ) ); - CommandSystem.Register( "StartRegionSpawns", AccessLevel.GameMaster, new CommandEventHandler( StartRegionSpawns_OnCommand ) ); - CommandSystem.Register( "StopAllRegionSpawns", AccessLevel.Administrator, new CommandEventHandler( StopAllRegionSpawns_OnCommand ) ); - CommandSystem.Register( "StopRegionSpawns", AccessLevel.GameMaster, new CommandEventHandler( StopRegionSpawns_OnCommand ) ); + CommandSystem.Register( "RespawnAllRegions", AccessLevel.Administrator, RespawnAllRegions_OnCommand ); + CommandSystem.Register( "RespawnRegion", AccessLevel.GameMaster, RespawnRegion_OnCommand ); + CommandSystem.Register( "DelAllRegionSpawns", AccessLevel.Administrator, DelAllRegionSpawns_OnCommand ); + CommandSystem.Register( "DelRegionSpawns", AccessLevel.GameMaster, DelRegionSpawns_OnCommand ); + CommandSystem.Register( "StartAllRegionSpawns", AccessLevel.Administrator, StartAllRegionSpawns_OnCommand ); + CommandSystem.Register( "StartRegionSpawns", AccessLevel.GameMaster, StartRegionSpawns_OnCommand ); + CommandSystem.Register( "StopAllRegionSpawns", AccessLevel.Administrator, StopAllRegionSpawns_OnCommand ); + CommandSystem.Register( "StopRegionSpawns", AccessLevel.GameMaster, StopRegionSpawns_OnCommand ); } private static BaseRegion GetCommandData( CommandEventArgs args ) diff --git a/Scripts/Skills/Anatomy.cs b/Scripts/Skills/Anatomy.cs index 0184d6b10..baf677d7d 100644 --- a/Scripts/Skills/Anatomy.cs +++ b/Scripts/Skills/Anatomy.cs @@ -9,7 +9,7 @@ namespace Server.SkillHandlers { public static void Initialize() { - SkillInfo.Table[(int)SkillName.Anatomy].Callback = new SkillUseCallback( OnUse ); + SkillInfo.Table[(int)SkillName.Anatomy].Callback = OnUse; } public static TimeSpan OnUse( Mobile m ) diff --git a/Scripts/Skills/AnimalLore.cs b/Scripts/Skills/AnimalLore.cs index 13c3bf1ab..495a10d90 100644 --- a/Scripts/Skills/AnimalLore.cs +++ b/Scripts/Skills/AnimalLore.cs @@ -9,7 +9,7 @@ namespace Server.SkillHandlers { public static void Initialize() { - SkillInfo.Table[(int)SkillName.AnimalLore].Callback = new SkillUseCallback( OnUse ); + SkillInfo.Table[(int)SkillName.AnimalLore].Callback = OnUse; } public static TimeSpan OnUse(Mobile m) diff --git a/Scripts/Skills/AnimalTaming.cs b/Scripts/Skills/AnimalTaming.cs index 603a30fcc..e2afadf79 100644 --- a/Scripts/Skills/AnimalTaming.cs +++ b/Scripts/Skills/AnimalTaming.cs @@ -15,7 +15,7 @@ namespace Server.SkillHandlers public static void Initialize() { - SkillInfo.Table[(int)SkillName.AnimalTaming].Callback = new SkillUseCallback( OnUse ); + SkillInfo.Table[(int)SkillName.AnimalTaming].Callback = OnUse; } private static bool m_DisableMessage; diff --git a/Scripts/Skills/ArmsLore.cs b/Scripts/Skills/ArmsLore.cs index 709cd6712..b82f76dc4 100644 --- a/Scripts/Skills/ArmsLore.cs +++ b/Scripts/Skills/ArmsLore.cs @@ -10,7 +10,7 @@ namespace Server.SkillHandlers { public static void Initialize() { - SkillInfo.Table[(int)SkillName.ArmsLore].Callback = new SkillUseCallback( OnUse ); + SkillInfo.Table[(int)SkillName.ArmsLore].Callback = OnUse; } public static TimeSpan OnUse(Mobile m) diff --git a/Scripts/Skills/Begging.cs b/Scripts/Skills/Begging.cs index ba282b240..43f867b44 100644 --- a/Scripts/Skills/Begging.cs +++ b/Scripts/Skills/Begging.cs @@ -10,7 +10,7 @@ namespace Server.SkillHandlers { public static void Initialize() { - SkillInfo.Table[(int)SkillName.Begging].Callback = new SkillUseCallback( OnUse ); + SkillInfo.Table[(int)SkillName.Begging].Callback = OnUse; } public static TimeSpan OnUse( Mobile m ) diff --git a/Scripts/Skills/DetectHidden.cs b/Scripts/Skills/DetectHidden.cs index 34605b5e0..14c4e628e 100644 --- a/Scripts/Skills/DetectHidden.cs +++ b/Scripts/Skills/DetectHidden.cs @@ -10,7 +10,7 @@ namespace Server.SkillHandlers { public static void Initialize() { - SkillInfo.Table[(int)SkillName.DetectHidden].Callback = new SkillUseCallback( OnUse ); + SkillInfo.Table[(int)SkillName.DetectHidden].Callback = OnUse; } public static TimeSpan OnUse( Mobile src ) diff --git a/Scripts/Skills/Discordance.cs b/Scripts/Skills/Discordance.cs index 329081b20..61bf745ce 100644 --- a/Scripts/Skills/Discordance.cs +++ b/Scripts/Skills/Discordance.cs @@ -10,14 +10,14 @@ namespace Server.SkillHandlers { public static void Initialize() { - SkillInfo.Table[(int)SkillName.Discordance].Callback = new SkillUseCallback( OnUse ); + SkillInfo.Table[(int)SkillName.Discordance].Callback = OnUse; } public static TimeSpan OnUse( Mobile m ) { m.RevealingAction(); - BaseInstrument.PickInstrument( m, new InstrumentPickedCallback( OnPickedInstrument ) ); + BaseInstrument.PickInstrument( m, OnPickedInstrument ); return TimeSpan.FromSeconds( 1.0 ); // Cannot use another skill for 1 second } @@ -236,7 +236,7 @@ namespace Server.SkillHandlers } DiscordanceInfo info = new DiscordanceInfo( from, targ, Math.Abs( effect ), mods ); - info.m_Timer = Timer.DelayCall( TimeSpan.Zero, TimeSpan.FromSeconds( 1.25 ), new TimerStateCallback( ProcessDiscordance ), info ); + info.m_Timer = Timer.DelayCall( TimeSpan.Zero, TimeSpan.FromSeconds( 1.25 ), ProcessDiscordance, info ); m_Table[targ] = info; } diff --git a/Scripts/Skills/EvalInt.cs b/Scripts/Skills/EvalInt.cs index 93d3fd809..cfd99b659 100644 --- a/Scripts/Skills/EvalInt.cs +++ b/Scripts/Skills/EvalInt.cs @@ -9,7 +9,7 @@ namespace Server.SkillHandlers { public static void Initialize() { - SkillInfo.Table[16].Callback = new SkillUseCallback( OnUse ); + SkillInfo.Table[16].Callback = OnUse; } public static TimeSpan OnUse( Mobile m ) diff --git a/Scripts/Skills/ForensicEval.cs b/Scripts/Skills/ForensicEval.cs index d275fe8fb..bcd6b578a 100644 --- a/Scripts/Skills/ForensicEval.cs +++ b/Scripts/Skills/ForensicEval.cs @@ -10,7 +10,7 @@ namespace Server.SkillHandlers { public static void Initialize() { - SkillInfo.Table[(int)SkillName.Forensics].Callback = new SkillUseCallback( OnUse ); + SkillInfo.Table[(int)SkillName.Forensics].Callback = OnUse; } public static TimeSpan OnUse( Mobile m ) diff --git a/Scripts/Skills/Hiding.cs b/Scripts/Skills/Hiding.cs index 3e0dd3e5e..83747b882 100644 --- a/Scripts/Skills/Hiding.cs +++ b/Scripts/Skills/Hiding.cs @@ -16,7 +16,7 @@ namespace Server.SkillHandlers public static void Initialize() { - SkillInfo.Table[21].Callback = new SkillUseCallback( OnUse ); + SkillInfo.Table[21].Callback = OnUse; } public static TimeSpan OnUse( Mobile m ) diff --git a/Scripts/Skills/Inscribe.cs b/Scripts/Skills/Inscribe.cs index dd39a3b26..e691046ef 100644 --- a/Scripts/Skills/Inscribe.cs +++ b/Scripts/Skills/Inscribe.cs @@ -9,7 +9,7 @@ namespace Server.SkillHandlers { public static void Initialize() { - SkillInfo.Table[(int)SkillName.Inscribe].Callback = new SkillUseCallback( OnUse ); + SkillInfo.Table[(int)SkillName.Inscribe].Callback = OnUse; } public static TimeSpan OnUse( Mobile m ) diff --git a/Scripts/Skills/ItemIdentification.cs b/Scripts/Skills/ItemIdentification.cs index e54028d2f..b98edb34b 100644 --- a/Scripts/Skills/ItemIdentification.cs +++ b/Scripts/Skills/ItemIdentification.cs @@ -8,7 +8,7 @@ namespace Server.Items { public static void Initialize() { - SkillInfo.Table[(int)SkillName.ItemID].Callback = new SkillUseCallback( OnUse ); + SkillInfo.Table[(int)SkillName.ItemID].Callback = OnUse; } public static TimeSpan OnUse( Mobile from ) diff --git a/Scripts/Skills/Meditation.cs b/Scripts/Skills/Meditation.cs index 3f8acb113..a19de4eb6 100644 --- a/Scripts/Skills/Meditation.cs +++ b/Scripts/Skills/Meditation.cs @@ -7,7 +7,7 @@ namespace Server.SkillHandlers { public static void Initialize() { - SkillInfo.Table[46].Callback = new SkillUseCallback( OnUse ); + SkillInfo.Table[46].Callback = OnUse; } public static bool CheckOkayHolding( Item item ) diff --git a/Scripts/Skills/Peacemaking.cs b/Scripts/Skills/Peacemaking.cs index 9a7e6084c..aee0f513b 100644 --- a/Scripts/Skills/Peacemaking.cs +++ b/Scripts/Skills/Peacemaking.cs @@ -9,14 +9,14 @@ namespace Server.SkillHandlers { public static void Initialize() { - SkillInfo.Table[(int)SkillName.Peacemaking].Callback = new SkillUseCallback( OnUse ); + SkillInfo.Table[(int)SkillName.Peacemaking].Callback = OnUse; } public static TimeSpan OnUse( Mobile m ) { m.RevealingAction(); - BaseInstrument.PickInstrument( m, new InstrumentPickedCallback( OnPickedInstrument ) ); + BaseInstrument.PickInstrument( m, OnPickedInstrument ); return TimeSpan.FromSeconds( 1.0 ); // Cannot use another skill for 1 second } diff --git a/Scripts/Skills/Poisoning.cs b/Scripts/Skills/Poisoning.cs index 1d2193c2f..9a9f91e99 100644 --- a/Scripts/Skills/Poisoning.cs +++ b/Scripts/Skills/Poisoning.cs @@ -8,7 +8,7 @@ namespace Server.SkillHandlers { public static void Initialize() { - SkillInfo.Table[(int)SkillName.Poisoning].Callback = new SkillUseCallback( OnUse ); + SkillInfo.Table[(int)SkillName.Poisoning].Callback = OnUse; } public static TimeSpan OnUse( Mobile m ) diff --git a/Scripts/Skills/Provocation.cs b/Scripts/Skills/Provocation.cs index 4f5a30230..c7afb8a92 100644 --- a/Scripts/Skills/Provocation.cs +++ b/Scripts/Skills/Provocation.cs @@ -9,14 +9,14 @@ namespace Server.SkillHandlers { public static void Initialize() { - SkillInfo.Table[(int)SkillName.Provocation].Callback = new SkillUseCallback( OnUse ); + SkillInfo.Table[(int)SkillName.Provocation].Callback = OnUse; } public static TimeSpan OnUse( Mobile m ) { m.RevealingAction(); - BaseInstrument.PickInstrument( m, new InstrumentPickedCallback( OnPickedInstrument ) ); + BaseInstrument.PickInstrument( m, OnPickedInstrument ); return TimeSpan.FromSeconds( 1.0 ); // Cannot use another skill for 1 second } diff --git a/Scripts/Skills/RemoveTrap.cs b/Scripts/Skills/RemoveTrap.cs index a7fc746f0..10526d498 100644 --- a/Scripts/Skills/RemoveTrap.cs +++ b/Scripts/Skills/RemoveTrap.cs @@ -10,7 +10,7 @@ namespace Server.SkillHandlers { public static void Initialize() { - SkillInfo.Table[(int)SkillName.RemoveTrap].Callback = new SkillUseCallback( OnUse ); + SkillInfo.Table[(int)SkillName.RemoveTrap].Callback = OnUse; } public static TimeSpan OnUse( Mobile m ) diff --git a/Scripts/Skills/Snooping.cs b/Scripts/Skills/Snooping.cs index a8d07190c..3cc0e95a5 100644 --- a/Scripts/Skills/Snooping.cs +++ b/Scripts/Skills/Snooping.cs @@ -11,7 +11,7 @@ namespace Server.SkillHandlers { public static void Configure() { - Container.SnoopHandler = new ContainerSnoopHandler( Container_Snoop ); + Container.SnoopHandler = Container_Snoop; } public static bool CheckSnoopAllowed( Mobile from, Mobile to ) diff --git a/Scripts/Skills/SpiritSpeak.cs b/Scripts/Skills/SpiritSpeak.cs index d5350123d..7962f5c9e 100644 --- a/Scripts/Skills/SpiritSpeak.cs +++ b/Scripts/Skills/SpiritSpeak.cs @@ -9,7 +9,7 @@ namespace Server.SkillHandlers { public static void Initialize() { - SkillInfo.Table[32].Callback = new SkillUseCallback( OnUse ); + SkillInfo.Table[32].Callback = OnUse; } public static TimeSpan OnUse( Mobile m ) diff --git a/Scripts/Skills/Stealing.cs b/Scripts/Skills/Stealing.cs index 0767d09d5..e810bc9ba 100644 --- a/Scripts/Skills/Stealing.cs +++ b/Scripts/Skills/Stealing.cs @@ -16,7 +16,7 @@ namespace Server.SkillHandlers { public static void Initialize() { - SkillInfo.Table[33].Callback = new SkillUseCallback( OnUse ); + SkillInfo.Table[33].Callback = OnUse; } public static readonly bool ClassicMode = false; diff --git a/Scripts/Skills/Stealth.cs b/Scripts/Skills/Stealth.cs index 11f81b538..72468f1b4 100644 --- a/Scripts/Skills/Stealth.cs +++ b/Scripts/Skills/Stealth.cs @@ -8,7 +8,7 @@ namespace Server.SkillHandlers { public static void Initialize() { - SkillInfo.Table[(int)SkillName.Stealth].Callback = new SkillUseCallback( OnUse ); + SkillInfo.Table[(int)SkillName.Stealth].Callback = OnUse; } public static double HidingRequirement => ( Core.ML ? 30.0 : ( Core.SE ? 50.0 : 80.0 ) ); diff --git a/Scripts/Skills/TasteID.cs b/Scripts/Skills/TasteID.cs index 01db63146..b73812c0b 100644 --- a/Scripts/Skills/TasteID.cs +++ b/Scripts/Skills/TasteID.cs @@ -9,7 +9,7 @@ namespace Server.SkillHandlers { public static void Initialize() { - SkillInfo.Table[(int)SkillName.TasteID].Callback = new SkillUseCallback( OnUse ); + SkillInfo.Table[(int)SkillName.TasteID].Callback = OnUse; } public static TimeSpan OnUse( Mobile m ) diff --git a/Scripts/Skills/Tracking.cs b/Scripts/Skills/Tracking.cs index a756724eb..fa1f58b39 100644 --- a/Scripts/Skills/Tracking.cs +++ b/Scripts/Skills/Tracking.cs @@ -11,7 +11,7 @@ namespace Server.SkillHandlers { public static void Initialize() { - SkillInfo.Table[(int)SkillName.Tracking].Callback = new SkillUseCallback( OnUse ); + SkillInfo.Table[(int)SkillName.Tracking].Callback = OnUse; } public static TimeSpan OnUse( Mobile m ) @@ -125,10 +125,10 @@ namespace Server.SkillHandlers private int m_Range; private static TrackTypeDelegate[] m_Delegates = { - new TrackTypeDelegate( IsAnimal ), - new TrackTypeDelegate( IsMonster ), - new TrackTypeDelegate( IsHumanNPC ), - new TrackTypeDelegate( IsPlayer ) + IsAnimal, + IsMonster, + IsHumanNPC, + IsPlayer }; private class InternalSorter : IComparer diff --git a/Scripts/SpecialSystems/Engines/GiftGiving.cs b/Scripts/SpecialSystems/Engines/GiftGiving.cs index c54a231df..03ab62200 100644 --- a/Scripts/SpecialSystems/Engines/GiftGiving.cs +++ b/Scripts/SpecialSystems/Engines/GiftGiving.cs @@ -21,7 +21,7 @@ namespace Server.Misc public static void Initialize() { - EventSink.Login += new LoginEventHandler( EventSink_Login ); + EventSink.Login += EventSink_Login; } private static void EventSink_Login( LoginEventArgs e ) diff --git a/Scripts/SpecialSystems/Engines/PreventInaccess.cs b/Scripts/SpecialSystems/Engines/PreventInaccess.cs index 6514dd1cb..4d654c0fb 100644 --- a/Scripts/SpecialSystems/Engines/PreventInaccess.cs +++ b/Scripts/SpecialSystems/Engines/PreventInaccess.cs @@ -33,7 +33,7 @@ namespace Server.Misc m_MoveHistory = new Dictionary(); if ( Enabled ) - EventSink.Login += new LoginEventHandler( OnLogin ); + EventSink.Login += OnLogin; } public static void OnLogin( LoginEventArgs e ) diff --git a/Scripts/SpecialSystems/Engines/TestCenter.cs b/Scripts/SpecialSystems/Engines/TestCenter.cs index f46fc037f..085d80afa 100644 --- a/Scripts/SpecialSystems/Engines/TestCenter.cs +++ b/Scripts/SpecialSystems/Engines/TestCenter.cs @@ -15,7 +15,7 @@ namespace Server.Misc { // Register our speech handler if ( Enabled ) - EventSink.Speech += new SpeechEventHandler( EventSink_Speech ); + EventSink.Speech += EventSink_Speech; } private static void EventSink_Speech( SpeechEventArgs args ) diff --git a/Scripts/Spells/Base/SpellHelper.cs b/Scripts/Spells/Base/SpellHelper.cs index 9d51b3271..22d3b78b9 100644 --- a/Scripts/Spells/Base/SpellHelper.cs +++ b/Scripts/Spells/Base/SpellHelper.cs @@ -563,25 +563,25 @@ namespace Server.Spells private delegate bool TravelValidator( Map map, Point3D loc ); private static TravelValidator[] m_Validators = { - new TravelValidator( IsFeluccaT2A ), - new TravelValidator( IsKhaldun ), - new TravelValidator( IsIlshenar ), - new TravelValidator( IsTrammelWind ), - new TravelValidator( IsFeluccaWind ), - new TravelValidator( IsFeluccaDungeon ), - new TravelValidator( IsTrammelSolenHive ), - new TravelValidator( IsFeluccaSolenHive ), - new TravelValidator( IsCrystalCave ), - new TravelValidator( IsDoomGauntlet ), - new TravelValidator( IsDoomFerry ), - new TravelValidator( IsSafeZone ), - new TravelValidator( IsFactionStronghold ), - new TravelValidator( IsChampionSpawn ), - new TravelValidator( IsTokunoDungeon ), - new TravelValidator( IsLampRoom ), - new TravelValidator( IsGuardianRoom ), - new TravelValidator( IsHeartwood ), - new TravelValidator( IsMLDungeon ) + IsFeluccaT2A, + IsKhaldun, + IsIlshenar, + IsTrammelWind, + IsFeluccaWind, + IsFeluccaDungeon, + IsTrammelSolenHive, + IsFeluccaSolenHive, + IsCrystalCave, + IsDoomGauntlet, + IsDoomFerry, + IsSafeZone, + IsFactionStronghold, + IsChampionSpawn, + IsTokunoDungeon, + IsLampRoom, + IsGuardianRoom, + IsHeartwood, + IsMLDungeon }; private static bool[,] m_Rules = { diff --git a/Scripts/Spells/Mysticism/SpellPlagueSpell.cs b/Scripts/Spells/Mysticism/SpellPlagueSpell.cs index 65e01b126..37c66c86b 100644 --- a/Scripts/Spells/Mysticism/SpellPlagueSpell.cs +++ b/Scripts/Spells/Mysticism/SpellPlagueSpell.cs @@ -8,7 +8,7 @@ namespace Server.Spells.Mysticism { public static void Initialize() { - EventSink.PlayerDeath += new PlayerDeathEventHandler( OnPlayerDeath ); + EventSink.PlayerDeath += OnPlayerDeath; } private static SpellInfo m_Info = new SpellInfo( @@ -149,7 +149,7 @@ namespace Server.Spells.Mysticism public void Start() { - m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 8.0 ), new TimerCallback( EndPlague ) ); + m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 8.0 ), EndPlague ); m_Timer.Start(); BuffInfo.AddBuff( m_Target, new BuffInfo( BuffIcon.SpellPlague, 1031690, 1080167, TimeSpan.FromSeconds( 8.5 ), m_Target ) ); diff --git a/Scripts/Spells/Necromancy/AnimateDeadSpell.cs b/Scripts/Spells/Necromancy/AnimateDeadSpell.cs index 3481015f3..3093992a3 100644 --- a/Scripts/Spells/Necromancy/AnimateDeadSpell.cs +++ b/Scripts/Spells/Necromancy/AnimateDeadSpell.cs @@ -266,7 +266,7 @@ namespace Server.Spells.Necromancy list.Add( summoned ); if ( list.Count > 3 ) - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( list[0].Kill ) ); + Timer.DelayCall( TimeSpan.Zero, list[0].Kill ); Timer.DelayCall( TimeSpan.FromSeconds( 2.0 ), TimeSpan.FromSeconds( 2.0 ), new TimerStateCallback( Summoned_Damage ), summoned ); } diff --git a/Scripts/Spells/Ninjitsu/AnimalForm.cs b/Scripts/Spells/Ninjitsu/AnimalForm.cs index be6fb194e..fb6b4a1d7 100644 --- a/Scripts/Spells/Ninjitsu/AnimalForm.cs +++ b/Scripts/Spells/Ninjitsu/AnimalForm.cs @@ -13,7 +13,7 @@ namespace Server.Spells.Ninjitsu { public static void Initialize() { - EventSink.Login += new LoginEventHandler(OnLogin); + EventSink.Login += OnLogin; } public static void OnLogin(LoginEventArgs e) @@ -584,7 +584,7 @@ namespace Server.Spells.Ninjitsu m_Mobile.Freeze(TimeSpan.FromSeconds(1)); m_Mobile.PlaySound(0x16A); - DelayCall(TimeSpan.FromSeconds(1.3), new TimerStateCallback(BreathEffect_Callback), m_LastTarget); + DelayCall(TimeSpan.FromSeconds(1.3), BreathEffect_Callback, m_LastTarget); } m_Counter = Math.Min((int)m_Mobile.GetDistanceToSqrt(m_LastTarget), 10); @@ -601,7 +601,7 @@ namespace Server.Spells.Ninjitsu m_Mobile.PlaySound(0x227); Effects.SendMovingEffect(m_Mobile, target, 0x36D4, 5, 0, false, false, 0, 0); - DelayCall(TimeSpan.FromSeconds(1), new TimerStateCallback(BreathDamage_Callback), target); + DelayCall(TimeSpan.FromSeconds(1), BreathDamage_Callback, target); } } diff --git a/Scripts/Spells/Spellweaving/EtherealVoyage.cs b/Scripts/Spells/Spellweaving/EtherealVoyage.cs index d96594e01..eb031a26b 100644 --- a/Scripts/Spells/Spellweaving/EtherealVoyage.cs +++ b/Scripts/Spells/Spellweaving/EtherealVoyage.cs @@ -24,13 +24,13 @@ namespace Server.Spells.Spellweaving public static void Initialize() { - EventSink.AggressiveAction += new AggressiveActionEventHandler( delegate( AggressiveActionEventArgs e ) + EventSink.AggressiveAction += delegate( AggressiveActionEventArgs e ) { if ( TransformationSpellHelper.UnderTransformation( e.Aggressor, typeof( EtherealVoyageSpell ) ) ) { TransformationSpellHelper.RemoveContext( e.Aggressor, true ); } - } ); + }; } public override bool CheckCast() @@ -64,7 +64,7 @@ namespace Server.Spells.Spellweaving TimeSpan duration = TimeSpan.FromSeconds( 12 + (int)(skill / 24) + (FocusLevel * 2) ); - Timer.DelayCall( duration, new TimerStateCallback( RemoveEffect ), Caster ); + Timer.DelayCall( duration, RemoveEffect, Caster ); Caster.BeginAction( typeof( EtherealVoyageSpell ) ); //Cannot cast this spell for another 5 minutes(300sec) after effect removed. diff --git a/Scripts/Spells/Spellweaving/GiftOfLife.cs b/Scripts/Spells/Spellweaving/GiftOfLife.cs index 12b9a630d..6f7a1c8f9 100644 --- a/Scripts/Spells/Spellweaving/GiftOfLife.cs +++ b/Scripts/Spells/Spellweaving/GiftOfLife.cs @@ -25,10 +25,10 @@ namespace Server.Spells.Spellweaving public static void Initialize() { - EventSink.PlayerDeath += new PlayerDeathEventHandler( delegate( PlayerDeathEventArgs e ) + EventSink.PlayerDeath += delegate( PlayerDeathEventArgs e ) { HandleDeath( e.Mobile ); - } ); + }; } public override void OnCast() @@ -93,7 +93,7 @@ namespace Server.Spells.Spellweaving public static void HandleDeath( Mobile m ) { if ( m_Table.ContainsKey( m ) ) - Timer.DelayCall( TimeSpan.FromSeconds( Utility.RandomMinMax( 2, 4 ) ), new TimerStateCallback( HandleDeath_OnCallback ), m ); + Timer.DelayCall( TimeSpan.FromSeconds( Utility.RandomMinMax( 2, 4 ) ), HandleDeath_OnCallback, m ); } private static void HandleDeath_OnCallback( Mobile m ) diff --git a/Scripts/Spells/Spellweaving/Items/TransientItem.cs b/Scripts/Spells/Spellweaving/Items/TransientItem.cs index d7829b060..6ecf860e9 100644 --- a/Scripts/Spells/Spellweaving/Items/TransientItem.cs +++ b/Scripts/Spells/Spellweaving/Items/TransientItem.cs @@ -73,7 +73,7 @@ namespace Server.Items m_CreationTime = DateTime.UtcNow; m_LifeSpan = lifeSpan; - m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 5 ), TimeSpan.FromSeconds( 5 ), new TimerCallback( CheckExpiry ) ); + m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 5 ), TimeSpan.FromSeconds( 5 ), CheckExpiry ); } public TransientItem( Serial serial ) @@ -107,7 +107,7 @@ namespace Server.Items m_LifeSpan = reader.ReadTimeSpan(); m_CreationTime = reader.ReadDateTime(); - m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 5 ), TimeSpan.FromSeconds( 5 ), new TimerCallback( CheckExpiry ) ); + m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 5 ), TimeSpan.FromSeconds( 5 ), CheckExpiry ); } } } diff --git a/Scripts/Spells/Spellweaving/ReaperForm.cs b/Scripts/Spells/Spellweaving/ReaperForm.cs index 6a01e5a20..913e1f482 100644 --- a/Scripts/Spells/Spellweaving/ReaperForm.cs +++ b/Scripts/Spells/Spellweaving/ReaperForm.cs @@ -11,7 +11,7 @@ namespace Server.Spells.Spellweaving public static void Initialize() { - EventSink.Login += new LoginEventHandler( OnLogin ); + EventSink.Login += OnLogin; } public static void OnLogin( LoginEventArgs e ) diff --git a/Server/Item.cs b/Server/Item.cs index 734520220..0f4cecffa 100644 --- a/Server/Item.cs +++ b/Server/Item.cs @@ -2644,7 +2644,7 @@ namespace Server } if ( HeldBy != null ) - Timer.DelayCall( TimeSpan.Zero, new TimerCallback( FixHolding_Sandbox ) ); + Timer.DelayCall( TimeSpan.Zero, FixHolding_Sandbox ); //if ( version < 9 ) VerifyCompactInfo(); diff --git a/Server/Network/Listener.cs b/Server/Network/Listener.cs index e3d4755cd..e73a03aab 100644 --- a/Server/Network/Listener.cs +++ b/Server/Network/Listener.cs @@ -64,7 +64,7 @@ namespace Server.Network #if NewAsyncSockets m_EventArgs = new SocketAsyncEventArgs(); - m_EventArgs.Completed += new EventHandler( Accept_Completion ); + m_EventArgs.Completed += Accept_Completion; Accept_Start(); #else m_OnAccept = new AsyncCallback( OnAccept ); diff --git a/Server/Network/NetState.cs b/Server/Network/NetState.cs index c3e172bfc..15711880c 100644 --- a/Server/Network/NetState.cs +++ b/Server/Network/NetState.cs @@ -559,11 +559,11 @@ namespace Server.Network { #if NewAsyncSockets public void Start() { m_ReceiveEventArgs = new SocketAsyncEventArgs(); - m_ReceiveEventArgs.Completed += new EventHandler( Receive_Completion ); + m_ReceiveEventArgs.Completed += Receive_Completion; m_ReceiveEventArgs.SetBuffer( m_RecvBuffer, 0, m_RecvBuffer.Length ); m_SendEventArgs = new SocketAsyncEventArgs(); - m_SendEventArgs.Completed += new EventHandler( Send_Completion ); + m_SendEventArgs.Completed += Send_Completion; m_Running = true; @@ -1049,7 +1049,7 @@ namespace Server.Network { } public static void Initialize() { - Timer.DelayCall( TimeSpan.FromMinutes( 1.0 ), TimeSpan.FromMinutes( 1.5 ), new TimerCallback( CheckAllAlive ) ); + Timer.DelayCall( TimeSpan.FromMinutes( 1.0 ), TimeSpan.FromMinutes( 1.5 ), CheckAllAlive ); } public static void CheckAllAlive() { diff --git a/Server/Network/PacketHandlers.cs b/Server/Network/PacketHandlers.cs index 787e9cb7f..6f71e8928 100644 --- a/Server/Network/PacketHandlers.cs +++ b/Server/Network/PacketHandlers.cs @@ -77,98 +77,98 @@ namespace Server.Network m_EncodedHandlersLow = new EncodedPacketHandler[0x100]; m_EncodedHandlersHigh = new Dictionary(); - Register( 0x00, 104, false, new OnPacketReceive( CreateCharacter ) ); - Register( 0x01, 5, false, new OnPacketReceive( Disconnect ) ); - Register( 0x02, 7, true, new OnPacketReceive( MovementReq ) ); - Register( 0x03, 0, true, new OnPacketReceive( AsciiSpeech ) ); - Register( 0x04, 2, true, new OnPacketReceive( GodModeRequest ) ); - Register( 0x05, 5, true, new OnPacketReceive( AttackReq ) ); - Register( 0x06, 5, true, new OnPacketReceive( UseReq ) ); - Register( 0x07, 7, true, new OnPacketReceive( LiftReq ) ); - Register( 0x08, 14, true, new OnPacketReceive( DropReq ) ); - Register( 0x09, 5, true, new OnPacketReceive( LookReq ) ); - Register( 0x0A, 11, true, new OnPacketReceive( Edit ) ); - Register( 0x12, 0, true, new OnPacketReceive( TextCommand ) ); - Register( 0x13, 10, true, new OnPacketReceive( EquipReq ) ); - Register( 0x14, 6, true, new OnPacketReceive( ChangeZ ) ); - Register( 0x22, 3, true, new OnPacketReceive( Resynchronize ) ); - Register( 0x2C, 2, true, new OnPacketReceive( DeathStatusResponse ) ); - Register( 0x34, 10, true, new OnPacketReceive( MobileQuery ) ); - Register( 0x3A, 0, true, new OnPacketReceive( ChangeSkillLock ) ); - Register( 0x3B, 0, true, new OnPacketReceive( VendorBuyReply ) ); - Register( 0x47, 11, true, new OnPacketReceive( NewTerrain ) ); - Register( 0x48, 73, true, new OnPacketReceive( NewAnimData ) ); - Register( 0x58, 106, true, new OnPacketReceive( NewRegion ) ); - Register( 0x5D, 73, false, new OnPacketReceive( PlayCharacter ) ); - Register( 0x61, 9, true, new OnPacketReceive( DeleteStatic ) ); - Register( 0x6C, 19, true, new OnPacketReceive( TargetResponse ) ); - Register( 0x6F, 0, true, new OnPacketReceive( SecureTrade ) ); - Register( 0x72, 5, true, new OnPacketReceive( SetWarMode ) ); - Register( 0x73, 2, false, new OnPacketReceive( PingReq ) ); - Register( 0x75, 35, true, new OnPacketReceive( RenameRequest ) ); - Register( 0x79, 9, true, new OnPacketReceive( ResourceQuery ) ); - Register( 0x7E, 2, true, new OnPacketReceive( GodviewQuery ) ); - Register( 0x7D, 13, true, new OnPacketReceive( MenuResponse ) ); - Register( 0x80, 62, false, new OnPacketReceive( AccountLogin ) ); - Register( 0x83, 39, false, new OnPacketReceive( DeleteCharacter ) ); - Register( 0x91, 65, false, new OnPacketReceive( GameLogin ) ); - Register( 0x95, 9, true, new OnPacketReceive( HuePickerResponse ) ); - Register( 0x96, 0, true, new OnPacketReceive( GameCentralMoniter ) ); - Register( 0x98, 0, true, new OnPacketReceive( MobileNameRequest ) ); - Register( 0x9A, 0, true, new OnPacketReceive( AsciiPromptResponse ) ); - Register( 0x9B, 258, true, new OnPacketReceive( HelpRequest ) ); - Register( 0x9D, 51, true, new OnPacketReceive( GMSingle ) ); - Register( 0x9F, 0, true, new OnPacketReceive( VendorSellReply ) ); - Register( 0xA0, 3, false, new OnPacketReceive( PlayServer ) ); - Register( 0xA4, 149, false, new OnPacketReceive( SystemInfo ) ); - Register( 0xA7, 4, true, new OnPacketReceive( RequestScrollWindow ) ); - Register( 0xAD, 0, true, new OnPacketReceive( UnicodeSpeech ) ); - Register( 0xB1, 0, true, new OnPacketReceive( DisplayGumpResponse ) ); - Register( 0xB5, 64, true, new OnPacketReceive( ChatRequest ) ); - Register( 0xB6, 9, true, new OnPacketReceive( ObjectHelpRequest ) ); - Register( 0xB8, 0, true, new OnPacketReceive( ProfileReq ) ); - Register( 0xBB, 9, false, new OnPacketReceive( AccountID ) ); - Register( 0xBD, 0, false, new OnPacketReceive( ClientVersion ) ); - Register( 0xBE, 0, true, new OnPacketReceive( AssistVersion ) ); - Register( 0xBF, 0, true, new OnPacketReceive( ExtendedCommand ) ); - Register( 0xC2, 0, true, new OnPacketReceive( UnicodePromptResponse ) ); - Register( 0xC8, 2, true, new OnPacketReceive( SetUpdateRange ) ); - Register( 0xC9, 6, true, new OnPacketReceive( TripTime ) ); - Register( 0xCA, 6, true, new OnPacketReceive( UTripTime ) ); - Register( 0xCF, 0, false, new OnPacketReceive( AccountLogin ) ); - Register( 0xD0, 0, true, new OnPacketReceive( ConfigurationFile ) ); - Register( 0xD1, 2, true, new OnPacketReceive( LogoutReq ) ); - Register( 0xD6, 0, true, new OnPacketReceive( BatchQueryProperties ) ); - Register( 0xD7, 0, true, new OnPacketReceive( EncodedCommand ) ); - Register( 0xE1, 0, false, new OnPacketReceive( ClientType ) ); - Register( 0xEF, 21, false, new OnPacketReceive( LoginServerSeed ) ); - Register( 0xF4, 0, false, new OnPacketReceive( CrashReport ) ); - Register( 0xF8, 106, false, new OnPacketReceive( CreateCharacter70160 ) ); + Register( 0x00, 104, false, CreateCharacter ); + Register( 0x01, 5, false, Disconnect ); + Register( 0x02, 7, true, MovementReq ); + Register( 0x03, 0, true, AsciiSpeech ); + Register( 0x04, 2, true, GodModeRequest ); + Register( 0x05, 5, true, AttackReq ); + Register( 0x06, 5, true, UseReq ); + Register( 0x07, 7, true, LiftReq ); + Register( 0x08, 14, true, DropReq ); + Register( 0x09, 5, true, LookReq ); + Register( 0x0A, 11, true, Edit ); + Register( 0x12, 0, true, TextCommand ); + Register( 0x13, 10, true, EquipReq ); + Register( 0x14, 6, true, ChangeZ ); + Register( 0x22, 3, true, Resynchronize ); + Register( 0x2C, 2, true, DeathStatusResponse ); + Register( 0x34, 10, true, MobileQuery ); + Register( 0x3A, 0, true, ChangeSkillLock ); + Register( 0x3B, 0, true, VendorBuyReply ); + Register( 0x47, 11, true, NewTerrain ); + Register( 0x48, 73, true, NewAnimData ); + Register( 0x58, 106, true, NewRegion ); + Register( 0x5D, 73, false, PlayCharacter ); + Register( 0x61, 9, true, DeleteStatic ); + Register( 0x6C, 19, true, TargetResponse ); + Register( 0x6F, 0, true, SecureTrade ); + Register( 0x72, 5, true, SetWarMode ); + Register( 0x73, 2, false, PingReq ); + Register( 0x75, 35, true, RenameRequest ); + Register( 0x79, 9, true, ResourceQuery ); + Register( 0x7E, 2, true, GodviewQuery ); + Register( 0x7D, 13, true, MenuResponse ); + Register( 0x80, 62, false, AccountLogin ); + Register( 0x83, 39, false, DeleteCharacter ); + Register( 0x91, 65, false, GameLogin ); + Register( 0x95, 9, true, HuePickerResponse ); + Register( 0x96, 0, true, GameCentralMoniter ); + Register( 0x98, 0, true, MobileNameRequest ); + Register( 0x9A, 0, true, AsciiPromptResponse ); + Register( 0x9B, 258, true, HelpRequest ); + Register( 0x9D, 51, true, GMSingle ); + Register( 0x9F, 0, true, VendorSellReply ); + Register( 0xA0, 3, false, PlayServer ); + Register( 0xA4, 149, false, SystemInfo ); + Register( 0xA7, 4, true, RequestScrollWindow ); + Register( 0xAD, 0, true, UnicodeSpeech ); + Register( 0xB1, 0, true, DisplayGumpResponse ); + Register( 0xB5, 64, true, ChatRequest ); + Register( 0xB6, 9, true, ObjectHelpRequest ); + Register( 0xB8, 0, true, ProfileReq ); + Register( 0xBB, 9, false, AccountID ); + Register( 0xBD, 0, false, ClientVersion ); + Register( 0xBE, 0, true, AssistVersion ); + Register( 0xBF, 0, true, ExtendedCommand ); + Register( 0xC2, 0, true, UnicodePromptResponse ); + Register( 0xC8, 2, true, SetUpdateRange ); + Register( 0xC9, 6, true, TripTime ); + Register( 0xCA, 6, true, UTripTime ); + Register( 0xCF, 0, false, AccountLogin ); + Register( 0xD0, 0, true, ConfigurationFile ); + Register( 0xD1, 2, true, LogoutReq ); + Register( 0xD6, 0, true, BatchQueryProperties ); + Register( 0xD7, 0, true, EncodedCommand ); + Register( 0xE1, 0, false, ClientType ); + Register( 0xEF, 21, false, LoginServerSeed ); + Register( 0xF4, 0, false, CrashReport ); + Register( 0xF8, 106, false, CreateCharacter70160 ); - Register6017( 0x08, 15, true, new OnPacketReceive( DropReq6017 ) ); + Register6017( 0x08, 15, true, DropReq6017 ); - RegisterExtended( 0x05, false, new OnPacketReceive( ScreenSize ) ); - RegisterExtended( 0x06, true, new OnPacketReceive( PartyMessage ) ); - RegisterExtended( 0x07, true, new OnPacketReceive( QuestArrow ) ); - RegisterExtended( 0x09, true, new OnPacketReceive( DisarmRequest ) ); - RegisterExtended( 0x0A, true, new OnPacketReceive( StunRequest ) ); - RegisterExtended( 0x0B, false, new OnPacketReceive( Language ) ); - RegisterExtended( 0x0C, true, new OnPacketReceive( CloseStatus ) ); - RegisterExtended( 0x0E, true, new OnPacketReceive( Animate ) ); - RegisterExtended( 0x0F, false, new OnPacketReceive( Empty ) ); // What's this? - RegisterExtended( 0x10, true, new OnPacketReceive( QueryProperties ) ); - RegisterExtended( 0x13, true, new OnPacketReceive( ContextMenuRequest ) ); - RegisterExtended( 0x15, true, new OnPacketReceive( ContextMenuResponse ) ); - RegisterExtended( 0x1A, true, new OnPacketReceive( StatLockChange ) ); - RegisterExtended( 0x1C, true, new OnPacketReceive( CastSpell ) ); - RegisterExtended( 0x24, false, new OnPacketReceive( UnhandledBF ) ); - RegisterExtended( 0x2C, true, new OnPacketReceive( BandageTarget ) ); - RegisterExtended( 0x32, true, new OnPacketReceive( ToggleFlying ) ); + RegisterExtended( 0x05, false, ScreenSize ); + RegisterExtended( 0x06, true, PartyMessage ); + RegisterExtended( 0x07, true, QuestArrow ); + RegisterExtended( 0x09, true, DisarmRequest ); + RegisterExtended( 0x0A, true, StunRequest ); + RegisterExtended( 0x0B, false, Language ); + RegisterExtended( 0x0C, true, CloseStatus ); + RegisterExtended( 0x0E, true, Animate ); + RegisterExtended( 0x0F, false, Empty ); // What's this? + RegisterExtended( 0x10, true, QueryProperties ); + RegisterExtended( 0x13, true, ContextMenuRequest ); + RegisterExtended( 0x15, true, ContextMenuResponse ); + RegisterExtended( 0x1A, true, StatLockChange ); + RegisterExtended( 0x1C, true, CastSpell ); + RegisterExtended( 0x24, false, UnhandledBF ); + RegisterExtended( 0x2C, true, BandageTarget ); + RegisterExtended( 0x32, true, ToggleFlying ); - RegisterEncoded( 0x19, true, new OnEncodedPacketReceive( SetAbility ) ); - RegisterEncoded( 0x28, true, new OnEncodedPacketReceive( GuildGumpRequest ) ); + RegisterEncoded( 0x19, true, SetAbility ); + RegisterEncoded( 0x28, true, GuildGumpRequest ); - RegisterEncoded( 0x32, true, new OnEncodedPacketReceive( QuestGumpRequest ) ); + RegisterEncoded( 0x32, true, QuestGumpRequest ); } public static void Register( int packetID, int length, bool ingame, OnPacketReceive onReceive ) diff --git a/Server/Random.cs b/Server/Random.cs index 8e32c8eea..c9e55a815 100644 --- a/Server/Random.cs +++ b/Server/Random.cs @@ -115,7 +115,7 @@ namespace Server { public CSPRandom() { _CSP.GetBytes(_Working); - ThreadPool.QueueUserWorkItem(new WaitCallback(Fill)); + ThreadPool.QueueUserWorkItem(Fill); } private void CheckSwap(int c) { @@ -131,7 +131,7 @@ namespace Server { _filled.Reset(); - ThreadPool.QueueUserWorkItem(new WaitCallback(Fill)); + ThreadPool.QueueUserWorkItem(Fill); } private void Fill(object o) { @@ -235,7 +235,7 @@ namespace Server { public RDRandUnix() { SafeNativeMethods.rdrand_get_bytes(BUFFER_SIZE, _Working); - ThreadPool.QueueUserWorkItem(new WaitCallback(Fill)); + ThreadPool.QueueUserWorkItem(Fill); } public bool IsSupported() @@ -258,7 +258,7 @@ namespace Server { _filled.Reset(); - ThreadPool.QueueUserWorkItem(new WaitCallback(Fill)); + ThreadPool.QueueUserWorkItem(Fill); } private void Fill(object o) @@ -372,7 +372,7 @@ namespace Server { public RDRand32() { SafeNativeMethods.rdrand_get_bytes(BUFFER_SIZE, _Working); - ThreadPool.QueueUserWorkItem(new WaitCallback(Fill)); + ThreadPool.QueueUserWorkItem(Fill); } public bool IsSupported() { @@ -393,7 +393,7 @@ namespace Server { _filled.Reset(); - ThreadPool.QueueUserWorkItem(new WaitCallback(Fill)); + ThreadPool.QueueUserWorkItem(Fill); } private void Fill(object o) { @@ -491,7 +491,7 @@ namespace Server { public RDRand64() { SafeNativeMethods.rdrand_get_bytes(BUFFER_SIZE, _Working); - ThreadPool.QueueUserWorkItem(new WaitCallback(Fill)); + ThreadPool.QueueUserWorkItem(Fill); } public bool IsSupported() { @@ -512,7 +512,7 @@ namespace Server { _filled.Reset(); - ThreadPool.QueueUserWorkItem(new WaitCallback(Fill)); + ThreadPool.QueueUserWorkItem(Fill); } private void Fill(object o) { diff --git a/Server/Serialization.cs b/Server/Serialization.cs index aa34aa381..34cb6a99d 100644 --- a/Server/Serialization.cs +++ b/Server/Serialization.cs @@ -1423,7 +1423,7 @@ namespace Server if ( m_WorkerThread == null || !m_WorkerThread.IsAlive ) { - m_WorkerThread = new Thread( new ThreadStart( new WorkerThread( this ).Worker ) ); + m_WorkerThread = new Thread( new WorkerThread( this ).Worker ); m_WorkerThread.Priority = ThreadPriority.BelowNormal; m_WorkerThread.Start(); } diff --git a/Server/Utility.cs b/Server/Utility.cs index 7beb6cdf3..5ec3bd3ce 100644 --- a/Server/Utility.cs +++ b/Server/Utility.cs @@ -1337,7 +1337,7 @@ namespace Server public static List CastConvertList( List list ) where TOutput : TInput { - return list.ConvertAll( new Converter( delegate( TInput value ) { return (TOutput)value; } ) ); + return list.ConvertAll( delegate( TInput value ) { return (TOutput)value; } ); } public static List SafeConvertList( List list ) where TOutput : class