Files
abysmal-isle/Scripts/Scripts-master/Commands/Addon2Static.cs
Unstable Kitsune b918192e4e Overwrite
Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
2023-11-28 23:20:26 -05:00

56 lines
1.6 KiB
C#

using System;
using System.Collections;
using Server;
using Server.Targeting;
using Server.Items;
using Server.Multis;
using Server.Network;
namespace Server.Commands
{
public class Addon2Static
{
public static void Initialize()
{
CommandSystem.Register( "Addon2Static", AccessLevel.Administrator, new CommandEventHandler( Addon2Static_OnCommand ) );
}
[Usage( "Addon2Static" )]
[Description( "Statify an Addon structure" )]
private static void Addon2Static_OnCommand( CommandEventArgs e )
{
e.Mobile.SendMessage("Please select the Addon structure you want to statify");
e.Mobile.Target = new AddonSelector();
}
///// //// /// // / BEGIN TARGET / // /// //// /////
private class AddonSelector : Target
{
public AddonSelector () : base( -1, false, TargetFlags.None )
{
}
protected override void OnTarget( Mobile from, object targeted )
{
if ( targeted is AddonComponent )
{
BaseAddon design = ((AddonComponent)targeted).Addon;
if ( design.Components.Count > 0 )
{
for ( int i = 0; i < design.Components.Count; ++i )
{
AddonComponent component = (AddonComponent)((design.Components)[i]);
Static equivalent = new Static( component.HuedItemID ); //( component.ItemID );
equivalent.Location = component.Location; //component.Location;
equivalent.Map = component.Map; //component.Map;
equivalent.Hue = component.Hue; //component.Map;
}
}
design.Delete();
from.SendMessage("Addon structure statified. You can now freeze it.");
}
}
}
///// //// /// // / END TARGET / // /// //// /////
}
}