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
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using Server.Commands;
|
||||
using Server.Network;
|
||||
|
|
@ -49,24 +48,20 @@ namespace Server.Gumps
|
|||
|
||||
private static readonly int BackWidth = BorderSize + TotalWidth + BorderSize;
|
||||
private static readonly int BackHeight = BorderSize + TotalHeight + BorderSize;
|
||||
private readonly List<object> m_List;
|
||||
private readonly Mobile m_Mobile;
|
||||
private readonly object m_Object;
|
||||
private readonly int m_Page;
|
||||
private readonly PropertyInfo m_Property;
|
||||
private readonly Stack<StackEntry> m_Stack;
|
||||
private readonly PropertiesGump m_PropertiesGump;
|
||||
|
||||
public SetTimeSpanGump(
|
||||
PropertyInfo prop, Mobile mobile, object o, Stack<StackEntry> stack, int page, List<object> list
|
||||
PropertyInfo prop, Mobile mobile, object o, PropertiesGump propertiesGump
|
||||
)
|
||||
: base(GumpOffsetX, GumpOffsetY)
|
||||
{
|
||||
m_PropertiesGump = propertiesGump;
|
||||
m_Property = prop;
|
||||
m_Mobile = mobile;
|
||||
m_Object = o;
|
||||
m_Stack = stack;
|
||||
m_Page = page;
|
||||
m_List = list;
|
||||
|
||||
var ts = (TimeSpan)(prop?.GetValue(o, null) ?? new TimeSpan());
|
||||
|
||||
|
|
@ -239,7 +234,7 @@ namespace Server.Gumps
|
|||
{
|
||||
CommandLogging.LogChangeProperty(m_Mobile, m_Object, m_Property.Name, toSet.ToString());
|
||||
m_Property.SetValue(m_Object, toSet, null);
|
||||
PropertiesGump.OnValueChanged(m_Object, m_Property, m_Stack);
|
||||
m_PropertiesGump.OnValueChanged(m_Object, m_Property);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
|
@ -249,7 +244,7 @@ namespace Server.Gumps
|
|||
|
||||
if (shouldSend)
|
||||
{
|
||||
m_Mobile.SendGump(new PropertiesGump(m_Mobile, m_Object, m_Stack, m_List, m_Page));
|
||||
m_PropertiesGump.SendPropertiesGump();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue