feat(spawners): Adds Respawn, EditSpawner, and SpawnProps commands (#532)
- [X] Adds `Respawn` command - [X] Adds `EditSpawner` command - Usage: `[global editspawner <type> <arguments> set <properties>` - This command replaces the arguments (optional) and properties of the affected spawners for that type - [X] Adds `SpawnProps` command - Usage: `[area spawnprops` - This command brings up a gump to modify targeted spawners based on the targeted entity. - To do this, the props/values are copied and then used to construct a properties list for the spawner entry. Closes #531
This commit is contained in:
parent
af021f748a
commit
0a435644eb
24 changed files with 708 additions and 377 deletions
|
|
@ -36,16 +36,12 @@ namespace Server.Commands.Generic
|
|||
return true;
|
||||
}
|
||||
|
||||
Mobile mob = null;
|
||||
|
||||
if (obj is Mobile m)
|
||||
Mobile mob = obj switch
|
||||
{
|
||||
mob = m;
|
||||
}
|
||||
else if (obj is Item item)
|
||||
{
|
||||
mob = item.RootParent as Mobile;
|
||||
}
|
||||
Mobile m => m,
|
||||
Item item => item.RootParent as Mobile,
|
||||
_ => null
|
||||
};
|
||||
|
||||
return mob == null || mob == from || from.AccessLevel > mob.AccessLevel;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -511,7 +511,7 @@ namespace Server.Commands
|
|||
light.ItemID = m_ItemID;
|
||||
}
|
||||
}
|
||||
else if (item is Spawner sp)
|
||||
else if (item is BaseSpawner sp)
|
||||
{
|
||||
sp.NextSpawn = TimeSpan.Zero;
|
||||
|
||||
|
|
|
|||
|
|
@ -508,7 +508,7 @@ namespace Server.Commands
|
|||
light.ItemID = m_ItemID;
|
||||
}
|
||||
}
|
||||
else if (item is Spawner sp)
|
||||
else if (item is BaseSpawner sp)
|
||||
{
|
||||
sp.NextSpawn = TimeSpan.Zero;
|
||||
|
||||
|
|
|
|||
|
|
@ -49,8 +49,8 @@ namespace Server.Commands
|
|||
CommandSystem.Register("Props", AccessLevel.Counselor, Props_OnCommand);
|
||||
}
|
||||
|
||||
[Usage("Props [serial]"),
|
||||
Description("Opens a menu where you can view and edit all properties of a targeted (or specified) object.")]
|
||||
[Usage("Props [serial]")]
|
||||
[Description("Opens a menu where you can view and edit all properties of a targeted (or specified) object.")]
|
||||
private static void Props_OnCommand(CommandEventArgs e)
|
||||
{
|
||||
if (e.Length == 1)
|
||||
|
|
@ -597,6 +597,7 @@ namespace Server.Commands
|
|||
return result ?? SetDirect(o, p, toSet);
|
||||
}
|
||||
|
||||
|
||||
private class PropsTarget : Target
|
||||
{
|
||||
public PropsTarget() : base(-1, true, TargetFlags.None)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue