servuo/Scripts/Commands/Generic/Extensions/WhereExtension.cs
TrueUO f608d123a4
Bug Fixes (#4762)
-Fixed issue where client helpers could bypass the container gump and add items directly to the seed box
-SearedFireAntGoo is no longer stackable
-Blue NPC's (mainly vendors, not initial innocent) can no longer be attacked on trammel maps
-Aggressors/Aggressed from pet masters now works properly. This was suspected to crated large numbers to redundant aggressor/aggressed added to a mobiles aggressor/aggressed lists
-Aggressive action for healing a mobile while fighting another mobile has been re-enabled
-AuraDamage is now a harmful act, ie those affected will aggro on your pet!
-MLDryads should no longer attack other wild creatures during Blackthorn Invasion Instance
-More code cleanup
2020-04-21 17:25:24 -07:00

38 lines
1.2 KiB
C#

using System;
namespace Server.Commands.Generic
{
public sealed class WhereExtension : BaseExtension
{
public static ExtensionInfo ExtInfo = new ExtensionInfo(20, "Where", -1, delegate () { return new WhereExtension(); });
private ObjectConditional m_Conditional;
public override ExtensionInfo Info => ExtInfo;
public ObjectConditional Conditional => m_Conditional;
public static void Initialize()
{
ExtensionInfo.Register(ExtInfo);
}
public override void Optimize(Mobile from, Type baseType, ref AssemblyEmitter assembly)
{
if (baseType == null)
throw new InvalidOperationException("Insanity.");
m_Conditional.Compile(ref assembly);
}
public override void Parse(Mobile from, string[] arguments, int offset, int size)
{
if (size < 1)
throw new Exception("Invalid condition syntax.");
m_Conditional = ObjectConditional.ParseDirect(from, arguments, offset, size);
}
public override bool IsValid(object obj)
{
return m_Conditional.CheckCondition(obj);
}
}
}