Upload from upload_mods.ps1
This commit is contained in:
53
Scripts/MinEvents/NPCs/MinEventActionHideNPCRebirth.cs
Normal file
53
Scripts/MinEvents/NPCs/MinEventActionHideNPCRebirth.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user