53 lines
1.4 KiB
C#
53 lines
1.4 KiB
C#
using System.Xml.Linq;
|
|
|
|
public class MinEventActionHideNPCRebirth : MinEventActionTargetedBase
|
|
{
|
|
private bool hide;
|
|
|
|
public override void Execute(MinEventParams _params)
|
|
{
|
|
var entity = _params.Self as EntityNPCRebirth;
|
|
if (entity == null)
|
|
{
|
|
return;
|
|
}
|
|
|
|
float flHidden = entity.Buffs.GetCustomVar("$FR_NPC_Hidden");
|
|
|
|
//Log.Out("MinEventActionHideNPCRebirth-Execute flHidden: " + flHidden);
|
|
|
|
if (hide)
|
|
{
|
|
//Log.Out("MinEventActionHideNPCRebirth-Execute HIDE 1");
|
|
if (flHidden == 0)
|
|
{
|
|
//Log.Out("MinEventActionHideNPCRebirth-Execute HIDE 2");
|
|
entity.HideNPC(true);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
//Log.Out("MinEventActionHideNPCRebirth-Execute SHOW 1");
|
|
if (flHidden == 1)
|
|
{
|
|
//Log.Out("MinEventActionHideNPCRebirth-Execute SHOW 2");
|
|
entity.HideNPC(false);
|
|
}
|
|
}
|
|
}
|
|
|
|
public override bool ParseXmlAttribute(XAttribute _attribute)
|
|
{
|
|
var flag = base.ParseXmlAttribute(_attribute);
|
|
if (!flag)
|
|
{
|
|
var name = _attribute.Name;
|
|
if (name != null)
|
|
if (name == "hide")
|
|
hide = StringParsers.ParseBool(_attribute.Value);
|
|
}
|
|
|
|
return flag;
|
|
}
|
|
|
|
} |